Drush: Hooks

  1. 7.x doxygen/html/group__hooks.html
  2. master doxygen/html/group__hooks.html
Drush
Hooks

Functions

 hook_drush_init ()
 drush_COMMAND_init ()
 drush_hook_COMMAND_pre_validate ()
 drush_hook_COMMAND_validate ()
 drush_hook_pre_COMMAND ()
 drush_hook_COMMAND ()
 drush_hook_post_COMMAND ()
 hook_drush_exit ()
 hook_drush_command_alter (&$command)
 hook_drush_pm_post_download ($project, $release)
 hook_pm_post_update ($release_name, $release_candidate_version, $project_parent_path)
 hook_drush_pm_download_destination_alter (&$project, $release)
 drush_hook_pre_pm_enable ()
 hook_drush_sql_sync_sanitize ($source)
 hook_drush_help_alter (&$command)
 hook_drush_cache_clear (&$types)
 hook_drush_engine_type_info ()
 hook_drush_engine_ENGINE_TYPE ()
 hook_drush_invoke_alter ($modules, $hook)

Detailed Description

All drush commands are invoked in a specific order, using drush-made hooks, very similar to the Drupal hook system. See drush_invoke() for the actual implementation.

For any commandfile named "hook", the following hooks are called, in order, for the command "COMMAND":

0. drush_COMMAND_init()

  1. drush_hook_COMMAND_pre_validate()
  2. drush_hook_COMMAND_validate()
  3. drush_hook_pre_COMMAND()
  4. drush_hook_COMMAND()
  5. drush_hook_post_COMMAND()

For example, here are the hook opportunities for a mysite.drush.inc file that wants to hook into the pm-download command.

  1. drush_mysite_pm_download_pre_validate()
  2. drush_mysite_pm_download_validate()
  3. drush_mysite_pre_pm_download()
  4. drush_mysite_pm_download()
  5. drush_mysite_post_pm_download()

Note that the drush_COMMAND_init() hook is only for use by the commandfile that defines the command.

If any of hook function fails, either by calling drush_set_error or by returning FALSE as its function result, then the rollback mechanism is called. To fail with an error, call drush_set_error:

return drush_set_error('MY_ERROR_CODE', dt('Error message.'));

To allow the user to confirm or cancel a command, use drush_confirm and drush_user_abort:

if (!drush_confirm(dt('Are you sure?'))) { return drush_user_abort(); }

The rollback mechanism will call, in reverse, all _rollback hooks. The mysite command file can implement the following rollback hooks:

  1. drush_mysite_post_pm_download_rollback()
  2. drush_mysite_pm_download_rollback()
  3. drush_mysite_pre_pm_download_rollback()
  4. drush_mysite_pm_download_validate_rollback()
  5. drush_mysite_pm_download_pre_validate_rollback()

Before any command is called, hook_drush_init() is also called. hook_drush_exit() is called at the very end of command invocation.

See Also
includes/command.inc
hook_drush_init()
drush_COMMAND_init()
drush_hook_COMMAND_pre_validate()
drush_hook_COMMAND_validate()
drush_hook_pre_COMMAND()
drush_hook_COMMAND()
drush_hook_post_COMMAND()
drush_hook_post_COMMAND_rollback()
drush_hook_COMMAND_rollback()
drush_hook_pre_COMMAND_rollback()
drush_hook_COMMAND_validate_rollback()
drush_hook_COMMAND_pre_validate_rollback()
hook_drush_exit()

Function Documentation

drush_COMMAND_init ( )

Initialize a command prior to validation.

If a command needs to bootstrap to a higher level, this is best done in the command init hook. It is permisible to bootstrap in any hook, but note that if bootstrapping adds more commandfiles (*.drush.inc) to the commandfile list, the newly-added commandfiles will not have any hooks called until the next phase. For example, a command that calls drush_bootstrap_max() in drush_hook_COMMAND() would only permit commandfiles from modules enabled in the site to participate in drush_hook_post_COMMAND() hooks.

Definition at line 110 of file drush.api.php.

References drush_bootstrap_max().

Here is the call graph for this function:

drush_hook_COMMAND ( )

Implementation of the actual drush command.

This is where most of the stuff should happen.

Logging an error stops command execution, and the rollback function (if any) for each hook implementation is invoked, in addition to pre and validate rollbacks.

Returns
mixed|false The return value will be passed along to the caller if –backend option is present. A boolean FALSE indicates failure and rollback will be inititated.
See Also
drush_hook_COMMAND_rollback()
drush_hook_pre_COMMAND_rollback()
drush_hook_COMMAND_validate_rollback()

Definition at line 169 of file drush.api.php.

drush_hook_COMMAND_pre_validate ( )

Run before a specific command validates.

Logging an error stops command execution, and the rollback function (if any) for each hook implementation is invoked.

See Also
drush_hook_COMMAND_pre_validate_rollback()

Definition at line 122 of file drush.api.php.

drush_hook_COMMAND_validate ( )

Run before a specific command executes.

Logging an error stops command execution, and the rollback function (if any) for each hook implementation is invoked.

See Also
drush_hook_COMMAND_validate_rollback()

Definition at line 134 of file drush.api.php.

drush_hook_post_COMMAND ( )

Run after a specific command executes.

Logging an error stops command execution, and the rollback function (if any) for each hook implementation is invoked, in addition to pre, normal and validate rollbacks.

See Also
drush_hook_post_COMMAND_rollback()
drush_hook_COMMAND_rollback()
drush_hook_pre_COMMAND_rollback()
drush_hook_COMMAND_validate_rollback()

Definition at line 185 of file drush.api.php.

drush_hook_pre_COMMAND ( )

Run before a specific command executes.

Logging an error stops command execution, and the rollback function (if any) for each hook implementation is invoked, in addition to the validate rollback.

See Also
drush_hook_pre_COMMAND_rollback()
drush_hook_COMMAND_validate_rollback()

Definition at line 148 of file drush.api.php.

drush_hook_pre_pm_enable ( )

Automatically download project dependencies at pm-enable time.

Use a pre-pm_enable hook to download before your module is enabled, or a post-pm_enable hook (drush_hook_post_pm_enable) to run after your module is enabled.

Your hook will be called every time pm-enable is executed; you should only download dependencies when your module is being enabled. Respect the –skip flag, and take no action if it is present.

Definition at line 241 of file drush.api.php.

References drush_download_file(), drush_get_context(), drush_get_option(), drush_include_engine(), drush_module_exists(), and drush_tarball_extract().

Here is the call graph for this function:

hook_drush_cache_clear ( $types)

