Using contexts in your code

Getting the current context is really easy, just call the 'd' accessor:

<?php
d
();
?>
this will return an object that represents the current context. What the current context is will depend on the drush command that is running and the context that was passed into that drush command. For example if you ran a site verify task, then the caller would name a site context, and thus initially calls to d() would return the site context. The values of the context are accessible as simple properties of this object.