Add/edit options to cache-clear command.

Definition at line 292 of file drush.api.php.

hook_drush_command_alter ( $command)

Adjust the contents of any command structure prior to dispatch.

See Also
core_drush_command_alter()

Definition at line 201 of file drush.api.php.

hook_drush_engine_ENGINE_TYPE ( )

Inform drush about one or more engines implementing a given engine type.

  • description: The engine implementation's description.
  • engine-class: The class that contains the engine implementation. Defaults to the engine type key (e.g. 'ice-cream').
  • verbose-only: The engine implementation will only appear in help output in –verbose mode.

This hook allow to declare implementations for an engine type.

See Also
pm_drush_engine_package_handler()
pm_drush_engine_version_control()

Definition at line 363 of file drush.api.php.

hook_drush_engine_type_info ( )

Inform drush about one or more engine types.

This hook allow to declare available engine types, the cli option to select between engine implementatins, which one to use by default, global options and other parameters. Commands may override this info when declaring the engines they use.

Returns
array An array whose keys are engine type names and whose values describe the characteristics of the engine type in relation to command definitions:
  • description: The engine type description.
  • topic: If specified, the name of the topic command that will display the automatically generated topic for this engine.
  • topic-file: If specified, the path to the file that will be displayed at the head of the automatically generated topic for this engine. This path is relative to the Drush root directory; non-core commandfiles should therefore use: 'topic-file' => dirname(FILE) . '/mytopic.html';
  • topics: If set, contains a list of topics that should be added to the "Topics" section of any command that uses this engine. Note that if 'topic' is set, it will automatically be added to the topics list, and therefore does not need to also be listed here.
  • option: The command line option to choose an implementation for this engine type. FALSE means there's no option. That is, the engine type is for internal usage of the command and thus an implementation is not selectable.
  • default: The default implementation to use by the engine type.
  • options: Engine options common to all implementations.
  • add-options-to-command: If there's a single implementation for this engine type, add its options as command level options.
  • combine-help: If there are multiple implementations for this engine type, then instead of adding multiple help items in the form of –engine-option=engine-type [description], instead combine all help options into a single –engine-option that lists the different possible values that can be used.
See Also
drush_get_engine_types_info()
pm_drush_engine_type_info()

Definition at line 337 of file drush.api.php.

hook_drush_exit ( )

Take action after any command is run.

Definition at line 192 of file drush.api.php.

hook_drush_help_alter ( $command)

Add help components to a command.

Definition at line 276 of file drush.api.php.

hook_drush_init ( )

Take action before any command is run.

Logging an error stops command execution.

Definition at line 95 of file drush.api.php.

hook_drush_invoke_alter (   $modules,
  $hook 
)

Alter the order that hooks are invoked.

When implementing a given hook we may need to ensure it is invoked before or after another implementation of the same hook. For example, let's say you want to implement a hook that would be called after drush_make. You'd write a drush_MY_MODULE_post_make() function. But if you need your hook to be called before drush_make_post_make(), you can ensure this by implemen- ting MY_MODULE_drush_invoke_alter().

See Also
drush_command_invoke_all_ref()

Definition at line 386 of file drush.api.php.

hook_drush_pm_download_destination_alter ( $project,
  $release 
)

Adjust the location a project should be copied to after being downloaded.

See ().

Definition at line 224 of file drush.api.php.

hook_drush_pm_post_download (   $project,
  $release 
)

Take action after a project has been downloaded.

Definition at line 208 of file drush.api.php.

hook_drush_sql_sync_sanitize (   $source)

Sql-sync sanitization example.

This is equivalent to the built-in –sanitize option of sql-sync, but simplified to only work with default values on Drupal 6 + mysql.

See Also
sql_drush_sql_sync_sanitize()

Definition at line 267 of file drush.api.php.

References drush_sql_register_post_sync_op(), and dt().

Here is the call graph for this function:

hook_pm_post_update (   $release_name,
  $release_candidate_version,
  $project_parent_path 
)

Take action after a project has been updated.

Definition at line 215 of file drush.api.php.

File

doxygen/html/group__hooks.html
View source
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>Drush: Hooks</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">Drush
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.1.2 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
</div><!-- top -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Groups</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Pages</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">Hooks</div>  </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga7c152a4ea745c2ab4cc02550a508cd02"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hooks.html#ga7c152a4ea745c2ab4cc02550a508cd02">hook_drush_init</a> ()</td></tr>
<tr class="memitem:ga84e8d0c2085eaf4dd3b0fdc0084a1fcf"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hooks.html#ga84e8d0c2085eaf4dd3b0fdc0084a1fcf">drush_COMMAND_init</a> ()</td></tr>
<tr class="memitem:ga60d708b12c109a6ea04e91e264362264"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hooks.html#ga60d708b12c109a6ea04e91e264362264">drush_hook_COMMAND_pre_validate</a> ()</td></tr>
<tr class="memitem:gac061d664b056b69fdf8df08fa7d3a455"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hooks.html#gac061d664b056b69fdf8df08fa7d3a455">drush_hook_COMMAND_validate</a> ()</td></tr>
<tr class="memitem:ga4467ad5336f96af65c0fe3ec14f934f7"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hooks.html#ga4467ad5336f96af65c0fe3ec14f934f7">drush_hook_pre_COMMAND</a> ()</td></tr>
<tr class="memitem:gac2e216160a865f14ffe9ed086249d458"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hooks.html#gac2e216160a865f14ffe9ed086249d458">drush_hook_COMMAND</a> ()</td></tr>
<tr class="memitem:ga627b05c2176e14cf9eb379c8fc20037f"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hooks.html#ga627b05c2176e14cf9eb379c8fc20037f">drush_hook_post_COMMAND</a> ()</td></tr>
<tr class="memitem:gaceff65b92d3f8e8cd206b1675bd20673"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hooks.html#gaceff65b92d3f8e8cd206b1675bd20673">hook_drush_exit</a> ()</td></tr>
<tr class="memitem:gad9295dc1095f08208915040505992edd"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hooks.html#gad9295dc1095f08208915040505992edd">hook_drush_command_alter</a> (&amp;$command)</td></tr>
<tr class="memitem:ga5142b9fb7c6d1fbf4ae73a18b60bf6b8"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hooks.html#ga5142b9fb7c6d1fbf4ae73a18b60bf6b8">hook_drush_pm_post_download</a> ($project, $release)</td></tr>
<tr class="memitem:ga2dd2e76bb7ed0c24fc312288ee5c31e4"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hooks.html#ga2dd2e76bb7ed0c24fc312288ee5c31e4">hook_pm_post_update</a> ($release_name, $release_candidate_version, $project_parent_path)</td></tr>
<tr class="memitem:ga2db1b61c4e34fd8b98620606f86e7b6f"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hooks.html#ga2db1b61c4e34fd8b98620606f86e7b6f">hook_drush_pm_download_destination_alter</a> (&amp;$project, $release)</td></tr>
<tr class="memitem:ga9e33c8f44999a71f94353d78673294c0"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hooks.html#ga9e33c8f44999a71f94353d78673294c0">drush_hook_pre_pm_enable</a> ()</td></tr>
<tr class="memitem:gab01f27f1d336baa4dad089307e79f575"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hooks.html#gab01f27f1d336baa4dad089307e79f575">hook_drush_sql_sync_sanitize</a> ($source)</td></tr>
<tr class="memitem:ga013c29fff5780421e512662dffb3ee6c"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hooks.html#ga013c29fff5780421e512662dffb3ee6c">hook_drush_help_alter</a> (&amp;$command)</td></tr>
<tr class="memitem:ga1f2449502de63544a06e028613e19f63"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hooks.html#ga1f2449502de63544a06e028613e19f63">hook_drush_cache_clear</a> (&amp;$types)</td></tr>
<tr class="memitem:ga6512325eecb656befe244aad3e709bb1"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hooks.html#ga6512325eecb656befe244aad3e709bb1">hook_drush_engine_type_info</a> ()</td></tr>
<tr class="memitem:gaf439b7c46ebd6bec9b332288ccb6355d"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hooks.html#gaf439b7c46ebd6bec9b332288ccb6355d">hook_drush_engine_ENGINE_TYPE</a> ()</td></tr>
<tr class="memitem:ga6ab61c22d8fbe61467dadf43cdd352b7"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__hooks.html#ga6ab61c22d8fbe61467dadf43cdd352b7">hook_drush_invoke_alter</a> ($modules, $hook)</td></tr>
</table>
<a name="details" id="details"></a><h2>Detailed Description</h2>
<p>All drush commands are invoked in a specific order, using drush-made hooks, very similar to the Drupal hook system. See <a class="el" href="group__dispatching.html#gad45b0ad6ccdc34ebb10d38d5c2d6a1d1">drush_invoke()</a> for the actual implementation.</p>
<p>For any commandfile named "hook", the following hooks are called, in order, for the command "COMMAND":</p>
<p>0. <a class="el" href="group__hooks.html#ga84e8d0c2085eaf4dd3b0fdc0084a1fcf">drush_COMMAND_init()</a></p>
<ol type="1">
<li><a class="el" href="group__hooks.html#ga60d708b12c109a6ea04e91e264362264">drush_hook_COMMAND_pre_validate()</a></li>
<li><a class="el" href="group__hooks.html#gac061d664b056b69fdf8df08fa7d3a455">drush_hook_COMMAND_validate()</a></li>
<li><a class="el" href="group__hooks.html#ga4467ad5336f96af65c0fe3ec14f934f7">drush_hook_pre_COMMAND()</a></li>
<li><a class="el" href="group__hooks.html#gac2e216160a865f14ffe9ed086249d458">drush_hook_COMMAND()</a></li>
<li><a class="el" href="group__hooks.html#ga627b05c2176e14cf9eb379c8fc20037f">drush_hook_post_COMMAND()</a></li>
</ol>
<p>For example, here are the hook opportunities for a mysite.drush.inc file that wants to hook into the <code>pm-download</code> command.</p>
<ol type="1">
<li>drush_mysite_pm_download_pre_validate()</li>
<li>drush_mysite_pm_download_validate()</li>
<li>drush_mysite_pre_pm_download()</li>
<li>drush_mysite_pm_download()</li>
<li>drush_mysite_post_pm_download()</li>
</ol>
<p>Note that the <a class="el" href="group__hooks.html#ga84e8d0c2085eaf4dd3b0fdc0084a1fcf">drush_COMMAND_init()</a> hook is only for use by the commandfile that defines the command.</p>
<p>If any of hook function fails, either by calling drush_set_error or by returning FALSE as its function result, then the rollback mechanism is called. To fail with an error, call drush_set_error:</p>
<p>return drush_set_error('MY_ERROR_CODE', dt('Error message.'));</p>
<p>To allow the user to confirm or cancel a command, use drush_confirm and drush_user_abort:</p>
<p>if (!drush_confirm(dt('Are you sure?'))) { return <a class="el" href="group__errorhandling.html#ga366aaafdf8c774a58653c64a65b6d91c">drush_user_abort()</a>; }</p>
<p>The rollback mechanism will call, in reverse, all _rollback hooks. The mysite command file can implement the following rollback hooks:</p>
<ol type="1">
<li>drush_mysite_post_pm_download_rollback()</li>
<li>drush_mysite_pm_download_rollback()</li>
<li>drush_mysite_pre_pm_download_rollback()</li>
<li>drush_mysite_pm_download_validate_rollback()</li>
<li>drush_mysite_pm_download_pre_validate_rollback()</li>
</ol>
<p>Before any command is called, <a class="el" href="group__hooks.html#ga7c152a4ea745c2ab4cc02550a508cd02">hook_drush_init()</a> is also called. <a class="el" href="group__hooks.html#gaceff65b92d3f8e8cd206b1675bd20673">hook_drush_exit()</a> is called at the very end of command invocation.</p>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="includes_2command_8inc.html">includes/command.inc</a></dd>
<dd>
<a class="el" href="group__hooks.html#ga7c152a4ea745c2ab4cc02550a508cd02">hook_drush_init()</a> </dd>
<dd>
<a class="el" href="group__hooks.html#ga84e8d0c2085eaf4dd3b0fdc0084a1fcf">drush_COMMAND_init()</a> </dd>
<dd>
<a class="el" href="group__hooks.html#ga60d708b12c109a6ea04e91e264362264">drush_hook_COMMAND_pre_validate()</a> </dd>
<dd>
<a class="el" href="group__hooks.html#gac061d664b056b69fdf8df08fa7d3a455">drush_hook_COMMAND_validate()</a> </dd>
<dd>
<a class="el" href="group__hooks.html#ga4467ad5336f96af65c0fe3ec14f934f7">drush_hook_pre_COMMAND()</a> </dd>
<dd>
<a class="el" href="group__hooks.html#gac2e216160a865f14ffe9ed086249d458">drush_hook_COMMAND()</a> </dd>
<dd>
<a class="el" href="group__hooks.html#ga627b05c2176e14cf9eb379c8fc20037f">drush_hook_post_COMMAND()</a> </dd>
<dd>
drush_hook_post_COMMAND_rollback() </dd>
<dd>
drush_hook_COMMAND_rollback() </dd>
<dd>
drush_hook_pre_COMMAND_rollback() </dd>
<dd>
drush_hook_COMMAND_validate_rollback() </dd>
<dd>
drush_hook_COMMAND_pre_validate_rollback() </dd>
<dd>
<a class="el" href="group__hooks.html#gaceff65b92d3f8e8cd206b1675bd20673">hook_drush_exit()</a> </dd></dl>
<h2>Function Documentation</h2>
<a class="anchor" id="ga84e8d0c2085eaf4dd3b0fdc0084a1fcf"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">drush_COMMAND_init </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Initialize a command prior to validation.</p>
<p>If a command needs to bootstrap to a higher level, this is best done in the command init hook. It is permisible to bootstrap in any hook, but note that if bootstrapping adds more commandfiles (*.<a class="el" href="drush_8inc.html">drush.inc</a>) to the commandfile list, the newly-added commandfiles will not have any hooks called until the next phase. For example, a command that calls <a class="el" href="lib_2Drush_2Boot_2bootstrap_8inc.html#adb325e52092d83c685acdee827af1085">drush_bootstrap_max()</a> in <a class="el" href="group__hooks.html#gac2e216160a865f14ffe9ed086249d458">drush_hook_COMMAND()</a> would only permit commandfiles from modules enabled in the site to participate in <a class="el" href="group__hooks.html#ga627b05c2176e14cf9eb379c8fc20037f">drush_hook_post_COMMAND()</a> hooks. </p>

<p>Definition at line <a class="el" href="drush_8api_8php_source.html#l00110">110</a> of file <a class="el" href="drush_8api_8php_source.html">drush.api.php</a>.</p>

<p>References <a class="el" href="lib_2Drush_2Boot_2bootstrap_8inc_source.html#l00326">drush_bootstrap_max()</a>.</p>

<p><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="group__hooks_ga84e8d0c2085eaf4dd3b0fdc0084a1fcf_cgraph.png" border="0" usemap="#group__hooks_ga84e8d0c2085eaf4dd3b0fdc0084a1fcf_cgraph" alt=""/></div>
<map name="group__hooks_ga84e8d0c2085eaf4dd3b0fdc0084a1fcf_cgraph" id="group__hooks_ga84e8d0c2085eaf4dd3b0fdc0084a1fcf_cgraph">
<area shape="rect" id="node3" href="lib_2Drush_2Boot_2bootstrap_8inc.html#adb325e52092d83c685acdee827af1085" title="drush_bootstrap_max" alt="" coords="211,68,357,97"/><area shape="rect" id="node5" href="lib_2Drush_2Boot_2bootstrap_8inc.html#ab982885828936c22ba99ab9a7b2981ff" title="_drush_bootstrap_phases" alt="" coords="787,93,957,123"/><area shape="rect" id="node7" href="lib_2Drush_2Boot_2bootstrap_8inc.html#a504cc0d2dfbfa276957c1e02c8f8c900" title="drush_bootstrap" alt="" coords="405,272,520,301"/><area shape="rect" id="node10" href="lib_2Drush_2Boot_2bootstrap_8inc.html#a7b119d89395f0ef01bd2392afa4b59af" title="drush_bootstrap_validate" alt="" coords="569,93,735,123"/><area shape="rect" id="node15" href="context_8inc.html#ad25559f8d7d753f636fbeac347c29fc5" title="drush_get_context" alt="" coords="1951,375,2079,404"/><area shape="rect" id="node13" href="context_8inc.html#af983acfe90e7d7bbdbd67c57f93708ba" title="drush_set_context" alt="" coords="808,193,936,223"/><area shape="rect" id="node17" href="includes_2command_8inc.html#af0c377881e5c9c772f0cad80ea016452" title="drush_get_commands" alt="" coords="577,605,727,635"/><area shape="rect" id="node25" href="group__outputfunctions.html#ga1218abcb1e27dd3bb412113d1e344d96" title="dt" alt="" coords="1317,768,1355,797"/><area shape="rect" id="node51" href="group__errorhandling.html#ga23fe9e1e8c1e5ade39256106044b6da4" title="drush_set_error" alt="" coords="1280,401,1392,431"/><area shape="rect" id="node58" href="group__logging.html#gad820f489a93518301794ada4ff7816b6" title="drush_log" alt="" coords="1533,349,1611,379"/><area shape="rect" id="node65" href="group__errorhandling.html#ga33fe8456b3dc49a0e28e7f63692a0d44" title="drush_get_error" alt="" coords="1735,245,1847,275"/><area shape="rect" id="node19" href="includes_2command_8inc.html#a2ce77284c0002dda3a5d0527e583e017" title="drush_command_hook" alt="" coords="1260,455,1412,484"/><area shape="rect" id="node21" href="includes_2command_8inc.html#aa89380abcf2e406ea2d6fe05d529f2b1" title="drush_command_translate" alt="" coords="785,811,959,840"/><area shape="rect" id="node34" href="includes_2command_8inc.html#ad51d79509a4a134947703f3e58564444" title="drush_commandfile_list" alt="" coords="1257,709,1415,739"/><area shape="rect" id="node37" href="engines_8inc.html#a04ee0e7019029ef27bc4e8f14341b2b4" title="drush_merge_engine_data" alt="" coords="785,605,959,635"/><area shape="rect" id="node23" href="includes_2command_8inc.html#a643622feb3301c9b33e295e7f2bd7804" title="_drush_command_translate" alt="" coords="1009,811,1191,840"/><area shape="rect" id="node27" href="includes_2drupal_8inc.html#ad2ccab77d4bc8e7355186f26cd328ac0" title="drush_drupal_major\l_version" alt="" coords="1505,759,1639,806"/><area shape="rect" id="node29" href="includes_2drupal_8inc.html#a203e989fd043d054d774954e2b2dff21" title="drush_drupal_version" alt="" coords="1719,764,1863,793"/><area shape="rect" id="node31" href="includes_2drupal_8inc.html#aa7ac001ed15d678fa533b54d962eb5bc" title="drush_drupal_load_autoloader" alt="" coords="1917,764,2112,793"/><area shape="rect" id="node39" href="engines_8inc.html#ac18b04b38c84979a32603cd5cef78c69" title="drush_find_engine_to_use" alt="" coords="1013,605,1187,635"/><area shape="rect" id="node42" href="engines_8inc.html#a50374de188af3d1cb754476607b9c375" title="drush_get_engine_types_info" alt="" coords="1241,508,1431,537"/><area shape="rect" id="node46" href="engines_8inc.html#ae94a82d80d5e90cb126de1f16a7f8fe4" title="drush_get_engines" alt="" coords="1035,552,1165,581"/><area shape="rect" id="node44" href="includes_2command_8inc.html#a19eba9666aba673a64fbd78a2c5ef4f9" title="drush_command_invoke_all" alt="" coords="1481,505,1663,535"/><area shape="rect" id="node53" href="backend_8inc.html#a38490210d77373f3d8492caf4e9a3190" title="drush_backend_packet" alt="" coords="1713,400,1868,429"/></map>
</div>
</p>

</div>
</div>
<a class="anchor" id="gac2e216160a865f14ffe9ed086249d458"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">drush_hook_COMMAND </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Implementation of the actual drush command.</p>
<p>This is where most of the stuff should happen.</p>
<p>Logging an error stops command execution, and the rollback function (if any) for each hook implementation is invoked, in addition to pre and validate rollbacks.</p>
<dl class="section return"><dt>Returns</dt><dd>mixed|false The return value will be passed along to the caller if &ndash;backend option is present. A boolean FALSE indicates failure and rollback will be inititated.</dd></dl>
<dl class="section see"><dt>See Also</dt><dd>drush_hook_COMMAND_rollback() </dd>
<dd>
drush_hook_pre_COMMAND_rollback() </dd>
<dd>
drush_hook_COMMAND_validate_rollback() </dd></dl>

<p>Definition at line <a class="el" href="drush_8api_8php_source.html#l00169">169</a> of file <a class="el" href="drush_8api_8php_source.html">drush.api.php</a>.</p>

</div>
</div>
<a class="anchor" id="ga60d708b12c109a6ea04e91e264362264"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">drush_hook_COMMAND_pre_validate </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Run before a specific command validates.</p>
<p>Logging an error stops command execution, and the rollback function (if any) for each hook implementation is invoked.</p>
<dl class="section see"><dt>See Also</dt><dd>drush_hook_COMMAND_pre_validate_rollback() </dd></dl>

<p>Definition at line <a class="el" href="drush_8api_8php_source.html#l00122">122</a> of file <a class="el" href="drush_8api_8php_source.html">drush.api.php</a>.</p>

</div>
</div>
<a class="anchor" id="gac061d664b056b69fdf8df08fa7d3a455"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">drush_hook_COMMAND_validate </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Run before a specific command executes.</p>
<p>Logging an error stops command execution, and the rollback function (if any) for each hook implementation is invoked.</p>
<dl class="section see"><dt>See Also</dt><dd>drush_hook_COMMAND_validate_rollback() </dd></dl>

<p>Definition at line <a class="el" href="drush_8api_8php_source.html#l00134">134</a> of file <a class="el" href="drush_8api_8php_source.html">drush.api.php</a>.</p>

</div>
</div>
<a class="anchor" id="ga627b05c2176e14cf9eb379c8fc20037f"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">drush_hook_post_COMMAND </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Run after a specific command executes.</p>
<p>Logging an error stops command execution, and the rollback function (if any) for each hook implementation is invoked, in addition to pre, normal and validate rollbacks.</p>
<dl class="section see"><dt>See Also</dt><dd>drush_hook_post_COMMAND_rollback() </dd>
<dd>
drush_hook_COMMAND_rollback() </dd>
<dd>
drush_hook_pre_COMMAND_rollback() </dd>
<dd>
drush_hook_COMMAND_validate_rollback() </dd></dl>

<p>Definition at line <a class="el" href="drush_8api_8php_source.html#l00185">185</a> of file <a class="el" href="drush_8api_8php_source.html">drush.api.php</a>.</p>

</div>
</div>
<a class="anchor" id="ga4467ad5336f96af65c0fe3ec14f934f7"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">drush_hook_pre_COMMAND </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Run before a specific command executes.</p>
<p>Logging an error stops command execution, and the rollback function (if any) for each hook implementation is invoked, in addition to the validate rollback.</p>
<dl class="section see"><dt>See Also</dt><dd>drush_hook_pre_COMMAND_rollback() </dd>
<dd>
drush_hook_COMMAND_validate_rollback() </dd></dl>

<p>Definition at line <a class="el" href="drush_8api_8php_source.html#l00148">148</a> of file <a class="el" href="drush_8api_8php_source.html">drush.api.php</a>.</p>

</div>
</div>
<a class="anchor" id="ga9e33c8f44999a71f94353d78673294c0"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">drush_hook_pre_pm_enable </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Automatically download project dependencies at pm-enable time.</p>
<p>Use a pre-pm_enable hook to download before your module is enabled, or a post-pm_enable hook (drush_hook_post_pm_enable) to run after your module is enabled.</p>
<p>Your hook will be called every time pm-enable is executed; you should only download dependencies when your module is being enabled. Respect the &ndash;skip flag, and take no action if it is present. </p>

<p>Definition at line <a class="el" href="drush_8api_8php_source.html#l00241">241</a> of file <a class="el" href="drush_8api_8php_source.html">drush.api.php</a>.</p>

<p>References <a class="el" href="drush_8inc_source.html#l00721">drush_download_file()</a>, <a class="el" href="context_8inc_source.html#l00328">drush_get_context()</a>, <a class="el" href="context_8inc_source.html#l00405">drush_get_option()</a>, <a class="el" href="engines_8inc_source.html#l00479">drush_include_engine()</a>, <a class="el" href="commands_2core_2drupal_2environment_8inc_source.html#l00136">drush_module_exists()</a>, and <a class="el" href="drush_8inc_source.html#l00958">drush_tarball_extract()</a>.</p>

<p><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="group__hooks_ga9e33c8f44999a71f94353d78673294c0_cgraph.png" border="0" usemap="#group__hooks_ga9e33c8f44999a71f94353d78673294c0_cgraph" alt=""/></div>
<map name="group__hooks_ga9e33c8f44999a71f94353d78673294c0_cgraph" id="group__hooks_ga9e33c8f44999a71f94353d78673294c0_cgraph">
<area shape="rect" id="node3" href="drush_8inc.html#a9cce12bffedae74c4a45174c59c79311" title="drush_download_file" alt="" coords="241,408,380,437"/><area shape="rect" id="node17" href="context_8inc.html#ad25559f8d7d753f636fbeac347c29fc5" title="drush_get_context" alt="" coords="2028,905,2156,935"/><area shape="rect" id="node57" href="context_8inc.html#afe91fb3e5219ecb2208c3b036b1f0cb8" title="drush_get_option" alt="" coords="1383,93,1503,123"/><area shape="rect" id="node103" href="engines_8inc.html#a91df31f18b0a1d05540ccaf85e6d9a88" title="drush_include_engine" alt="" coords="892,1496,1039,1525"/><area shape="rect" id="node122" href="commands_2core_2drupal_2environment_8inc.html#a643d851fd8dc63ea2ce8cf67aa33098c" title="drush_module_exists" alt="" coords="239,512,383,541"/><area shape="rect" id="node124" href="drush_8inc.html#ad8f8c8d5b65e0d9a863173da63ef78ee" title="drush_tarball_extract" alt="" coords="451,909,592,939"/><area shape="rect" id="node5" href="drush_8inc.html#a5c2a88712f3905874900166f3b2c397c" title="_drush_download_file" alt="" coords="448,408,595,437"/><area shape="rect" id="node13" href="group__logging.html#gad820f489a93518301794ada4ff7816b6" title="drush_log" alt="" coords="1640,880,1717,909"/><area shape="rect" id="node26" href="group__outputfunctions.html#ga1218abcb1e27dd3bb412113d1e344d96" title="dt" alt="" coords="1424,1247,1461,1276"/><area shape="rect" id="node76" href="group__filesystemfunctions.html#ga7557e035207db8d2dbe475e6a52c579c" title="drush_register_file\l_for_deletion" alt="" coords="1135,405,1263,451"/><area shape="rect" id="node81" href="drush_8inc.html#a5d3c123a1d8fa15642f08ff635dbe2a1" title="_drush_is_url" alt="" coords="472,461,571,491"/><area shape="rect" id="node83" href="drush_8inc.html#a6b7589c9e3cd3f683c0ef137e1c30f49" title="drush_download_file_name" alt="" coords="432,621,611,651"/><area shape="rect" id="node7" href="group__filesystemfunctions.html#ga0d795889ef507c45abb793b8685b36d0" title="drush_file_not_empty" alt="" coords="672,408,819,437"/><area shape="rect" id="node9" href="group__filesystemfunctions.html#gaac7379e8cfa2163a874542fc021bf521" title="drush_move_dir" alt="" coords="688,1136,803,1165"/><area shape="rect" id="node44" href="group__commandwrappers.html#gafd358ceac1286dbdd141ff2b8eb7d556" title="drush_shell_exec" alt="" coords="684,355,807,384"/><area shape="rect" id="node64" href="group__filesystemfunctions.html#ga01729c5c432a2f30974966d888146d09" title="drush_tempnam" alt="" coords="688,515,803,544"/><area shape="rect" id="node11" href="group__filesystemfunctions.html#ga1d86ac8e2e56a75acb0abcdc8e0dcf09" title="drush_copy_dir" alt="" coords="911,1087,1020,1116"/><area shape="rect" id="node20" href="drush_8inc.html#a903c36790dbe5525fe9369c8476780af" title="drush_op" alt="" coords="1161,1189,1236,1219"/><area shape="rect" id="node33" href="group__errorhandling.html#ga23fe9e1e8c1e5ade39256106044b6da4" title="drush_set_error" alt="" coords="1387,983,1499,1012"/><area shape="rect" id="node15" href="backend_8inc.html#a38490210d77373f3d8492caf4e9a3190" title="drush_backend_packet" alt="" coords="1821,931,1976,960"/><area shape="rect" id="node22" href="drush_8inc.html#a2dd83647cc42a2dfcde54dc38f54827d" title="drush_call_user_func\l_array" alt="" coords="1371,1177,1515,1223"/><area shape="rect" id="node28" href="includes_2drupal_8inc.html#ad2ccab77d4bc8e7355186f26cd328ac0" title="drush_drupal_major\l_version" alt="" coords="1612,1238,1745,1285"/><area shape="rect" id="node30" href="includes_2drupal_8inc.html#a203e989fd043d054d774954e2b2dff21" title="drush_drupal_version" alt="" coords="1827,1209,1971,1239"/><area shape="rect" id="node36" href="includes_2command_8inc.html#a19eba9666aba673a64fbd78a2c5ef4f9" title="drush_command_invoke_all" alt="" coords="1588,1179,1769,1208"/><area shape="rect" id="node46" href="group__commandwrappers.html#ga0eed47c4d6d19d386936ad57f34b10b2" title="_drush_shell_exec" alt="" coords="900,251,1031,280"/><area shape="rect" id="node48" href="group__commandwrappers.html#gac21dc9409bff5197d255978c3cf6e761" title="_drush_shell_exec_output_set" alt="" coords="1100,352,1297,381"/><area shape="rect" id="node50" href="group__commandwrappers.html#gafc52f7e769d935b4d2462467cdf8d5ee" title="drush_escapeshellarg" alt="" coords="1125,299,1272,328"/><area shape="rect" id="node55" href="group__outputfunctions.html#ga63acbb94925d6d2693e235e966bba740" title="drush_print" alt="" coords="1156,144,1241,173"/><area shape="rect" id="node52" href="includes_2environment_8inc.html#a88114295372bcb0ca8dbb5f10b36368e" title="drush_is_windows" alt="" coords="1379,499,1507,528"/><area shape="rect" id="node59" href="context_8inc.html#aee5781894bf828bfa508d9052553f809" title="_drush_get_option" alt="" coords="1615,55,1743,84"/><area shape="rect" id="node61" href="context_8inc.html#a9f6272c1a68141ce873c07aae3a316ac" title="drush_context_names" alt="" coords="1604,108,1753,137"/><area shape="rect" id="node66" href="group__filesystemfunctions.html#gad1036a8fb12d105b55de87b4f3fe8002" title="drush_find_tmp" alt="" coords="911,569,1020,599"/><area shape="rect" id="node68" href="includes_2environment_8inc.html#a339c57f584d4f3d910d8c36763d054c2" title="drush_cwd" alt="" coords="1856,725,1941,755"/><area shape="rect" id="node72" href="group__filesystemfunctions.html#ga6027285d97028ad3299d3aa262be8c2f" title="drush_mkdir" alt="" coords="1152,1035,1245,1064"/><area shape="rect" id="node85" href="includes_2environment_8inc.html#a92afdf9afda25ac6d226ba45f6f1fbe0" title="drush_directory_cache" alt="" coords="669,703,821,732"/><area shape="rect" id="node87" href="group__errorhandling.html#ga7bc0a52d28467940b2bb9588a660ed8f" title="drush_clear_error" alt="" coords="904,623,1027,652"/><area shape="rect" id="node90" href="includes_2environment_8inc.html#a25a1b7c8414b818e263d31ff06363772" title="drush_get_username" alt="" coords="895,676,1036,705"/><area shape="rect" id="node93" href="includes_2environment_8inc.html#afae6d4a5a12623e5502ca262346c799b" title="drush_server_home" alt="" coords="897,729,1033,759"/><area shape="rect" id="node105" href="engines_8inc.html#ae94a82d80d5e90cb126de1f16a7f8fe4" title="drush_get_engines" alt="" coords="1133,1597,1264,1627"/><area shape="rect" id="node117" href="drush_8inc.html#a80ce43b30f833522f72180811dab5a3e" title="drush_include" alt="" coords="1392,1367,1493,1396"/><area shape="rect" id="node107" href="includes_2command_8inc.html#a2ce77284c0002dda3a5d0527e583e017" title="drush_command_hook" alt="" coords="1367,1492,1519,1521"/><area shape="rect" id="node109" href="includes_2command_8inc.html#ad51d79509a4a134947703f3e58564444" title="drush_commandfile_list" alt="" coords="1820,1455,1977,1484"/><area shape="rect" id="node112" href="engines_8inc.html#a50374de188af3d1cb754476607b9c375" title="drush_get_engine_types_info" alt="" coords="1348,1545,1537,1575"/><area shape="rect" id="node127" href="drush_8inc.html#a78aae9f3ebfdb2bee27dee73fe088652" title="drush_file_is_tarball" alt="" coords="677,935,813,964"/><area shape="rect" id="node134" href="includes_2environment_8inc.html#a68b121976df4c48d67d77c020e45814f" title="drush_get_tar_executable" alt="" coords="880,465,1051,495"/><area shape="rect" id="node141" href="group__commandwrappers.html#ga59e8ee9f53442f2029080ac723ed008f" title="drush_shell_cd_and_exec" alt="" coords="660,1189,831,1219"/><area shape="rect" id="node144" href="group__commandwrappers.html#gadba8c59ba260dd39f615bc22ca78e1af" title="drush_shell_exec_output" alt="" coords="663,461,828,491"/><area shape="rect" id="node129" href="drush_8inc.html#a4ff511402c9ffe30239b8bdbee33a3dc" title="drush_mime_content_type" alt="" coords="1112,880,1285,909"/></map>
</div>
</p>

</div>
</div>
<a class="anchor" id="ga1f2449502de63544a06e028613e19f63"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">hook_drush_cache_clear </td>
          <td>(</td>
          <td class="paramtype">&amp;&#160;</td>
          <td class="paramname"><em>$types</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Add/edit options to cache-clear command. </p>

<p>Definition at line <a class="el" href="drush_8api_8php_source.html#l00292">292</a> of file <a class="el" href="drush_8api_8php_source.html">drush.api.php</a>.</p>

</div>
</div>
<a class="anchor" id="gad9295dc1095f08208915040505992edd"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">hook_drush_command_alter </td>
          <td>(</td>
          <td class="paramtype">&amp;&#160;</td>
          <td class="paramname"><em>$command</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Adjust the contents of any command structure prior to dispatch.</p>
<dl class="section see"><dt>See Also</dt><dd>core_drush_command_alter() </dd></dl>

<p>Definition at line <a class="el" href="drush_8api_8php_source.html#l00201">201</a> of file <a class="el" href="drush_8api_8php_source.html">drush.api.php</a>.</p>

</div>
</div>
<a class="anchor" id="gaf439b7c46ebd6bec9b332288ccb6355d"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">hook_drush_engine_ENGINE_TYPE </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Inform drush about one or more engines implementing a given engine type.</p>
<ul>
<li>description: The engine implementation's description.</li>
<li>engine-class: The class that contains the engine implementation. Defaults to the engine type key (e.g. 'ice-cream').</li>
<li>verbose-only: The engine implementation will only appear in help output in &ndash;verbose mode.</li>
</ul>
<p>This hook allow to declare implementations for an engine type.</p>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="group__engines.html#ga23826e01e6591dfb655c684cf9c82ed1">pm_drush_engine_package_handler()</a> </dd>
<dd>
<a class="el" href="group__engines.html#ga4c4be5afaca4f87930e3bb66a6dda7cc">pm_drush_engine_version_control()</a> </dd></dl>

<p>Definition at line <a class="el" href="drush_8api_8php_source.html#l00363">363</a> of file <a class="el" href="drush_8api_8php_source.html">drush.api.php</a>.</p>

</div>
</div>
<a class="anchor" id="ga6512325eecb656befe244aad3e709bb1"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">hook_drush_engine_type_info </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Inform drush about one or more engine types.</p>
<p>This hook allow to declare available engine types, the cli option to select between engine implementatins, which one to use by default, global options and other parameters. Commands may override this info when declaring the engines they use.</p>
<dl class="section return"><dt>Returns</dt><dd>array An array whose keys are engine type names and whose values describe the characteristics of the engine type in relation to command definitions:</dd></dl>
<ul>
<li>description: The engine type description.</li>
<li>topic: If specified, the name of the topic command that will display the automatically generated topic for this engine.</li>
<li>topic-file: If specified, the path to the file that will be displayed at the head of the automatically generated topic for this engine. This path is relative to the Drush root directory; non-core commandfiles should therefore use: 'topic-file' =&gt; dirname(<b>FILE</b>) . '/mytopic.html';</li>
<li>topics: If set, contains a list of topics that should be added to the "Topics" section of any command that uses this engine. Note that if 'topic' is set, it will automatically be added to the topics list, and therefore does not need to also be listed here.</li>
<li>option: The command line option to choose an implementation for this engine type. FALSE means there's no option. That is, the engine type is for internal usage of the command and thus an implementation is not selectable.</li>
<li>default: The default implementation to use by the engine type.</li>
<li>options: Engine options common to all implementations.</li>
<li>add-options-to-command: If there's a single implementation for this engine type, add its options as command level options.</li>
<li>combine-help: If there are multiple implementations for this engine type, then instead of adding multiple help items in the form of &ndash;engine-option=engine-type [description], instead combine all help options into a single &ndash;engine-option that lists the different possible values that can be used.</li>
</ul>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="engines_8inc.html#a50374de188af3d1cb754476607b9c375">drush_get_engine_types_info()</a> </dd>
<dd>
<a class="el" href="group__engines.html#gac3ac3fde1aa909a1155a17e3a9cf5cb7">pm_drush_engine_type_info()</a> </dd></dl>

<p>Definition at line <a class="el" href="drush_8api_8php_source.html#l00337">337</a> of file <a class="el" href="drush_8api_8php_source.html">drush.api.php</a>.</p>

</div>
</div>
<a class="anchor" id="gaceff65b92d3f8e8cd206b1675bd20673"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">hook_drush_exit </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Take action after any command is run. </p>

<p>Definition at line <a class="el" href="drush_8api_8php_source.html#l00192">192</a> of file <a class="el" href="drush_8api_8php_source.html">drush.api.php</a>.</p>

</div>
</div>
<a class="anchor" id="ga013c29fff5780421e512662dffb3ee6c"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">hook_drush_help_alter </td>
          <td>(</td>
          <td class="paramtype">&amp;&#160;</td>
          <td class="paramname"><em>$command</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Add help components to a command. </p>

<p>Definition at line <a class="el" href="drush_8api_8php_source.html#l00276">276</a> of file <a class="el" href="drush_8api_8php_source.html">drush.api.php</a>.</p>

</div>
</div>
<a class="anchor" id="ga7c152a4ea745c2ab4cc02550a508cd02"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">hook_drush_init </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Take action before any command is run.</p>
<p>Logging an error stops command execution. </p>

<p>Definition at line <a class="el" href="drush_8api_8php_source.html#l00095">95</a> of file <a class="el" href="drush_8api_8php_source.html">drush.api.php</a>.</p>

</div>
</div>
<a class="anchor" id="ga6ab61c22d8fbe61467dadf43cdd352b7"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">hook_drush_invoke_alter </td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$modules</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$hook</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Alter the order that hooks are invoked.</p>
<p>When implementing a given hook we may need to ensure it is invoked before or after another implementation of the same hook. For example, let's say you want to implement a hook that would be called after drush_make. You'd write a drush_MY_MODULE_post_make() function. But if you need your hook to be called before <a class="el" href="make_8drush_8inc.html#adb3866751fd19344b00c069793f46322">drush_make_post_make()</a>, you can ensure this by implemen- ting MY_MODULE_drush_invoke_alter().</p>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="includes_2command_8inc.html#a74995cc76034e90a39baee51111b20be">drush_command_invoke_all_ref()</a> </dd></dl>

<p>Definition at line <a class="el" href="drush_8api_8php_source.html#l00386">386</a> of file <a class="el" href="drush_8api_8php_source.html">drush.api.php</a>.</p>

</div>
</div>
<a class="anchor" id="ga2db1b61c4e34fd8b98620606f86e7b6f"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">hook_drush_pm_download_destination_alter </td>
          <td>(</td>
          <td class="paramtype">&amp;&#160;</td>
          <td class="paramname"><em>$project</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$release</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Adjust the location a project should be copied to after being downloaded.</p>
<p>See (). </p>

<p>Definition at line <a class="el" href="drush_8api_8php_source.html#l00224">224</a> of file <a class="el" href="drush_8api_8php_source.html">drush.api.php</a>.</p>

</div>
</div>
<a class="anchor" id="ga5142b9fb7c6d1fbf4ae73a18b60bf6b8"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">hook_drush_pm_post_download </td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$project</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$release</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Take action after a project has been downloaded. </p>

<p>Definition at line <a class="el" href="drush_8api_8php_source.html#l00208">208</a> of file <a class="el" href="drush_8api_8php_source.html">drush.api.php</a>.</p>

</div>
</div>
<a class="anchor" id="gab01f27f1d336baa4dad089307e79f575"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">hook_drush_sql_sync_sanitize </td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$source</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Sql-sync sanitization example.</p>
<p>This is equivalent to the built-in &ndash;sanitize option of sql-sync, but simplified to only work with default values on Drupal 6 + mysql.</p>
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="sql_8drush_8inc.html#a31ea6e16a805e81fad22960a6325ec51">sql_drush_sql_sync_sanitize()</a> </dd></dl>

<p>Definition at line <a class="el" href="drush_8api_8php_source.html#l00267">267</a> of file <a class="el" href="drush_8api_8php_source.html">drush.api.php</a>.</p>

<p>References <a class="el" href="sql_8drush_8inc_source.html#l00602">drush_sql_register_post_sync_op()</a>, and <a class="el" href="output_8inc_source.html#l00145">dt()</a>.</p>

<p><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="group__hooks_gab01f27f1d336baa4dad089307e79f575_cgraph.png" border="0" usemap="#group__hooks_gab01f27f1d336baa4dad089307e79f575_cgraph" alt=""/></div>
<map name="group__hooks_gab01f27f1d336baa4dad089307e79f575_cgraph" id="group__hooks_gab01f27f1d336baa4dad089307e79f575_cgraph">
<area shape="rect" id="node3" href="sql_8drush_8inc.html#aa235e973665b628a3301129a4967a351" title="drush_sql_register\l_post_sync_op" alt="" coords="295,5,423,51"/><area shape="rect" id="node10" href="group__outputfunctions.html#ga1218abcb1e27dd3bb412113d1e344d96" title="dt" alt="" coords="204,75,241,104"/><area shape="rect" id="node5" href="context_8inc.html#ad25559f8d7d753f636fbeac347c29fc5" title="drush_get_context" alt="" coords="703,29,831,59"/><area shape="rect" id="node7" href="context_8inc.html#af983acfe90e7d7bbdbd67c57f93708ba" title="drush_set_context" alt="" coords="484,29,612,59"/><area shape="rect" id="node12" href="includes_2drupal_8inc.html#ad2ccab77d4bc8e7355186f26cd328ac0" title="drush_drupal_major\l_version" alt="" coords="292,74,425,121"/><area shape="rect" id="node14" href="includes_2drupal_8inc.html#a203e989fd043d054d774954e2b2dff21" title="drush_drupal_version" alt="" coords="476,83,620,112"/><area shape="rect" id="node16" href="includes_2drupal_8inc.html#aa7ac001ed15d678fa533b54d962eb5bc" title="drush_drupal_load_autoloader" alt="" coords="669,83,864,112"/></map>
</div>
</p>

</div>
</div>
<a class="anchor" id="ga2dd2e76bb7ed0c24fc312288ee5c31e4"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">hook_pm_post_update </td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$release_name</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$release_candidate_version</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>$project_parent_path</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Take action after a project has been updated. </p>

<p>Definition at line <a class="el" href="drush_8api_8php_source.html#l00215">215</a> of file <a class="el" href="drush_8api_8php_source.html">drush.api.php</a>.</p>

</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Wed Oct 8 2014 09:05:01 for Drush by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.1.2
</small></address>
</body>
</html>