Drush: commands/core/core.drush.inc Source File

  1. 7.x doxygen/html/core_8drush_8inc_source.html
  2. master doxygen/html/core_8drush_8inc_source.html
Go to the documentation of this file.
1 <?php
2 
3 /**
4  * @file
5  * Core drush commands.
6  */
7 
9 use SebastianBergmann\Version;
10 
11 /**
12  * Implementation of hook_drush_help().
13  *
14  * This function is called whenever a drush user calls
15  * 'drush help <name-of-your-command>'
16  *
17  * @param
18  * A string with the help section (prepend with 'drush:')
19  *
20  * @return
21  * A string with the help text for your command.
22  */
23 function core_drush_help($section) {
24  switch ($section) {
25  case 'meta:core:title':
26  return dt("Core Drush commands");
27  case 'drush:php-script':
28  return dt("Runs the given php script(s) after a full Drupal bootstrap. A useful alternative to eval command when your php is lengthy or you can't be bothered to figure out bash quoting. If you plan to share a script with others, consider making a full drush command instead, since that's more self-documenting. Drush provides commandline options to the script via drush_get_option('option-name'), and commandline arguments can be accessed either via drush_get_arguments(), which returns all arguments in an array, or drush_shift(), which removes the next argument from the list and returns it.");
29  case 'drush:rsync':
30  return dt("Sync the entire drupal directory or a subdirectory to a <destination> using ssh. Excludes reserved files and directories for supported VCSs. Useful for pushing copies of your tree to a staging server, or retrieving a files directory from a remote site. Relative paths start from the Drupal root directory if a site alias is used; otherwise they start from the current working directory.");
31  case 'error:DRUSH_DRUPAL_DB_ERROR':
32  $message = dt("Drush was not able to start (bootstrap) the Drupal database.\n");
33  $message .= dt("Hint: This may occur when Drush is trying to:\n");
34  $message .= dt(" * bootstrap a site that has not been installed or does not have a configured database. In this case you can select another site with a working database setup by specifying the URI to use with the --uri parameter on the command line. See `drush topic docs-aliases` for details.\n");
35  $message .= dt(" * connect the database through a socket. The socket file may be wrong or the php-cli may have no access to it in a jailed shell. See http://drupal.org/node/1428638 for details.\n");
36  $message .= dt("\nDrush was attempting to connect to: \n!credentials\n", array('!credentials' => _core_site_credentials(12)));
37  return $message;
38  case 'error:DRUSH_DRUPAL_BOOTSTRAP_ERROR':
39  $message = dt("Drush was not able to start (bootstrap) Drupal.\n");
40  $message .= dt("Hint: This error can only occur once the database connection has already been successfully initiated, therefore this error generally points to a site configuration issue, and not a problem connecting to the database.\n");
41  $message .= dt("\nDrush was attempting to connect to: \n!credentials\n", array('!credentials' => _core_site_credentials(12)));
42  return $message;
43  break;
44  }
45 }
46 
47 /**
48  * Implements hook_drush_help_alter().
49  */
50 function core_drush_help_alter(&$command) {
51  // Drupal 8+ only options.
52  if (drush_drupal_major_version() < 8) {
53  if ($command['commandfile'] == 'core' && $command['command'] == 'updatedb') {
54  unset($command['options']['entity-updates']);
55  }
56  }
57 }
58 
59 /**
60  * Implementation of hook_drush_command().
61  *
62  * In this hook, you specify which commands your
63  * drush module makes available, what it does and
64  * description.
65  *
66  * Notice how this structure closely resembles how
67  * you define menu hooks.
68  *
69  * @return
70  * An associative array describing your command(s).
71  */
72 function core_drush_command() {
73  $items = array();
74 
75  $items['version'] = array(
76  'description' => 'Show drush version.',
77  'bootstrap' => DRUSH_BOOTSTRAP_NONE, // No bootstrap.
78  'options' => array(
79  'pipe' => 'Print just the version number, and nothing else.',
80  ),
81  'outputformat' => array(
82  'default' => 'key-value',
83  'pipe-format' => 'string',
84  'label' => 'Drush Version',
85  'output-data-type' => 'format-single',
86  ),
87  );
88  $items['core-cron'] = array(
89  'description' => 'Run all cron hooks in all active modules for specified site.',
90  'aliases' => array('cron'),
91  'topics' => array('docs-cron'),
92  );
93  $items['updatedb'] = array(
94  'description' => 'Apply any database updates required (as with running update.php).',
95  'bootstrap' => DRUSH_BOOTSTRAP_DRUPAL_SITE,
96  'global-options' => array(
97  'cache-clear',
98  ),
99  'options' => array(
100  'entity-updates' => 'Run automatic entity schema updates at the end of any update hooks. Defaults to --no-entity-updates.',
101  ),
102  'aliases' => array('updb'),
103  );
104  $items['entity-updates'] = array(
105  'description' => 'Apply pending entity schema updates.',
106  'aliases' => array('entup'),
107  'bootstrap' => DRUSH_BOOTSTRAP_DRUPAL_FULL,
108  'core' => array('8+'),
109  );
110  $items['twig-compile'] = array(
111  'description' => 'Compile all Twig template(s).',
112  'aliases' => array('twigc'),
113  'core' => array('8+'),
114  );
115  $items['updatedb-status'] = array(
116  'description' => 'List any pending database updates.',
117  'outputformat' => array(
118  'default' => 'table',
119  'pipe-format' => 'csv',
120  'field-labels' => array('module' => 'Module', 'update_id' => 'Update ID', 'description' => 'Description'),
121  'fields-default' => array('module', 'update_id', 'description'),
122  'output-data-type' => 'format-table',
123  ),
124  'aliases' => array('updbst'),
125  );
126  $items['core-config'] = array(
127  'description' => 'Edit drushrc, site alias, and Drupal settings.php files.',
128  'bootstrap' => DRUSH_BOOTSTRAP_MAX,
129  'arguments' => array(
130  'filter' => 'A substring for filtering the list of files. Omit this argument to choose from loaded files.',
131  ),
132  'global-options' => array('editor', 'bg'),
133  'examples' => array(
134  'drush core-config' => 'Pick from a list of config/alias/settings files. Open selected in editor.',
135  'drush --bg core-config' => 'Return to shell prompt as soon as the editor window opens.',
136  'drush core-config etc' => 'Edit the global configuration file.',
137  'drush core-config demo.alia' => 'Edit a particular alias file.',
138  'drush core-config sett' => 'Edit settings.php for the current Drupal site.',
139  'drush core-config --choice=2' => 'Edit the second file in the choice list.',
140  ),
141  'aliases' => array('conf', 'config'),
142  );
143  $items['core-status'] = array(
144  'description' => 'Provides a birds-eye view of the current Drupal installation, if any.',
145  'bootstrap' => DRUSH_BOOTSTRAP_MAX,
146  'aliases' => array('status', 'st'),
147  'examples' => array(
148  'drush core-status version' => 'Show all status lines that contain version information.',
149  'drush core-status --pipe' => 'A list key=value items separated by line breaks.',
150  'drush core-status drush-version --pipe' => 'Emit just the drush version with no label.',
151  'drush core-status config-sync --pipe' => 'Emit just the sync Config directory with no label.',
152  ),
153  'arguments' => array(
154  'item' => 'Optional. The status item line(s) to display.',
155  ),
156  'options' => array(
157  'show-passwords' => 'Show database password. Defaults to --no-show-passwords.',
158  'full' => 'Show all file paths and drush aliases in the report, even if there are a lot.',
159  'project' => array(
160  'description' => 'One or more projects that should be added to the path list',
161  'example-value' => 'foo,bar',
162  ),
163  ),
164  'outputformat' => array(
165  'default' => 'key-value',
166  'pipe-format' => 'json',
167  'field-labels' => array('drupal-version' => 'Drupal version', 'uri' => 'Site URI', 'db-driver' => 'Database driver', 'db-hostname' => 'Database hostname', 'db-port' => 'Database port', 'db-username' => 'Database username', 'db-password' => 'Database password', 'db-name' => 'Database name', 'db-status' => 'Database', 'bootstrap' => 'Drupal bootstrap', 'user' => 'Drupal user', 'theme' => 'Default theme', 'admin-theme' => 'Administration theme', 'php-bin' => 'PHP executable', 'php-conf' => 'PHP configuration', 'php-os' => 'PHP OS', 'drush-script' => 'Drush script', 'drush-version' => 'Drush version', 'drush-temp' => 'Drush temp directory', 'drush-conf' => 'Drush configuration', 'drush-alias-files' => 'Drush alias files', 'install-profile' => 'Install profile', 'root' => 'Drupal root', 'drupal-settings-file' => 'Drupal Settings File', 'site-path' => 'Site path', 'root' => 'Drupal root', 'site' => 'Site path', 'themes' => 'Themes path', 'modules' => 'Modules path', 'files' => 'File directory path', 'private' => 'Private file directory path', 'temp' => 'Temporary file directory path', 'config-sync' => 'Sync config path', 'files-path' => 'File directory path', 'temp-path' => 'Temporary file directory path', '%paths' => 'Other paths'),
168  'formatted-filter' => '_drush_core_status_format_table_data',
169  'private-fields' => 'db-password',
170  'simplify-single' => TRUE,
171  'table-metadata' => array(
172  'list-separator' => ' ',
173  ),
174  'output-data-type' => 'format-list',
175  ),
176  'topics' => array('docs-readme'),
177  );
178 
179  $items['core-requirements'] = array(
180  'description' => 'Provides information about things that may be wrong in your Drupal installation, if any.',
181  'aliases' => array('status-report','rq'),
182  'examples' => array(
183  'drush core-requirements' => 'Show all status lines from the Status Report admin page.',
184  'drush core-requirements --severity=2' => 'Show only the red lines from the Status Report admin page.',
185  'drush core-requirements --pipe' => 'Print out a short report in JSON format, where severity 2=error, 1=warning, and 0/-1=OK',
186  ),
187  'options' => array(
188  'severity' => array(
189  'description' => 'Only show status report messages with a severity greater than or equal to the specified value.',
190  'value' => 'required',
191  'example-value' => '3',
192  ),
193  'ignore' => 'Comma-separated list of requirements to remove from output. Run with --pipe to see key values to use.',
194  ),
195  'outputformat' => array(
196  'default' => 'table',
197  'pipe-format' => 'json',
198  'field-labels' => array('title' => 'Title', 'severity' => 'Severity', 'sid' => 'SID', 'description' => 'Description', 'value' => 'Summary', 'reason' => 'Reason', 'weight' => 'Weight'),
199  'fields-default' => array('title', 'severity', 'description'),
200  'column-widths' => array('severity' => 8),
201  'concatenate-columns' => array('description' => array('value', 'description')),
202  'strip-tags' => TRUE,
203  'ini-item' => 'sid',
204  'key-value-item' => 'severity',
205  'list-metadata' => array(
206  'list-item' => 'severity',
207  ),
208  'output-data-type' => 'format-table',
209  ),
210  );
211  $items['php-eval'] = array(
212  'description' => 'Evaluate arbitrary php code after bootstrapping Drupal (if available).',
213  'examples' => array(
214  'drush php-eval \'variable_set("hello", "world");\'' => 'Sets the hello variable using Drupal API.',
215  'drush php-eval \'$node = node_load(1); print $node->title;\'' => 'Loads node with nid 1 and then prints its title.',
216  'drush php-eval "file_unmanaged_copy(\'$HOME/Pictures/image.jpg\', \'public://image.jpg\');"' => 'Copies a file whose path is determined by an environment\'s variable. Note the use of double quotes so the variable $HOME gets replaced by its value.',
217  'drush php-eval "node_access_rebuild();"' => 'Rebuild node access permissions.',
218  ),
219  'arguments' => array(
220  'code' => 'PHP code',
221  ),
222  'required-arguments' => TRUE,
223  'allow-additional-options' => TRUE,
224  'bootstrap' => DRUSH_BOOTSTRAP_MAX,
225  'aliases' => array('eval', 'ev'),
226  'outputformat' => array(
227  'default' => 'var_export',
228  ),
229  );
230  $items['php-script'] = array(
231  'description' => "Run php script(s).",
232  'examples' => array(
233  'drush php-script example --script-path=/path/to/scripts:/another/path' => 'Run a script named example.php from specified paths',
234  'drush php-script' => 'List all available scripts.',
235  '' => '',
236  "#!/usr/bin/env drush\n<?php\nvariable_set('key', drush_shift());" => "Execute php code with a full Drupal bootstrap directly from a shell script.",
237  ),
238  'arguments' => array(
239  'filename' => 'Optional. The file you wish to execute (without extension). If omitted, list files ending in .php in the current working directory and specified script-path. Some might not be real drush scripts. Beware.',
240  ),
241  'options' => array(
242  'script-path' => array(
243  'description' => "Additional paths to search for scripts, separated by : (Unix-based systems) or ; (Windows).",
244  'example-value' => '~/scripts',
245  ),
246  ),
247  'allow-additional-options' => TRUE,
248  'bootstrap' => DRUSH_BOOTSTRAP_MAX,
249  'aliases' => array('scr'),
250  'topics' => array('docs-examplescript', 'docs-scripts'),
251  );
252  $items['core-execute'] = array(
253  'description' => 'Execute a shell command. Usually used with a site alias.',
254  'bootstrap' => DRUSH_BOOTSTRAP_NONE, // No bootstrap.
255  'arguments' => array(
256  'command' => 'The shell command to be executed.',
257  ),
258  'options' => array(
259  'escape' => 'Escape parameters before executing them with the shell. Default is escape; use --no-escape to disable.',
261  'required-arguments' => TRUE,
262  'allow-additional-options' => TRUE,
263  'handle-remote-commands' => TRUE,
264  'strict-option-handling' => TRUE,
265  'examples' => array(
266  'drush core-execute git pull origin rebase' => 'Retrieve latest code from git',
267  ),
268  'aliases' => array('exec', 'execute'),
269  'topics' => array('docs-aliases'),
270  );
271  $items['core-rsync'] = array(
272  'description' => 'Rsync the Drupal tree to/from another server using ssh.',
273  'bootstrap' => DRUSH_BOOTSTRAP_NONE, // No bootstrap.
274  'arguments' => array(
275  'source' => 'May be rsync path or site alias. See rsync documentation and example.aliases.drushrc.php.',
276  'destination' => 'May be rsync path or site alias. See rsync documentation and example.aliases.drushrc.php.',
277  ),
278  'options' => array(
279  'mode' => 'The unary flags to pass to rsync; --mode=rultz implies rsync -rultz. Default is -akz.',
280  'exclude-conf' => 'Excludes settings.php from being rsynced. Default.',
281  'include-conf' => 'Allow settings.php to be rsynced. Default is to exclude settings.php.',
282  'include-vcs' => 'Include special version control directories (e.g. .svn). Default is to exclude vcs files.',
283  'exclude-files' => 'Exclude the files directory.',
284  'exclude-sites' => 'Exclude all directories in "sites/" except for "sites/all".',
285  'exclude-other-sites' => 'Exclude all directories in "sites/" except for "sites/all" and the site directory for the site being synced. Note: if the site directory is different between the source and destination, use --exclude-sites followed by "drush rsync @from:%site @to:%site"',
286  'exclude-paths' => 'List of paths to exclude, seperated by : (Unix-based systems) or ; (Windows).',
287  'include-paths' => 'List of paths to include, seperated by : (Unix-based systems) or ; (Windows).',
288  '{rsync-option-name}' => "Replace {rsync-option-name} with the rsync option (or option='value') that you would like to pass through to rsync. Examples include --delete, --exclude=*.sql, --filter='merge /etc/rsync/default.rules', etc. See the rsync documentation for a complete explanation of all the rsync options and values.",
289  'rsync-version' => 'Set to the version of rsync you are using to signal Drush to go into backwards-compatibility mode when using very old versions of rsync. For example, --rsync-version=2.6.8 or earlier will cause Drush to avoid the --remove-source-files flag.',
290 
291  ),
292  'strict-option-handling' => TRUE,
293  'examples' => array(
294  'drush rsync @dev @stage' => 'Rsync Drupal root from Drush alias dev to the alias stage. Either or both may be remote.',
295  'drush rsync ./ @stage:%files/img' => 'Rsync all files in the current directory to the \'img\' directory in the file storage folder on the Drush alias stage.',
296  'drush -s rsync @dev @stage --exclude=*.sql --delete' => "Simulate Rsync Drupal root from the Drush alias dev to the alias stage (one of which must be local), excluding all files that match the filter '*.sql' and delete all files on the destination that are no longer on the source.",
297  ),
298  'aliases' => array('rsync'),
299  'topics' => array('docs-aliases'),
300  );
301  $items['drupal-directory'] = array(
302  'description' => 'Return the filesystem path for modules/themes and other key folders.',
303  'arguments' => array(
304  'target' => 'A module/theme name, or special names like root, files, private, or an alias : path alias string such as @alias:%files. Defaults to root.',
305  ),
306  'options' => array(
307  'component' => "The portion of the evaluated path to return. Defaults to 'path'; 'name' returns the site alias of the target.",
308  'local-only' => "Reject any target that specifies a remote site.",
309  ),
310  'examples' => array(
311  'cd `drush dd devel`' => 'Navigate into the devel module directory',
312  'cd `drush dd` ' => 'Navigate to the root of your Drupal site',
313  'cd `drush dd files`' => 'Navigate to the files directory.',
314  'drush dd @alias:%files' => 'Print the path to the files directory on the site @alias.',
315  'edit `drush dd devel`/devel.module' => "Open devel module in your editor (customize 'edit' for your editor)",
316  ),
317  'aliases' => array('dd'),
318  'bootstrap' => DRUSH_BOOTSTRAP_NONE,
319  );
320 
321  $items['batch-process'] = array(
322  'description' => 'Process operations in the specified batch set',
323  'hidden' => TRUE,
324  'arguments' => array(
325  'batch-id' => 'The batch id that will be processed.',
326  ),
327  'required-arguments' => TRUE,
328  'bootstrap' => DRUSH_BOOTSTRAP_DRUPAL_LOGIN,
329  );
330 
331  $items['updatedb-batch-process'] = array(
332  'description' => 'Perform update functions',
333  'hidden' => TRUE,
334  'arguments' => array(
335  'batch-id' => 'The batch id that will be processed',
336  ),
337  'required-arguments' => TRUE,
338  // Drupal 7 needs DRUSH_BOOTSTRAP_DRUPAL_CONFIGURATION, while Drupal 8 needs _FULL.
339  // Therefore we bootstrap to _FULL in commands/core/drupal/update.inc.
341  );
342  $items['core-global-options'] = array(
343  'description' => 'All global options',
344  'hidden' => TRUE,
345  'topic' => TRUE,
346  'bootstrap' => DRUSH_BOOTSTRAP_NONE,
347  'outputformat' => array(
348  'default' => 'table',
349  'pipe-format' => 'csv',
350  'field-labels' => array('label' => 'Label', 'description' => 'Description'),
351  'output-data-type' => 'format-table',
352  ),
353  );
354  $items['core-quick-drupal'] = array(
355  'description' => 'Download, install, serve and login to Drupal with minimal configuration and dependencies.',
356  'bootstrap' => DRUSH_BOOTSTRAP_NONE,
357  'aliases' => array('qd', 'cutie'),
358  'arguments' => array(
359  'site' => 'Short name for the site to be created - used as a directory name and as sqlite file name. Optional - if omitted timestamped "quick-drupal" directory will be used instead.',
360  'projects' => 'A list of projects to download into the new site. If projects contain extensions (modules or themes) with the same name they will be enabled by default. See --enable option to control this behaviour further.',
361  ),
362  'examples' => array(
363  'drush qd' => 'Download and install stable release of Drupal into a timestamped directory, start server, and open the site logged in as admin.',
364  'drush qd --profile=minimal --cache --core=drupal-8.0.x --yes' => 'Fire up dev release of Drupal site with minimal install profile.',
365  'drush qd testsite devel --server=:8081/admin --browser=firefox --cache --yes' => 'Fire up stable release (using the cache) of Drupal site called "testsite", download and enable devel module, start a server on port 8081 and open /admin in firefox.',
366  'drush qd commercesite --core=commerce_kickstart --profile=commerce_kickstart --cache --yes --watchdog' => 'Download and install the "Commerce Kickstart" distribution/install profile, display watchdog messages on the server console.',
367  'drush qd --makefile=mysite.make' => 'Create and install a site from a makefile.',
368  ),
369  );
370  // Add in options/engines.
372  // Add in topics for engines
373  $items += drush_get_engine_topics();
374  return $items;
375 }
376 
377 /**
378  * Command argument complete callback.
379  *
380  * @return
381  * Array of available profile names.
382  */
385  if ($max >= DRUSH_BOOTSTRAP_DRUPAL_ROOT) {
386  return array('values' => array_keys(drush_find_profiles(DRUPAL_ROOT)));
387  }
388 }
389 
390 /**
391  * Command argument complete callback.
392  *
393  * @return
394  * Array of available site aliases.
395  */
397  return array('values' => array_keys(_drush_sitealias_all_list()));
398 }
399 
400 /**
401  * @defgroup engines Engine types
402  * @{
403  */
404 
405 /**
406  * Implementation of hook_drush_engine_type_info().
407  */
409  $info = array();
410  $info['drupal'] = array();
411  return $info;
412 }
413 
414 /**
415  * Implements hook_drush_engine_ENGINE_TYPE().
416  */
418  $engines = array(
419  'batch' => array(),
420  'update'=> array(),
421  'environment' => array(),
422  'site_install' => array(),
423  'pm' => array(),
424  'cache' => array(),
425  'image' => array(),
426  );
427  return $engines;
428 }
429 
430 /**
431  * @} End of "Engine types".
432  */
433 
434 /**
435  * Command handler. Apply pending entity schema updates.
436  */
438  if (drush_get_context('DRUSH_SIMULATE')) {
439  drush_log(dt('entity-updates command does not support --simulate option.'), LogLevel::OK);
440  }
441 
442  drush_include_engine('drupal', 'update');
443  if (entity_updates_main() === FALSE) {
444  return FALSE;
445  }
446 
448 
449  drush_log(dt('Finished performing updates.'), LogLevel::OK);
450 }
451 
452 /**
453  * Command handler. Execute update.php code from drush.
454  */
456  if (drush_get_context('DRUSH_SIMULATE')) {
457  drush_log(dt('updatedb command does not support --simulate option.'), LogLevel::OK);
458  return TRUE;
459  }
460 
461  drush_include_engine('drupal', 'update');
462  $result = update_main();
463  if ($result === FALSE) {
464  return FALSE;
465  }
466  elseif ($result > 0) {
467  // Clear all caches in a new process. We just performed major surgery.
469 
470  drush_log(dt('Finished performing updates.'), LogLevel::OK);
471  }
472 }
473 
474 /**
475  * Command handler. List pending DB updates.
476  */
478  require_once DRUSH_DRUPAL_CORE . '/includes/install.inc';
479  drupal_load_updates();
480  drush_include_engine('drupal', 'update');
481  list($pending, $start) = updatedb_status();
482  if (empty($pending)) {
483  drush_log(dt("No database updates required"), LogLevel::OK);
484  }
485  return $pending;
486 }
487 
488 function _core_site_credentials($right_margin = 0) {
489  // Leave some space on the right so that we can put the result into the
490  // drush_log, which will again wordwrap the result.
491  $original_columns = drush_get_context('DRUSH_COLUMNS', 80);
492  drush_set_context('DRUSH_COLUMNS', $original_columns - $right_margin);
493  $status_table = _core_site_status_table();
494  $metadata = drush_get_command_format_metadata('core-status');
495  $output = drush_format($status_table, $metadata, 'key-value');
496  drush_set_context('DRUSH_COLUMNS', $original_columns);
497  return $output;
498 }
499 
500 function _core_path_aliases($project = '') {
501  $paths = array();
502  $site_wide = drush_drupal_sitewide_directory();
503  $boot = \Drush::bootstrap();
504  if ($drupal_root = drush_get_context('DRUSH_DRUPAL_ROOT')) {
505  $paths['%root'] = $drupal_root;
506  if ($site_root = drush_get_context('DRUSH_DRUPAL_SITE_ROOT')) {
507  $paths['%site'] = $site_root;
508  if (is_dir($modules_path = $boot->conf_path() . '/modules')) {
509  $paths['%modules'] = $modules_path;
510  }
511  else {
512  $paths['%modules'] = ltrim($site_wide . '/modules', '/');
513  }
514  if (is_dir($themes_path = $boot->conf_path() . '/themes')) {
515  $paths['%themes'] = $themes_path;
516  }
517  else {
518  $paths['%themes'] = ltrim($site_wide . '/themes', '/');
519  }
521  try {
522  if (isset($GLOBALS['config_directories'])) {
523  foreach ($GLOBALS['config_directories'] as $label => $unused) {
524  $paths["%config-$label"] = config_get_config_directory($label);
525  }
526  }
527  }
528  catch (Exception $e) {
529  // Nothing to do.
530  }
531  }
532 
534  $paths['%files'] = drush_file_get_public();
535  if ($private_path = drush_file_get_private()) {
536  $paths['%private'] = $private_path;
537  }
538  }
539 
540  if (function_exists('file_directory_temp')) {
541  $paths['%temp'] = file_directory_temp();
542  }
543  // If the 'project' parameter was specified, then search
544  // for a project (or a few) and add its path to the path list
545  if (!empty($project)) {
546  drush_include_engine('drupal', 'environment');
548  foreach(explode(',', $project) as $target) {
549  if (array_key_exists($target, $projects)) {
550  $paths['%' . $target] = $drupal_root . '/' . _drush_extension_get_path($projects[$target]);
551  }
552  }
553  }
554  }
555  }
556 
557  // Add in all of the global paths from $options['path-aliases']
558  $paths = array_merge($paths, drush_get_option('path-aliases', array()));
559 
560  return $paths;
561 }
562 
563 function _core_site_status_table($project = '') {
564  $phase = drush_get_context('DRUSH_BOOTSTRAP_PHASE');
565  if ($drupal_root = drush_get_context('DRUSH_DRUPAL_ROOT')) {
566  $status_table['drupal-version'] = drush_drupal_version();
567  $boot_object = \Drush::bootstrap();
568  $conf_dir = $boot_object->conf_path();
569  $settings_file = "$conf_dir/settings.php";
570  $status_table['drupal-settings-file'] = file_exists($settings_file) ? $settings_file : '';
571  if ($site_root = drush_get_context('DRUSH_DRUPAL_SITE_ROOT')) {
572  $status_table['uri'] = drush_get_context('DRUSH_URI');
573  try {
574  $sql = drush_sql_get_class();
575  $db_spec = $sql->db_spec();
576  $status_table['db-driver'] = $db_spec['driver'];
577  if (!empty($db_spec['unix_socket'])) {
578  $status_table['db-socket'] = $db_spec['unix_socket'];
579  }
580  elseif (isset($db_spec['host'])) {
581  $status_table['db-hostname'] = $db_spec['host'];
582  }
583  $status_table['db-username'] = isset($db_spec['username']) ? $db_spec['username'] : NULL;
584  $status_table['db-password'] = isset($db_spec['password']) ? $db_spec['password'] : NULL;
585  $status_table['db-name'] = isset($db_spec['database']) ? $db_spec['database'] : NULL;
586  $status_table['db-port'] = isset($db_spec['port']) ? $db_spec['port'] : NULL;
588  $status_table['install-profile'] = $boot_object->get_profile();
589  if ($phase > DRUSH_BOOTSTRAP_DRUPAL_DATABASE) {
590  $status_table['db-status'] = dt('Connected');
591  if ($phase > DRUSH_BOOTSTRAP_DRUPAL_FULL) {
592  $status_table['bootstrap'] = dt('Successful');
593  if ($phase == DRUSH_BOOTSTRAP_DRUPAL_LOGIN) {
594  $status_table['user'] = drush_user_get_class()->getCurrentUserAsSingle()->getUsername();
595  }
596  }
597  }
598  }
599  }
600  catch (Exception $e) {
601  // Don't worry be happy.
602  }
603  }
605  $status_table['theme'] = drush_theme_get_default();
606  $status_table['admin-theme'] = drush_theme_get_admin();
607  }
608  }
609  if ($php_bin = drush_get_option('php')) {
610  $status_table['php-bin'] = $php_bin;
611  }
612  $status_table['php-os'] = PHP_OS;
613  if ($php_ini_files = _drush_core_config_php_ini_files()) {
614  $status_table['php-conf'] = $php_ini_files;
615  }
616  $status_table['drush-script'] = DRUSH_COMMAND;
617  $status_table['drush-version'] = Drush::getVersion();
618  $status_table['drush-temp'] = drush_find_tmp();
619  $status_table['drush-conf'] = drush_flatten_array(drush_get_context_options('context-path', ''));
620  $alias_files = _drush_sitealias_find_alias_files();
621  $status_table['drush-alias-files'] = $alias_files;
622 
623  $paths = _core_path_aliases($project);
624  if (!empty($paths)) {
625  foreach ($paths as $target => $one_path) {
626  $name = $target;
627  if (substr($name,0,1) == '%') {
628  $name = substr($name,1);
629  }
630  $status_table[$name] = $one_path;
631  }
632  }
633 
634  // Store the paths into the '%paths' index; this will be
635  // used by other code, but will not be included in the output
636  // of the drush status command.
637  $status_table['%paths'] = $paths;
638 
639  return $status_table;
640 }
641 
642 // Adjust the status output for any non-pipe output format
643 function _drush_core_status_format_table_data($output, $metadata) {
644  if (drush_get_option('full', FALSE) == FALSE) {
645  // Hide any key that begins with a %
646  foreach ($output as $key => $value) {
647  if ($key[0] == '%') {
648  unset($output[$key]);
649  }
650  }
651  // Hide 'Modules path' and 'Themes path' as well
652  unset($output['modules']);
653  unset($output['themes']);
654  // Shorten the list of alias files if there are too many
655  if (isset($output['drush-alias-files']) && count($output['drush-alias-files']) > 24) {
656  $msg = dt("\nThere are !count more alias files. Run with --full to see the full list.", array('!count' => count($output['drush-alias-files']) - 1));
657  $output['drush-alias-files'] = array($output['drush-alias-files'][0] , $msg);
658  }
659  if (isset($output['drupal-settings-file']) && empty($output['drupal-settings-file'])) {
660  $output['drupal-settings-file'] = dt('MISSING');
661  }
662  }
663  return $output;
664 }
665 
666 /**
667  * Command callback. Runs all cron hooks.
668  */
669 function drush_core_cron() {
670  if (drush_drupal_major_version() < 8) {
671  $result = drupal_cron_run();
672  }
673  else {
674  $result = \Drupal::service('cron')->run();
675  }
676  if ($result) {
677  drush_log(dt('Cron run successful.'), LogLevel::SUCCESS);
678  }
679  else {
680  return drush_set_error('DRUSH_CRON_FAILED', dt('Cron run failed.'));
681  }
682 }
683 
684 /**
685  * Command callback. Edit drushrc and alias files.
686  */
687 function drush_core_config($filter = NULL) {
688  $all = drush_core_config_load();
689 
690  // Apply any filter that was supplied.
691  if ($filter) {
692  foreach ($all as $key => $file) {
693  if (strpos($file, $filter) === FALSE) {
694  unset($all[$key]);
695  }
696  }
697  }
698  $all = drush_map_assoc(array_values($all));
699 
700  $exec = drush_get_editor();
701  if (count($all) == 1) {
702  $filepath = current($all);
703  }
704  else {
705  $choice = drush_choice($all, 'Enter a number to choose which file to edit.', '!key');
706  if (!$choice) {
707  return drush_user_abort();
708  }
709  $filepath = $all[$choice];
710  }
711  return drush_shell_exec_interactive($exec, $filepath, $filepath);
712 }
713 
714 /**
715  * Command argument complete callback.
716  *
717  * @return
718  * Array of available configuration files for editing.
719  */
721  return array('values' => drush_core_config_load(FALSE));
722 }
723 
724 function drush_core_config_load($headers = TRUE) {
725  $php_header = $php = $rcs_header = $rcs = $aliases_header = $aliases = $drupal_header = $drupal = array();
727  if (!empty($php)) {
728  if ($headers) {
729  $php_header = array('phpini' => '-- PHP ini files --');
730  }
731  }
732 
734  if (!empty($bash)) {
735  if ($headers) {
736  $bash_header = array('bash' => '-- Bash files --');
737  }
738  }
739 
741  if ($rcs = drush_get_context_options('context-path', TRUE)) {
742  if ($headers) {
743  $rcs_header = array('drushrc' => '-- Drushrc --');
744  }
745  }
746  if ($aliases = drush_get_context('drush-alias-files')) {
747  if ($headers) {
748  $aliases_header = array('aliases' => '-- Aliases --');
749  }
750  }
751  if ($site_root = drush_get_context('DRUSH_DRUPAL_SITE_ROOT')) {
752  $drupal[] = realpath($site_root . '/settings.php');
753  if (file_exists($site_root . '/settings.local.php')) {
754  $drupal[] = realpath($site_root . '/settings.local.php');
755  }
756  $drupal[] = realpath(DRUPAL_ROOT . '/.htaccess');
757  if ($headers) {
758  $drupal_header = array('drupal' => '-- Drupal --');
759  }
760  }
761  return array_merge($php_header, $php, $bash_header, $bash, $rcs_header, $rcs, $aliases_header, $aliases, $drupal_header, $drupal);
762 }
763 
765  $ini_files = array();
766  $ini_files[] = php_ini_loaded_file();
767  if ($drush_ini = getenv('DRUSH_INI')) {
768  if (file_exists($drush_ini)) {
769  $ini_files[] = $drush_ini;
770  }
771  }
772  foreach (array(DRUSH_BASE_PATH, '/etc/drush', drush_server_home() . '/.drush') as $ini_dir) {
773  if (file_exists($ini_dir . "/drush.ini")) {
774  $ini_files[] = realpath($ini_dir . "/drush.ini");
775  }
776  }
777  return array_unique($ini_files);
778 }
779 
781  $bash_files = array();
782  $home = drush_server_home();
783  if ($bashrc = drush_init_find_bashrc($home)) {
784  $bash_files[] = $bashrc;
785  }
786  $prompt = $home . '/.drush/drush.prompt.sh';
787  if (file_exists($prompt)) {
788  $bash_files[] = $prompt;
789  }
790  return $bash_files;
791 }
792 
793 /**
794  * Command callback. Provides information from the 'Status Reports' admin page.
795  */
797  include_once DRUSH_DRUPAL_CORE . '/includes/install.inc';
798  $severities = array(
799  REQUIREMENT_INFO => t('Info'),
800  REQUIREMENT_OK => t('OK'),
801  REQUIREMENT_WARNING => t('Warning'),
802  REQUIREMENT_ERROR => t('Error'),
803  );
804 
805  drupal_load_updates();
806 
807  drush_include_engine('drupal', 'environment');
808  $requirements = drush_module_invoke_all('requirements', 'runtime');
809  // If a module uses "$requirements[] = " instead of
810  // "$requirements['label'] = ", then build a label from
811  // the title.
812  foreach($requirements as $key => $info) {
813  if (is_numeric($key)) {
814  unset($requirements[$key]);
815  $new_key = strtolower(str_replace(' ', '_', $info['title']));
816  $requirements[$new_key] = $info;
817  }
818  }
819  $ignore_requirements = drush_get_option_list('ignore');
820  foreach ($ignore_requirements as $ignore) {
821  unset($requirements[$ignore]);
822  }
823  ksort($requirements);
824 
825  $min_severity = drush_get_option('severity', -1);
826  foreach($requirements as $key => $info) {
827  $severity = array_key_exists('severity', $info) ? $info['severity'] : -1;
828  $requirements[$key]['sid'] = $severity;
829  $requirements[$key]['severity'] = $severities[$severity];
830  if ($severity < $min_severity) {
831  unset($requirements[$key]);
832  }
833  }
834  return $requirements;
835 }
836 
837 /**
838  * Command callback. Provides a birds-eye view of the current Drupal
839  * installation.
840  */
841 function drush_core_status() {
842  $status_table = _core_site_status_table(drush_get_option('project',''));
843  // If args are specified, filter out any entry that is not named
844  // (in other words, only show lines named by one of the arg values)
845  $args = func_get_args();
846  if (!empty($args)) {
847  $field_list = $args;
848  $metadata = drush_get_command_format_metadata('core-status');
849  foreach ($metadata['field-labels'] as $field_key => $field_label) {
850  if (_drush_core_is_named_in_array($field_label, $args)) {
851  $field_list[] = $field_key;
852  }
853  }
854  foreach ($status_table as $key => $value) {
855  if (!_drush_core_is_named_in_array($key, $field_list)) {
856  unset($status_table[$key]);
857  }
858  }
859  }
860  return $status_table;
861 }
862 
863 // Command callback. Show all global options. Exposed via topic command.
864 function drush_core_global_options() {
865  drush_print(dt('These options are applicable to most drush commands. Most options can be disabled by using --no-option (i.e. --no-debug to disable --debug.)'));
866  drush_print();
867  $fake = drush_global_options_command(FALSE);
868  return drush_format_help_section($fake, 'options');
869 }
870 
871 function _drush_core_is_named_in_array($key, $the_array) {
872  $is_named = FALSE;
873 
874  $simplified_key = str_replace(array(' ', '_', '-'), array('', '', ''), $key);
875 
876  foreach ($the_array as $name) {
877  if (stristr($simplified_key, str_replace(array(' ', '_', '-'), array('', '', ''), $name))) {
878  $is_named = TRUE;
879  }
880  }
881 
882  return $is_named;
883 }
884 
885 /**
886  * Callback for core-quick-drupal command.
887  */
889  $requests = FALSE;
890  $make_projects = array();
891  $args = func_get_args();
892  $name = drush_get_option('use-name');
893  drush_set_option('backend', TRUE);
894  drush_set_option('strict', FALSE); // We fail option validation because do so much internal drush_invoke().
895  $makefile = drush_get_option('makefile');
896  $root = \Drush::bootstrapManager()->getRoot();
897  if (drush_get_option('use-existing', ($root != FALSE))) {
898  if (!$root) {
899  return drush_set_error('QUICK_DRUPAL_NO_ROOT_SPECIFIED', 'Must specify site with --root when using --use-existing.');
900  }
901  // If a --db-url was not explicitly provided, and if there is already
902  // a settings.php file provided, then use the db-url defined inside it.
903  if (!drush_get_option('db-url', FALSE)) {
904  $values = drush_invoke_process('@self', 'site-alias', array('@self'), array('with-db-url' => TRUE), array('integrate' => FALSE, 'override-simulated' => TRUE));
905  if (!empty($values['object']['self']['db-url'])) {
906  drush_set_option('db-url', $values['object']['self']['db-url']);
907  }
908  }
909  if (empty($name)) {
910  $name = basename($root);
911  }
912  $base = dirname($root);
913  }
914  else {
915  if (!empty($args) && empty($name)) {
916  $name = array_shift($args);
917  }
918  if (empty($name)) {
919  $name = 'quick-drupal-' . gmdate('YmdHis', $_SERVER['REQUEST_TIME']);
920  }
921  $root = drush_get_option('root', FALSE);
922  $core = drush_get_option('core', 'drupal');
923  $project_rename = $core;
924  if ($root) {
925  $base = dirname($root);
926  $project_rename = basename($root);
927  }
928  else {
929  $base = getcwd() . '/' . $name;
930  $root = $base . '/' . $core;
931  }
932  if (!empty($makefile)) {
933  // Invoke 'drush make $makefile'.
934  $result = drush_invoke_process('@none', 'make', array($makefile, $root), array('core-quick-drupal' => TRUE));
935  if ($result['error_status'] != 0) {
936  return drush_set_error('DRUSH_QD_MAKE', 'Could not make; aborting.');
937  }
938  $make_projects = array_diff(array_keys($result['object']['projects']), array('drupal'));
939  }
940  else {
941  drush_mkdir($base);
942  drush_set_option('destination', $base);
943  drush_set_option('drupal-project-rename', $project_rename);
944  if (drush_invoke('pm-download', array($core)) === FALSE) {
945  return drush_set_error('QUICK_DRUPAL_CORE_DOWNLOAD_FAIL', 'Drupal core download/extract failed.');
946  }
947  }
948  }
949  if (!drush_get_option('db-url', FALSE)) {
950  drush_set_option('db-url', 'sqlite://sites/' . strtolower(drush_get_option('sites-subdir', 'default')) . "/files/$name.sqlite");
951  }
952  // We have just created a site root where one did not exist before.
953  // We therefore must manually reset the selected root to
954  // our new root, and force a bootstrap to DRUSH_BOOTSTRAP_DRUPAL_ROOT.
955  \Drush::bootstrapManager()->setRoot($root);
956  if (!drush_bootstrap_to_phase(DRUSH_BOOTSTRAP_DRUPAL_ROOT)) {
957  return drush_set_error('QUICK_DRUPAL_ROOT_LOCATE_FAIL', 'Unable to locate Drupal root directory.');
958  }
959  if (!empty($args)) {
960  $requests = pm_parse_arguments($args, FALSE);
961  }
962  if ($requests) {
963  // Unset --destination, so that downloads go to the site directories.
964  drush_unset_option('destination');
965  if (drush_invoke('pm-download', $requests) === FALSE) {
966  return drush_set_error('QUICK_DRUPAL_PROJECT_DOWNLOAD_FAIL', 'Project download/extract failed.');
967  }
968  }
969  drush_invoke('site-install', array(drush_get_option('profile')));
970  // Log in with the admin user.
971  // TODO: If site-install is given a sites-subdir other than 'default',
972  // then it will bootstrap to DRUSH_BOOTSTRAP_DRUPAL_SITE get the installer
973  // to recognize the desired site directory. This somehow interferes
974  // with our desire to bootstrap to DRUSH_BOOTSTRAP_DRUPAL_LOGIN here.
975  // We could do the last few steps in a new process if uri is not 'default'.
976  drush_set_option('user', '1');
977  if (!drush_bootstrap_to_phase(DRUSH_BOOTSTRAP_DRUPAL_LOGIN)) {
978  return drush_set_error('QUICK_DRUPAL_INSTALL_FAIL', 'Drupal core install failed.');
979  }
980  $enable = array_merge(pm_parse_arguments(drush_get_option('enable', $requests)), $make_projects);
981  if (!empty($enable)) {
982  if (drush_invoke('pm-enable', $enable) === FALSE) {
983  return drush_set_error('QUICK_DRUPAL_PROJECT_ENABLE_FAIL', 'Project enable failed.');
984  }
985  }
986  $server = drush_get_option('server', '/');
987  if ($server) {
988  $server_uri = runserver_uri($server);
989  _drush_core_qd_cache_uri($server_uri);
990  }
991  if (!drush_get_option('no-server', FALSE)) {
992  if ($server) {
993  // Current CLI user is also the web server user, which is for development
994  // only. Hence we can safely make the site directory writable. This makes
995  // it easier to delete and edit settings.php.
996  $boot = \Drush::bootstrap();
997  @chmod($boot->conf_path(), 0700);
998  drush_invoke_process(array('root' => $root, 'uri' => $server_uri), 'runserver', array($server));
999  }
1000  }
1001  else {
1002  drush_print(dt('Login URL: ') . drush_invoke('user-login'));
1003  }
1004 }
1005 
1006 // Write a drushrc.php to cache the server information for future Drush calls
1007 function _drush_core_qd_cache_uri($uri) {
1008  $server = $uri['host'];
1009  if (!empty($uri["port"])) {
1010  $server .= ':' . $uri["port"];
1011  }
1012  $dir = DRUPAL_ROOT . '/drush';
1013  $target_file = $dir . '/drushrc.php';
1014  drush_log(dt("Caching 'uri' !uri in !target", array('!uri' => $server, '!target' => $target_file)), LogLevel::OK);
1015  $create_file = TRUE;
1016  if (file_exists($target_file)) {
1017  // Don't bother to ask with --use-existing; just
1018  // continue.
1019  if (drush_get_option('use-existing', FALSE)) {
1020  $create_file = FALSE;
1021  }
1022  else {
1023  $create_file = drush_confirm(dt('!target already exists. Overwrite?', array('!target' => $target_file)));
1024  }
1025  }
1026  $content = <<<EOT
1027 <?php
1028 
1029 // Inserted by `drush quick-drupal`. This allows `drush user-login`
1030 // and similar commands to work seemlessly. Remove if using
1031 // Drupal multisite feature.
1032 \$options['uri'] = "$server";
1033 EOT;
1034  if ($create_file) {
1035  drush_mkdir($dir);
1036  file_put_contents($target_file, $content);
1037  }
1038 }
1039 
1040 /**
1041  * Include options and engines for core-quick-drupal command, aggregated from
1042  * other command options that are available. We prefix option descriptons,
1043  * to make the long list more navigable.
1044  *
1045  * @param $items
1046  * The core commandfile command array, by reference. Used to include
1047  * site-install options and add options and engines for core-quick-drupal.
1048  */
1050  $options = array(
1051  'core' => 'Drupal core to download. Defaults to "drupal" (latest stable version).',
1052  'use-existing' => 'Use an existing Drupal root, specified with --root. Overrides --core. Defaults to true when run from an existing site.',
1053  'profile' => 'The install profile to use. Defaults to standard.',
1054  'enable' => 'Specific extensions (modules or themes) to enable. By default, extensions with the same name as requested projects will be enabled automatically.',
1055  'server' => 'Host IP address and port number to bind to and path to open in web browser (hyphen to clear a default path), all elements optional. See runserver examples for shorthand.',
1056  'no-server' => 'Avoid starting runserver (and browser) for the created Drupal site.',
1057  'browser' => 'Optional name of a browser to open site in. If omitted the OS default browser will be used. Set --no-browser to disable.',
1058  'use-name' => array('hidden' => TRUE, 'description' => 'Overrides "name" argument.'),
1059  'makefile' => array('description' => 'Makefile to use. Makefile must specify which version of Drupal core to build.', 'example-value' => 'mysite.make', 'value' => 'optional'),
1060  'root' => array('description' => 'Path to Drupal root.', 'example-value' => '/path/to/root', 'value' => 'optional'),
1061  );
1062  $pm = pm_drush_command();
1063  foreach ($pm['pm-download']['options'] as $option => $description) {
1064  if (is_array($description)) {
1065  $description = $description['description'];
1066  }
1067  $options[$option] = 'Download option: ' . $description;
1068  }
1069  // Unset a few options that are not usable here, as we control them ourselves
1070  // or they are otherwise implied by the environment.
1071  unset($options['destination']);
1072  unset($options['drupal-project-rename']);
1073  unset($options['default-major']);
1074  unset($options['use-site-dir']);
1076  foreach ($si['site-install']['options'] as $option => $description) {
1077  if (is_array($description)) {
1078  $description = $description['description'];
1079  }
1080  $options[$option] = 'Site install option: ' . $description;
1081  }
1082  unset($options['sites-subdir']);
1083  $runserver = runserver_drush_command();
1084  foreach ($runserver['runserver']['options'] as $option => $description) {
1085  $options[$option] = 'Runserver option: ' . $description;
1086  }
1087  unset($options['user']);
1088  $items['core-quick-drupal']['options'] = $options;
1089  $items['core-quick-drupal']['engines'] = $pm['pm-download']['engines'];
1090 }
1091 
1092 /**
1093  * Command callback. Runs "naked" php scripts
1094  * and drush "shebang" scripts ("#!/usr/bin/env drush").
1095  */
1097  $found = FALSE;
1098  $script = NULL;
1099  if ($args = func_get_args()) {
1100  $script = $args[0];
1101  }
1102 
1103  if ($script == '-') {
1104  return eval(stream_get_contents(STDIN));
1105  }
1106  elseif (file_exists($script)) {
1107  $found = $script;
1108  }
1109  else {
1110  // Array of paths to search for scripts
1111  $searchpath['cwd'] = drush_cwd();
1112 
1113  // Additional script paths, specified by 'script-path' option
1114  if ($script_path = drush_get_option('script-path', FALSE)) {
1115  foreach (explode(PATH_SEPARATOR, $script_path) as $path) {
1116  $searchpath[] = $path;
1117  }
1118  }
1119  drush_log(dt('Searching for scripts in ') . implode(',', $searchpath), LogLevel::DEBUG);
1120 
1121  if (!isset($script)) {
1122  // List all available scripts.
1123  $all = array();
1124  foreach($searchpath as $key => $path) {
1125  $recurse = !(($key == 'cwd') || ($path == '/'));
1126  $all = array_merge( $all , array_keys(drush_scan_directory($path, '/\.php$/', array('.', '..', 'CVS'), NULL, $recurse)) );
1127  }
1128  drush_print(implode("\n", $all));
1129  }
1130  else {
1131  // Execute the specified script.
1132  foreach($searchpath as $path) {
1133  $script_filename = $path . '/' . $script;
1134  if (file_exists($script_filename . '.php')) {
1135  $script_filename .= '.php';
1136  }
1137  if (file_exists($script_filename)) {
1138  $found = $script_filename;
1139  break;
1140  }
1141  $all[] = $script_filename;
1142  }
1143  if (!$found) {
1144  return drush_set_error('DRUSH_TARGET_NOT_FOUND', dt('Unable to find any of the following: @files', array('@files' => implode(', ', $all))));
1145  }
1146  }
1147  }
1148 
1149  if ($found) {
1150  // Set the DRUSH_SHIFT_SKIP to two; this will cause
1151  // drush_shift to skip the next two arguments the next
1152  // time it is called. This allows scripts to get all
1153  // arguments, including the 'php-script' and script
1154  // pathname, via drush_get_arguments(), or it can process
1155  // just the arguments that are relevant using drush_shift().
1156  drush_set_context('DRUSH_SHIFT_SKIP', 2);
1157  if (_drush_core_eval_shebang_script($found) === FALSE) {
1158  return include($found);
1159  }
1160  }
1161 }
1162 
1163 function drush_core_php_eval($php) {
1164  return eval($php . ';');
1165 }
1166 
1167 /**
1168  * Evaluate a script that begins with #!drush php-script
1169  */
1170 function _drush_core_eval_shebang_script($script_filename) {
1171  $found = FALSE;
1172  $fp = fopen($script_filename, "r");
1173  if ($fp !== FALSE) {
1174  $line = fgets($fp);
1175  if (_drush_is_drush_shebang_line($line)) {
1176  $first_script_line = '';
1177  while ($line = fgets($fp)) {
1178  $line = trim($line);
1179  if ($line == '<?php') {
1180  $found = TRUE;
1181  break;
1182  }
1183  elseif (!empty($line)) {
1184  $first_script_line = $line . "\n";
1185  break;
1186  }
1187  }
1188  $script = stream_get_contents($fp);
1189  // Pop off the first two arguments, the
1190  // command (php-script) and the path to
1191  // the script to execute, as a service
1192  // to the script.
1193  eval($first_script_line . $script);
1194  $found = TRUE;
1195  }
1196  fclose($fp);
1197  }
1198  return $found;
1199 }
1200 
1201 /**
1202  * Command callback. Process sets from the specified batch.
1203  *
1204  * This is the default batch processor that will be used if the $command parameter
1205  * to drush_backend_batch_process() has not been specified.
1206  */
1208  drush_batch_command($id);
1209 }
1210 
1211 /**
1212  * Command callback. Process outstanding updates during updatedb.
1213  *
1214  * This is a batch processing command that makes use of the drush_backend_invoke
1215  * api.
1216  *
1217  * This command includes the version specific update engine, which correctly
1218  * initialises the environment to be able to successfully handle minor and major
1219  * upgrades.
1220  */
1222  drush_include_engine('drupal', 'update');
1223  _update_batch_command($id);
1224 }
1225 
1226 /**
1227  * Given a target (e.g. @site:%modules), return the evaluated directory path.
1228  *
1229  * @param $target
1230  * The target to evaluate. Can be @site or /path or @site:path
1231  * or @site:%pathalias, etc. (just like rsync parameters)
1232  * @param $component
1233  * The portion of the evaluated path to return. Possible values:
1234  * 'path' - the full path to the target (default)
1235  * 'name' - the name of the site from the path (e.g. @site1)
1236  * 'user-path' - the part after the ':' (e.g. %modules)
1237  * 'root' & 'uri' - the Drupal root and URI of the site from the path
1238  * 'path-component' - The ':' and the path
1239  */
1240 function _drush_core_directory($target = 'root', $component = 'path', $local_only = FALSE) {
1241  // Normalize to a sitealias in the target.
1242  $normalized_target = $target;
1243  if (strpos($target, ':') === FALSE) {
1244  if (substr($target, 0, 1) != '@') {
1245  // drush_sitealias_evaluate_path() requires bootstrap to database.
1246  if (!drush_bootstrap_to_phase(DRUSH_BOOTSTRAP_DRUPAL_DATABASE)) {
1247  return drush_set_error('DRUPAL_SITE_NOT_FOUND', dt('You need to specify an alias or run this command within a drupal site.'));
1248  }
1249  $normalized_target = '@self:';
1250  if (substr($target, 0, 1) != '%') {
1251  $normalized_target .= '%';
1252  }
1253  $normalized_target .= $target;
1254  }
1255  }
1256  $additional_options = array();
1257  $values = drush_sitealias_evaluate_path($normalized_target, $additional_options, $local_only);
1258  if (isset($values[$component])) {
1259  // Hurray, we found the destination.
1260  return $values[$component];
1261  }
1262 }
1263 
1264 /**
1265  * Command callback.
1266  */
1267 function drush_core_drupal_directory($target = 'root') {
1268  $path = _drush_core_directory($target, drush_get_option('component', 'path'), drush_get_option('local-only', FALSE));
1269 
1270  // If _drush_core_directory is working right, it will turn
1271  // %blah into the path to the item referred to by the key 'blah'.
1272  // If there is no such key, then no replacement is done. In the
1273  // case of the dd command, we will consider it an error if
1274  // any keys are -not- replaced in _drush_core_directory.
1275  if ($path && (strpos($path, '%') === FALSE)) {
1276  return $path;
1277  }
1278  else {
1279  return drush_set_error('DRUSH_TARGET_NOT_FOUND', dt("Target '!target' not found.", array('!target' => $target)));
1280  }
1281 }
1282 
1283 /**
1284  * Called for `drush version` or `drush --version`
1285  */
1287  return Drush::getVersion();
1288 }
1289 
1290 /**
1291  * Command callback. Execute specified shell code. Often used by shell aliases
1292  * that start with !.
1293  */
1295  $result = TRUE;
1296  $escape = drush_get_option('escape', TRUE);
1297  // Get all of the args and options that appear after the command name.
1299  if ($escape) {
1300  for ($x = 0; $x < count($args); $x++) {
1301  // escape all args except for command separators.
1302  if (!in_array($args[$x], array('&&', '||', ';'))) {
1303  $args[$x] = drush_escapeshellarg($args[$x]);
1304  }
1305  }
1306  }
1307  $cmd = implode(' ', $args);
1308  // If we selected a Drupal site, then cwd to the site root prior to exec
1309  $cwd = FALSE;
1310  if ($selected_root = \Drush::bootstrapManager()->getRoot()) {
1311  if (is_dir($selected_root)) {
1312  $cwd = getcwd();
1313  drush_op('chdir', $selected_root);
1314  }
1315  }
1316  if ($alias = drush_get_context('DRUSH_TARGET_SITE_ALIAS')) {
1317  $site = drush_sitealias_get_record($alias);
1318  if (!empty($site['site-list'])) {
1319  $sites = drush_sitealias_resolve_sitelist($site);
1320  foreach ($sites as $site_name => $site_spec) {
1321  $result = _drush_core_execute_cmd($site_spec, $cmd);
1322  if (!$result) {
1323  break;
1324  }
1325  }
1326  }
1327  else {
1328  $result = _drush_core_execute_cmd($site, $cmd);
1329  }
1330  }
1331  else {
1332  // Must be a local command.
1333  $result = (drush_shell_proc_open($cmd) == 0);
1334  }
1335  // Restore the cwd if we changed it
1336  if ($cwd) {
1337  drush_op('chdir', $selected_root);
1338  }
1339  if (!$result) {
1340  return drush_set_error('CORE_EXECUTE_FAILED', dt("Command !command failed.", array('!command' => $cmd)));
1341  }
1342  return $result;
1343 }
1344 
1345 function drush_core_twig_compile() {
1346  require_once DRUSH_DRUPAL_CORE . "/themes/engines/twig/twig.engine";
1347  // Scan all enabled modules and themes.
1348  // @todo refactor since \Drush\Boot\DrupalBoot::commandfile_searchpaths is similar.
1349  $ignored_modules = drush_get_option_list('ignored-modules', array());
1350  $cid = drush_cid_install_profile();
1351  if ($cached = drush_cache_get($cid)) {
1352  $ignored_modules[] = $cached->data;
1353  }
1354  foreach (array_diff(drush_module_list(), $ignored_modules) as $module) {
1355  $searchpaths[] = drupal_get_path('module', $module);
1356  }
1357 
1358  $themes = drush_theme_list();
1359  foreach ($themes as $name => $theme) {
1360  $searchpaths[] = $theme->getPath();
1361  }
1362 
1363  foreach ($searchpaths as $searchpath) {
1364  foreach ($file = drush_scan_directory($searchpath, '/\.html.twig/', array('tests')) as $file) {
1365  $relative = str_replace(drush_get_context('DRUSH_DRUPAL_ROOT'). '/', '', $file->filename);
1366  // @todo Dynamically disable twig debugging since there is no good info there anyway.
1367  twig_render_template($relative, array('theme_hook_original' => ''));
1368  drush_log(dt('Compiled twig template !path', array('!path' => $relative)), LogLevel::INFO);
1369  }
1370  }
1371 }
1372 
1373 /**
1374  * Helper function for drush_core_execute: run one shell command
1375  */
1376 function _drush_core_execute_cmd($site, $cmd) {
1377  if (!empty($site['remote-host'])) {
1378  // Remote, so execute an ssh command with a bash fragment at the end.
1379  $exec = drush_shell_proc_build($site, $cmd, TRUE);
1380  return (drush_shell_proc_open($exec) == 0);
1381  }
1382  elseif (!empty($site['root']) && is_dir($site['root'])) {
1383  return (drush_shell_proc_open('cd ' . drush_escapeshellarg($site['root']) . ' && ' . $cmd) == 0);
1384  }
1385  return (drush_shell_proc_open($cmd) == 0);
1386 }

File

doxygen/html/core_8drush_8inc_source.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: commands/core/core.drush.inc Source File</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="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li><a href="examples.html"><span>Examples</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 id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>File&#160;Members</span></a></li>
    </ul>
  </div>
<!-- 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>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Groups</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><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 id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_afac61274991793aa7e9133a8f4f291e.html">commands</a></li><li class="navelem"><a class="el" href="dir_5762b63965e3a68a35f77c23b4dd4668.html">core</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">core.drush.inc</div>  </div>
</div><!--header-->
<div class="contents">
<a href="core_8drush_8inc.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;&lt;?php</div>
<div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="comment">/**</span></div>
<div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment"> * @file</span></div>
<div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment"> *   Core drush commands.</span></div>
<div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;</div>
<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;use <a class="code" href="classDrush_1_1Log_1_1LogLevel.html">Drush\Log\LogLevel</a>;</div>
<div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;use SebastianBergmann\Version;</div>
<div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="comment">/**</span></div>
<div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="comment"> * Implementation of hook_drush_help().</span></div>
<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="comment"> * This function is called whenever a drush user calls</span></div>
<div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="comment"> * &#39;drush help &lt;name-of-your-command&gt;&#39;</span></div>
<div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="comment"> * @param</span></div>
<div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;<span class="comment"> *   A string with the help section (prepend with &#39;drush:&#39;)</span></div>
<div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;<span class="comment"> * @return</span></div>
<div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;<span class="comment"> *   A string with the help text for your command.</span></div>
<div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l00023"></a><span class="lineno"><a class="code" href="core_8drush_8inc.html#ad4ed1158e83087bfd104da99a6ffea96">   23</a></span>&#160;<span class="keyword">function</span> <a class="code" href="core_8drush_8inc.html#ad4ed1158e83087bfd104da99a6ffea96">core_drush_help</a>($section) {</div>
<div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;  <span class="keywordflow">switch</span> ($section) {</div>
<div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;    <span class="keywordflow">case</span> <span class="stringliteral">&#39;meta:core:title&#39;</span>:</div>
<div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;      <span class="keywordflow">return</span> <a class="code" href="group__outputfunctions.html#ga1218abcb1e27dd3bb412113d1e344d96">dt</a>(<span class="stringliteral">&quot;Core Drush commands&quot;</span>);</div>
<div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;    <span class="keywordflow">case</span> <span class="stringliteral">&#39;drush:php-script&#39;</span>:</div>
<div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;      <span class="keywordflow">return</span> <a class="code" href="group__outputfunctions.html#ga1218abcb1e27dd3bb412113d1e344d96">dt</a>(<span class="stringliteral">&quot;Runs the given php script(s) after a full Drupal bootstrap. A useful alternative to eval command when your php is lengthy or you can&#39;t be bothered to figure out bash quoting. If you plan to share a script with others, consider making a full drush command instead, since that&#39;s more self-documenting.  Drush provides commandline options to the script via drush_get_option(&#39;option-name&#39;), and commandline arguments can be accessed either via drush_get_arguments(), which returns all arguments in an array, or drush_shift(), which removes the next argument from the list and returns it.&quot;</span>);</div>
<div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;    <span class="keywordflow">case</span> <span class="stringliteral">&#39;drush:rsync&#39;</span>:</div>
<div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;      <span class="keywordflow">return</span> <a class="code" href="group__outputfunctions.html#ga1218abcb1e27dd3bb412113d1e344d96">dt</a>(<span class="stringliteral">&quot;Sync the entire drupal directory or a subdirectory to a &lt;destination&gt; using ssh. Excludes reserved files and directories for supported VCSs. Useful for pushing copies of your tree to a staging server, or retrieving a files directory from a remote site. Relative paths start from the Drupal root directory if a site alias is used; otherwise they start from the current working directory.&quot;</span>);</div>
<div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;    <span class="keywordflow">case</span> <span class="stringliteral">&#39;error:DRUSH_DRUPAL_DB_ERROR&#39;</span>:</div>
<div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;      $message = <a class="code" href="group__outputfunctions.html#ga1218abcb1e27dd3bb412113d1e344d96">dt</a>(<span class="stringliteral">&quot;Drush was not able to start (bootstrap) the Drupal database.\n&quot;</span>);</div>
<div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;      $message .= <a class="code" href="group__outputfunctions.html#ga1218abcb1e27dd3bb412113d1e344d96">dt</a>(<span class="stringliteral">&quot;Hint: This may occur when Drush is trying to:\n&quot;</span>);</div>
<div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;      $message .= <a class="code" href="group__outputfunctions.html#ga1218abcb1e27dd3bb412113d1e344d96">dt</a>(<span class="stringliteral">&quot; * bootstrap a site that has not been installed or does not have a configured database. In this case you can select another site with a working database setup by specifying the URI to use with the --uri parameter on the command line. See `drush topic docs-aliases` for details.\n&quot;</span>);</div>
<div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;      $message .= <a class="code" href="group__outputfunctions.html#ga1218abcb1e27dd3bb412113d1e344d96">dt</a>(<span class="stringliteral">&quot; * connect the database through a socket. The socket file may be wrong or the php-cli may have no access to it in a jailed shell. See http://drupal.org/node/1428638 for details.\n&quot;</span>);</div>
<div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;      $message .= <a class="code" href="group__outputfunctions.html#ga1218abcb1e27dd3bb412113d1e344d96">dt</a>(<span class="stringliteral">&quot;\nDrush was attempting to connect to: \n!credentials\n&quot;</span>, array(<span class="stringliteral">&#39;!credentials&#39;</span> =&gt; _core_site_credentials(12)));</div>
<div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;      <span class="keywordflow">return</span> $message;</div>
<div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;    <span class="keywordflow">case</span> <span class="stringliteral">&#39;error:DRUSH_DRUPAL_BOOTSTRAP_ERROR&#39;</span>:</div>
<div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;      $message = <a class="code" href="group__outputfunctions.html#ga1218abcb1e27dd3bb412113d1e344d96">dt</a>(<span class="stringliteral">&quot;Drush was not able to start (bootstrap) Drupal.\n&quot;</span>);</div>
<div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;      $message .= <a class="code" href="group__outputfunctions.html#ga1218abcb1e27dd3bb412113d1e344d96">dt</a>(<span class="stringliteral">&quot;Hint: This error can only occur once the database connection has already been successfully initiated, therefore this error generally points to a site configuration issue, and not a problem connecting to the database.\n&quot;</span>);</div>
<div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;      $message .= <a class="code" href="group__outputfunctions.html#ga1218abcb1e27dd3bb412113d1e344d96">dt</a>(<span class="stringliteral">&quot;\nDrush was attempting to connect to: \n!credentials\n&quot;</span>, array(<span class="stringliteral">&#39;!credentials&#39;</span> =&gt; _core_site_credentials(12)));</div>
<div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;      <span class="keywordflow">return</span> $message;</div>
<div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;      <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;  }</div>
<div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;}</div>
<div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;<span class="comment">/**</span></div>
<div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;<span class="comment"> * Implements hook_drush_help_alter().</span></div>
<div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l00050"></a><span class="lineno"><a class="code" href="core_8drush_8inc.html#aa7aa6f69820e89d99bc63941c0c4d50a">   50</a></span>&#160;<span class="keyword">function</span> <a class="code" href="core_8drush_8inc.html#aa7aa6f69820e89d99bc63941c0c4d50a">core_drush_help_alter</a>(&amp;$command) {</div>
<div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;  <span class="comment">// Drupal 8+ only options.</span></div>
<div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;  <span class="keywordflow">if</span> (<a class="code" href="drupal_8inc.html#ad2ccab77d4bc8e7355186f26cd328ac0">drush_drupal_major_version</a>() &lt; 8) {</div>
<div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;    <span class="keywordflow">if</span> ($command[<span class="stringliteral">&#39;commandfile&#39;</span>] == <span class="stringliteral">&#39;core&#39;</span> &amp;&amp; $command[<span class="stringliteral">&#39;command&#39;</span>] == <span class="stringliteral">&#39;updatedb&#39;</span>) {</div>
<div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;      unset($command[<span class="stringliteral">&#39;options&#39;</span>][<span class="stringliteral">&#39;entity-updates&#39;</span>]);</div>
<div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;    }</div>
<div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;  }</div>
<div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;}</div>
<div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;<span class="comment">/**</span></div>
<div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;<span class="comment"> * Implementation of hook_drush_command().</span></div>
<div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;<span class="comment"> * In this hook, you specify which commands your</span></div>
<div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;<span class="comment"> * drush module makes available, what it does and</span></div>
<div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;<span class="comment"> * description.</span></div>
<div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;<span class="comment"> * Notice how this structure closely resembles how</span></div>
<div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;<span class="comment"> * you define menu hooks.</span></div>
<div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;<span class="comment"> * @return</span></div>
<div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;<span class="comment"> *   An associative array describing your command(s).</span></div>
<div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l00072"></a><span class="lineno"><a class="code" href="core_8drush_8inc.html#a77d0c92afc27091badfbb0995b1ac19c">   72</a></span>&#160;<span class="keyword">function</span> <a class="code" href="core_8drush_8inc.html#a77d0c92afc27091badfbb0995b1ac19c">core_drush_command</a>() {</div>
<div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;  $items = array();</div>
<div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;</div>
<div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;  $items[<span class="stringliteral">&#39;version&#39;</span>] = array(</div>
<div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;    <span class="stringliteral">&#39;description&#39;</span> =&gt; <span class="stringliteral">&#39;Show drush version.&#39;</span>,</div>
<div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;    <span class="stringliteral">&#39;bootstrap&#39;</span> =&gt; DRUSH_BOOTSTRAP_NONE, <span class="comment">// No bootstrap.</span></div>
<div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;    <span class="stringliteral">&#39;options&#39;</span> =&gt; array(</div>
<div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;      <span class="stringliteral">&#39;pipe&#39;</span> =&gt; <span class="stringliteral">&#39;Print just the version number, and nothing else.&#39;</span>,</div>
<div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;    ),</div>
<div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;    <span class="stringliteral">&#39;outputformat&#39;</span> =&gt; array(</div>
<div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;      <span class="stringliteral">&#39;default&#39;</span> =&gt; <span class="stringliteral">&#39;key-value&#39;</span>,</div>
<div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;      <span class="stringliteral">&#39;pipe-format&#39;</span> =&gt; <span class="stringliteral">&#39;string&#39;</span>,</div>
<div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;      <span class="stringliteral">&#39;label&#39;</span> =&gt; <span class="stringliteral">&#39;Drush Version&#39;</span>,</div>
<div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;      <span class="stringliteral">&#39;output-data-type&#39;</span> =&gt; <span class="stringliteral">&#39;format-single&#39;</span>,</div>
<div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;    ),</div>
<div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;  );</div>
<div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;  $items[<span class="stringliteral">&#39;core-cron&#39;</span>] = array(</div>
<div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;    <span class="stringliteral">&#39;description&#39;</span> =&gt; <span class="stringliteral">&#39;Run all cron hooks in all active modules for specified site.&#39;</span>,</div>
<div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;    <span class="stringliteral">&#39;aliases&#39;</span> =&gt; array(<span class="stringliteral">&#39;cron&#39;</span>),</div>
<div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;    <span class="stringliteral">&#39;topics&#39;</span> =&gt; array(<span class="stringliteral">&#39;docs-cron&#39;</span>),</div>
<div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;  );</div>
<div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;  $items[<span class="stringliteral">&#39;updatedb&#39;</span>] = array(</div>
<div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;    <span class="stringliteral">&#39;description&#39;</span> =&gt; <span class="stringliteral">&#39;Apply any database updates required (as with running update.php).&#39;</span>,</div>
<div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160;    <span class="stringliteral">&#39;bootstrap&#39;</span> =&gt; DRUSH_BOOTSTRAP_DRUPAL_SITE,</div>
<div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;    <span class="stringliteral">&#39;global-options&#39;</span> =&gt; array(</div>
<div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;      <span class="stringliteral">&#39;cache-clear&#39;</span>,</div>
<div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160;    ),</div>
<div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;    <span class="stringliteral">&#39;options&#39;</span> =&gt; array(</div>
<div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;      <span class="stringliteral">&#39;entity-updates&#39;</span> =&gt; <span class="stringliteral">&#39;Run automatic entity schema updates at the end of any update hooks. Defaults to --no-entity-updates.&#39;</span>,</div>
<div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;    ),</div>
<div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;    <span class="stringliteral">&#39;aliases&#39;</span> =&gt; array(<span class="stringliteral">&#39;updb&#39;</span>),</div>
<div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;  );</div>
<div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160;  $items[<span class="stringliteral">&#39;entity-updates&#39;</span>] = array(</div>
<div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;    <span class="stringliteral">&#39;description&#39;</span> =&gt; <span class="stringliteral">&#39;Apply pending entity schema updates.&#39;</span>,</div>
<div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;    <span class="stringliteral">&#39;aliases&#39;</span> =&gt; array(<span class="stringliteral">&#39;entup&#39;</span>),</div>
<div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;    <span class="stringliteral">&#39;bootstrap&#39;</span> =&gt; DRUSH_BOOTSTRAP_DRUPAL_FULL,</div>
<div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;    <span class="stringliteral">&#39;core&#39;</span> =&gt; array(<span class="stringliteral">&#39;8+&#39;</span>),</div>
<div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;  );</div>
<div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160;  $items[<span class="stringliteral">&#39;twig-compile&#39;</span>] = array(</div>
<div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;    <span class="stringliteral">&#39;description&#39;</span> =&gt; <span class="stringliteral">&#39;Compile all Twig template(s).&#39;</span>,</div>
<div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160;    <span class="stringliteral">&#39;aliases&#39;</span> =&gt; array(<span class="stringliteral">&#39;twigc&#39;</span>),</div>
<div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160;    <span class="stringliteral">&#39;core&#39;</span> =&gt; array(<span class="stringliteral">&#39;8+&#39;</span>),</div>
<div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160;  );</div>
<div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160;  $items[<span class="stringliteral">&#39;updatedb-status&#39;</span>] = array(</div>
<div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;    <span class="stringliteral">&#39;description&#39;</span> =&gt; <span class="stringliteral">&#39;List any pending database updates.&#39;</span>,</div>
<div class="line"><a name="l00117"></a><span class="lineno">  117</span>&#160;    <span class="stringliteral">&#39;outputformat&#39;</span> =&gt; array(</div>
<div class="line"><a name="l00118"></a><span class="lineno">  118</span>&#160;      <span class="stringliteral">&#39;default&#39;</span> =&gt; <span class="stringliteral">&#39;table&#39;</span>,</div>
<div class="line"><a name="l00119"></a><span class="lineno">  119</span>&#160;      <span class="stringliteral">&#39;pipe-format&#39;</span> =&gt; <span class="stringliteral">&#39;csv&#39;</span>,</div>
<div class="line"><a name="l00120"></a><span class="lineno">  120</span>&#160;      <span class="stringliteral">&#39;field-labels&#39;</span> =&gt; array(<span class="stringliteral">&#39;module&#39;</span> =&gt; <span class="stringliteral">&#39;Module&#39;</span>, <span class="stringliteral">&#39;update_id&#39;</span> =&gt; <span class="stringliteral">&#39;Update ID&#39;</span>, <span class="stringliteral">&#39;description&#39;</span> =&gt; <span class="stringliteral">&#39;Description&#39;</span>),</div>
<div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;      <span class="stringliteral">&#39;fields-default&#39;</span> =&gt; array(<span class="stringliteral">&#39;module&#39;</span>, <span class="stringliteral">&#39;update_id&#39;</span>, <span class="stringliteral">&#39;description&#39;</span>),</div>
<div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160;      <span class="stringliteral">&#39;output-data-type&#39;</span> =&gt; <span class="stringliteral">&#39;format-table&#39;</span>,</div>
<div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160;    ),</div>
<div class="line"><a name="l00124"></a><span class="lineno">  124</span>&#160;    <span class="stringliteral">&#39;aliases&#39;</span> =&gt; array(<span class="stringliteral">&#39;updbst&#39;</span>),</div>
<div class="line"><a name="l00125"></a><span class="lineno">  125</span>&#160;  );</div>
<div class="line"><a name="l00126"></a><span class="lineno">  126</span>&#160;  $items[<span class="stringliteral">&#39;core-config&#39;</span>] = array(</div>
<div class="line"><a name="l00127"></a><span class="lineno">  127</span>&#160;    <span class="stringliteral">&#39;description&#39;</span> =&gt; <span class="stringliteral">&#39;Edit drushrc, site alias, and Drupal settings.php files.&#39;</span>,</div>
<div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160;    <span class="stringliteral">&#39;bootstrap&#39;</span> =&gt; DRUSH_BOOTSTRAP_MAX,</div>
<div class="line"><a name="l00129"></a><span class="lineno">  129</span>&#160;    <span class="stringliteral">&#39;arguments&#39;</span> =&gt; array(</div>
<div class="line"><a name="l00130"></a><span class="lineno">  130</span>&#160;      <span class="stringliteral">&#39;filter&#39;</span> =&gt; <span class="stringliteral">&#39;A substring for filtering the list of files. Omit this argument to choose from loaded files.&#39;</span>,</div>
<div class="line"><a name="l00131"></a><span class="lineno">  131</span>&#160;    ),</div>
<div class="line"><a name="l00132"></a><span class="lineno">  132</span>&#160;    <span class="stringliteral">&#39;global-options&#39;</span> =&gt; array(<span class="stringliteral">&#39;editor&#39;</span>, <span class="stringliteral">&#39;bg&#39;</span>),</div>
<div class="line"><a name="l00133"></a><span class="lineno">  133</span>&#160;    <span class="stringliteral">&#39;examples&#39;</span> =&gt; array(</div>
<div class="line"><a name="l00134"></a><span class="lineno">  134</span>&#160;      <span class="stringliteral">&#39;drush core-config&#39;</span> =&gt; <span class="stringliteral">&#39;Pick from a list of config/alias/settings files. Open selected in editor.&#39;</span>,</div>
<div class="line"><a name="l00135"></a><span class="lineno">  135</span>&#160;      <span class="stringliteral">&#39;drush --bg core-config&#39;</span> =&gt; <span class="stringliteral">&#39;Return to shell prompt as soon as the editor window opens.&#39;</span>,</div>
<div class="line"><a name="l00136"></a><span class="lineno">  136</span>&#160;      <span class="stringliteral">&#39;drush core-config etc&#39;</span> =&gt; <span class="stringliteral">&#39;Edit the global configuration file.&#39;</span>,</div>
<div class="line"><a name="l00137"></a><span class="lineno">  137</span>&#160;      <span class="stringliteral">&#39;drush core-config demo.alia&#39;</span> =&gt; <span class="stringliteral">&#39;Edit a particular alias file.&#39;</span>,</div>
<div class="line"><a name="l00138"></a><span class="lineno">  138</span>&#160;      <span class="stringliteral">&#39;drush core-config sett&#39;</span> =&gt; <span class="stringliteral">&#39;Edit settings.php for the current Drupal site.&#39;</span>,</div>
<div class="line"><a name="l00139"></a><span class="lineno">  139</span>&#160;      <span class="stringliteral">&#39;drush core-config --choice=2&#39;</span> =&gt; <span class="stringliteral">&#39;Edit the second file in the choice list.&#39;</span>,</div>
<div class="line"><a name="l00140"></a><span class="lineno">  140</span>&#160;    ),</div>
<div class="line"><a name="l00141"></a><span class="lineno">  141</span>&#160;    <span class="stringliteral">&#39;aliases&#39;</span> =&gt; array(<span class="stringliteral">&#39;conf&#39;</span>, <span class="stringliteral">&#39;config&#39;</span>),</div>
<div class="line"><a name="l00142"></a><span class="lineno">  142</span>&#160;  );</div>
<div class="line"><a name="l00143"></a><span class="lineno">  143</span>&#160;  $items[<span class="stringliteral">&#39;core-status&#39;</span>] = array(</div>
<div class="line"><a name="l00144"></a><span class="lineno">  144</span>&#160;    <span class="stringliteral">&#39;description&#39;</span> =&gt; <span class="stringliteral">&#39;Provides a birds-eye view of the current Drupal installation, if any.&#39;</span>,</div>
<div class="line"><a name="l00145"></a><span class="lineno">  145</span>&#160;    <span class="stringliteral">&#39;bootstrap&#39;</span> =&gt; DRUSH_BOOTSTRAP_MAX,</div>
<div class="line"><a name="l00146"></a><span class="lineno">  146</span>&#160;    <span class="stringliteral">&#39;aliases&#39;</span> =&gt; array(<span class="stringliteral">&#39;status&#39;</span>, <span class="stringliteral">&#39;st&#39;</span>),</div>
<div class="line"><a name="l00147"></a><span class="lineno">  147</span>&#160;    <span class="stringliteral">&#39;examples&#39;</span> =&gt; array(</div>
<div class="line"><a name="l00148"></a><span class="lineno">  148</span>&#160;      <span class="stringliteral">&#39;drush core-status version&#39;</span> =&gt; <span class="stringliteral">&#39;Show all status lines that contain version information.&#39;</span>,</div>
<div class="line"><a name="l00149"></a><span class="lineno">  149</span>&#160;      <span class="stringliteral">&#39;drush core-status --pipe&#39;</span> =&gt; <span class="stringliteral">&#39;A list key=value items separated by line breaks.&#39;</span>,</div>
<div class="line"><a name="l00150"></a><span class="lineno">  150</span>&#160;      <span class="stringliteral">&#39;drush core-status drush-version --pipe&#39;</span> =&gt; <span class="stringliteral">&#39;Emit just the drush version with no label.&#39;</span>,</div>
<div class="line"><a name="l00151"></a><span class="lineno">  151</span>&#160;      <span class="stringliteral">&#39;drush core-status config-sync --pipe&#39;</span> =&gt; <span class="stringliteral">&#39;Emit just the sync Config directory with no label.&#39;</span>,</div>
<div class="line"><a name="l00152"></a><span class="lineno">  152</span>&#160;    ),</div>
<div class="line"><a name="l00153"></a><span class="lineno">  153</span>&#160;    <span class="stringliteral">&#39;arguments&#39;</span> =&gt; array(</div>
<div class="line"><a name="l00154"></a><span class="lineno">  154</span>&#160;      <span class="stringliteral">&#39;item&#39;</span> =&gt; <span class="stringliteral">&#39;Optional.  The status item line(s) to display.&#39;</span>,</div>
<div class="line"><a name="l00155"></a><span class="lineno">  155</span>&#160;    ),</div>
<div class="line"><a name="l00156"></a><span class="lineno">  156</span>&#160;    <span class="stringliteral">&#39;options&#39;</span> =&gt; array(</div>
<div class="line"><a name="l00157"></a><span class="lineno">  157</span>&#160;      <span class="stringliteral">&#39;show-passwords&#39;</span> =&gt; <span class="stringliteral">&#39;Show database password.  Defaults to --no-show-passwords.&#39;</span>,</div>
<div class="line"><a name="l00158"></a><span class="lineno">  158</span>&#160;      <span class="stringliteral">&#39;full&#39;</span> =&gt; <span class="stringliteral">&#39;Show all file paths and drush aliases in the report, even if there are a lot.&#39;</span>,</div>
<div class="line"><a name="l00159"></a><span class="lineno">  159</span>&#160;      <span class="stringliteral">&#39;project&#39;</span> =&gt; array(</div>
<div class="line"><a name="l00160"></a><span class="lineno">  160</span>&#160;        <span class="stringliteral">&#39;description&#39;</span> =&gt; <span class="stringliteral">&#39;One or more projects that should be added to the path list&#39;</span>,</div>
<div class="line"><a name="l00161"></a><span class="lineno">  161</span>&#160;        <span class="stringliteral">&#39;example-value&#39;</span> =&gt; <span class="stringliteral">&#39;foo,bar&#39;</span>,</div>
<div class="line"><a name="l00162"></a><span class="lineno">  162</span>&#160;      ),</div>
<div class="line"><a name="l00163"></a><span class="lineno">  163</span>&#160;    ),</div>
<div class="line"><a name="l00164"></a><span class="lineno">  164</span>&#160;    <span class="stringliteral">&#39;outputformat&#39;</span> =&gt; array(</div>
<div class="line"><a name="l00165"></a><span class="lineno">  165</span>&#160;      <span class="stringliteral">&#39;default&#39;</span> =&gt; <span class="stringliteral">&#39;key-value&#39;</span>,</div>
<div class="line"><a name="l00166"></a><span class="lineno">  166</span>&#160;      <span class="stringliteral">&#39;pipe-format&#39;</span> =&gt; <span class="stringliteral">&#39;json&#39;</span>,</div>
<div class="line"><a name="l00167"></a><span class="lineno">  167</span>&#160;      <span class="stringliteral">&#39;field-labels&#39;</span> =&gt; array(<span class="stringliteral">&#39;drupal-version&#39;</span> =&gt; <span class="stringliteral">&#39;Drupal version&#39;</span>, <span class="stringliteral">&#39;uri&#39;</span> =&gt; <span class="stringliteral">&#39;Site URI&#39;</span>, <span class="stringliteral">&#39;db-driver&#39;</span> =&gt; <span class="stringliteral">&#39;Database driver&#39;</span>, <span class="stringliteral">&#39;db-hostname&#39;</span> =&gt; <span class="stringliteral">&#39;Database hostname&#39;</span>, <span class="stringliteral">&#39;db-port&#39;</span> =&gt; <span class="stringliteral">&#39;Database port&#39;</span>, <span class="stringliteral">&#39;db-username&#39;</span> =&gt; <span class="stringliteral">&#39;Database username&#39;</span>, <span class="stringliteral">&#39;db-password&#39;</span> =&gt; <span class="stringliteral">&#39;Database password&#39;</span>, <span class="stringliteral">&#39;db-name&#39;</span> =&gt; <span class="stringliteral">&#39;Database name&#39;</span>, <span class="stringliteral">&#39;db-status&#39;</span> =&gt; <span class="stringliteral">&#39;Database&#39;</span>, <span class="stringliteral">&#39;bootstrap&#39;</span> =&gt; <span class="stringliteral">&#39;Drupal bootstrap&#39;</span>, <span class="stringliteral">&#39;user&#39;</span> =&gt; <span class="stringliteral">&#39;Drupal user&#39;</span>, <span class="stringliteral">&#39;theme&#39;</span> =&gt; <span class="stringliteral">&#39;Default theme&#39;</span>, <span class="stringliteral">&#39;admin-theme&#39;</span> =&gt; <span class="stringliteral">&#39;Administration theme&#39;</span>, <span class="stringliteral">&#39;php-bin&#39;</span> =&gt; <span class="stringliteral">&#39;PHP executable&#39;</span>, <span class="stringliteral">&#39;php-conf&#39;</span> =&gt; <span class="stringliteral">&#39;PHP configuration&#39;</span>, <span class="stringliteral">&#39;php-os&#39;</span> =&gt; <span class="stringliteral">&#39;PHP OS&#39;</span>, <span class="stringliteral">&#39;drush-script&#39;</span> =&gt; <span class="stringliteral">&#39;Drush script&#39;</span>, <span class="stringliteral">&#39;drush-version&#39;</span> =&gt; <span class="stringliteral">&#39;Drush version&#39;</span>, <span class="stringliteral">&#39;drush-temp&#39;</span> =&gt; <span class="stringliteral">&#39;Drush temp directory&#39;</span>, <span class="stringliteral">&#39;drush-conf&#39;</span> =&gt; <span class="stringliteral">&#39;Drush configuration&#39;</span>, <span class="stringliteral">&#39;drush-alias-files&#39;</span> =&gt; <span class="stringliteral">&#39;Drush alias files&#39;</span>, <span class="stringliteral">&#39;install-profile&#39;</span> =&gt; <span class="stringliteral">&#39;Install profile&#39;</span>, <span class="stringliteral">&#39;root&#39;</span> =&gt; <span class="stringliteral">&#39;Drupal root&#39;</span>, <span class="stringliteral">&#39;drupal-settings-file&#39;</span> =&gt; <span class="stringliteral">&#39;Drupal Settings File&#39;</span>, <span class="stringliteral">&#39;site-path&#39;</span> =&gt; <span class="stringliteral">&#39;Site path&#39;</span>, <span class="stringliteral">&#39;root&#39;</span> =&gt; <span class="stringliteral">&#39;Drupal root&#39;</span>, <span class="stringliteral">&#39;site&#39;</span> =&gt; <span class="stringliteral">&#39;Site path&#39;</span>, <span class="stringliteral">&#39;themes&#39;</span> =&gt; <span class="stringliteral">&#39;Themes path&#39;</span>, <span class="stringliteral">&#39;modules&#39;</span> =&gt; <span class="stringliteral">&#39;Modules path&#39;</span>, <span class="stringliteral">&#39;files&#39;</span> =&gt; <span class="stringliteral">&#39;File directory path&#39;</span>, <span class="stringliteral">&#39;private&#39;</span> =&gt; <span class="stringliteral">&#39;Private file directory path&#39;</span>, <span class="stringliteral">&#39;temp&#39;</span> =&gt; <span class="stringliteral">&#39;Temporary file directory path&#39;</span>, <span class="stringliteral">&#39;config-sync&#39;</span> =&gt; <span class="stringliteral">&#39;Sync config path&#39;</span>, <span class="stringliteral">&#39;files-path&#39;</span> =&gt; <span class="stringliteral">&#39;File directory path&#39;</span>, <span class="stringliteral">&#39;temp-path&#39;</span> =&gt; <span class="stringliteral">&#39;Temporary file directory path&#39;</span>, <span class="stringliteral">&#39;%paths&#39;</span> =&gt; <span class="stringliteral">&#39;Other paths&#39;</span>),</div>
<div class="line"><a name="l00168"></a><span class="lineno">  168</span>&#160;      <span class="stringliteral">&#39;formatted-filter&#39;</span> =&gt; <span class="stringliteral">&#39;_drush_core_status_format_table_data&#39;</span>,</div>
<div class="line"><a name="l00169"></a><span class="lineno">  169</span>&#160;      <span class="stringliteral">&#39;private-fields&#39;</span> =&gt; <span class="stringliteral">&#39;db-password&#39;</span>,</div>
<div class="line"><a name="l00170"></a><span class="lineno">  170</span>&#160;      <span class="stringliteral">&#39;simplify-single&#39;</span> =&gt; TRUE,</div>
<div class="line"><a name="l00171"></a><span class="lineno">  171</span>&#160;      <span class="stringliteral">&#39;table-metadata&#39;</span> =&gt; array(</div>
<div class="line"><a name="l00172"></a><span class="lineno">  172</span>&#160;        <span class="stringliteral">&#39;list-separator&#39;</span> =&gt; <span class="charliteral">&#39; &#39;</span>,</div>
<div class="line"><a name="l00173"></a><span class="lineno">  173</span>&#160;      ),</div>
<div class="line"><a name="l00174"></a><span class="lineno">  174</span>&#160;      <span class="stringliteral">&#39;output-data-type&#39;</span> =&gt; <span class="stringliteral">&#39;format-list&#39;</span>,</div>
<div class="line"><a name="l00175"></a><span class="lineno">  175</span>&#160;    ),</div>
<div class="line"><a name="l00176"></a><span class="lineno">  176</span>&#160;    <span class="stringliteral">&#39;topics&#39;</span> =&gt; array(<span class="stringliteral">&#39;docs-readme&#39;</span>),</div>
<div class="line"><a name="l00177"></a><span class="lineno">  177</span>&#160;  );</div>
<div class="line"><a name="l00178"></a><span class="lineno">  178</span>&#160;</div>
<div class="line"><a name="l00179"></a><span class="lineno">  179</span>&#160;  $items[<span class="stringliteral">&#39;core-requirements&#39;</span>] = array(</div>
<div class="line"><a name="l00180"></a><span class="lineno">  180</span>&#160;    <span class="stringliteral">&#39;description&#39;</span> =&gt; <span class="stringliteral">&#39;Provides information about things that may be wrong in your Drupal installation, if any.&#39;</span>,</div>
<div class="line"><a name="l00181"></a><span class="lineno">  181</span>&#160;    <span class="stringliteral">&#39;aliases&#39;</span> =&gt; array(<span class="stringliteral">&#39;status-report&#39;</span>,<span class="stringliteral">&#39;rq&#39;</span>),</div>
<div class="line"><a name="l00182"></a><span class="lineno">  182</span>&#160;    <span class="stringliteral">&#39;examples&#39;</span> =&gt; array(</div>
<div class="line"><a name="l00183"></a><span class="lineno">  183</span>&#160;      <span class="stringliteral">&#39;drush core-requirements&#39;</span> =&gt; <span class="stringliteral">&#39;Show all status lines from the Status Report admin page.&#39;</span>,</div>
<div class="line"><a name="l00184"></a><span class="lineno">  184</span>&#160;      <span class="stringliteral">&#39;drush core-requirements --severity=2&#39;</span> =&gt; <span class="stringliteral">&#39;Show only the red lines from the Status Report admin page.&#39;</span>,</div>
<div class="line"><a name="l00185"></a><span class="lineno">  185</span>&#160;      <span class="stringliteral">&#39;drush core-requirements --pipe&#39;</span> =&gt; <span class="stringliteral">&#39;Print out a short report in JSON format, where severity 2=error, 1=warning, and 0/-1=OK&#39;</span>,</div>
<div class="line"><a name="l00186"></a><span class="lineno">  186</span>&#160;    ),</div>
<div class="line"><a name="l00187"></a><span class="lineno">  187</span>&#160;    <span class="stringliteral">&#39;options&#39;</span> =&gt; array(</div>
<div class="line"><a name="l00188"></a><span class="lineno">  188</span>&#160;      <span class="stringliteral">&#39;severity&#39;</span> =&gt; array(</div>
<div class="line"><a name="l00189"></a><span class="lineno">  189</span>&#160;        <span class="stringliteral">&#39;description&#39;</span> =&gt; <span class="stringliteral">&#39;Only show status report messages with a severity greater than or equal to the specified value.&#39;</span>,</div>
<div class="line"><a name="l00190"></a><span class="lineno">  190</span>&#160;        <span class="stringliteral">&#39;value&#39;</span> =&gt; <span class="stringliteral">&#39;required&#39;</span>,</div>
<div class="line"><a name="l00191"></a><span class="lineno">  191</span>&#160;        <span class="stringliteral">&#39;example-value&#39;</span> =&gt; <span class="charliteral">&#39;3&#39;</span>,</div>
<div class="line"><a name="l00192"></a><span class="lineno">  192</span>&#160;      ),</div>
<div class="line"><a name="l00193"></a><span class="lineno">  193</span>&#160;      <span class="stringliteral">&#39;ignore&#39;</span> =&gt; <span class="stringliteral">&#39;Comma-separated list of requirements to remove from output. Run with --pipe to see key values to use.&#39;</span>,</div>
<div class="line"><a name="l00194"></a><span class="lineno">  194</span>&#160;    ),</div>
<div class="line"><a name="l00195"></a><span class="lineno">  195</span>&#160;    <span class="stringliteral">&#39;outputformat&#39;</span> =&gt; array(</div>
<div class="line"><a name="l00196"></a><span class="lineno">  196</span>&#160;      <span class="stringliteral">&#39;default&#39;</span> =&gt; <span class="stringliteral">&#39;table&#39;</span>,</div>
<div class="line"><a name="l00197"></a><span class="lineno">  197</span>&#160;      <span class="stringliteral">&#39;pipe-format&#39;</span> =&gt; <span class="stringliteral">&#39;json&#39;</span>,</div>
<div class="line"><a name="l00198"></a><span class="lineno">  198</span>&#160;      <span class="stringliteral">&#39;field-labels&#39;</span> =&gt; array(<span class="stringliteral">&#39;title&#39;</span> =&gt; <span class="stringliteral">&#39;Title&#39;</span>, <span class="stringliteral">&#39;severity&#39;</span> =&gt; <span class="stringliteral">&#39;Severity&#39;</span>, <span class="stringliteral">&#39;sid&#39;</span> =&gt; <span class="stringliteral">&#39;SID&#39;</span>, <span class="stringliteral">&#39;description&#39;</span> =&gt; <span class="stringliteral">&#39;Description&#39;</span>, <span class="stringliteral">&#39;value&#39;</span> =&gt; <span class="stringliteral">&#39;Summary&#39;</span>, <span class="stringliteral">&#39;reason&#39;</span> =&gt; <span class="stringliteral">&#39;Reason&#39;</span>, <span class="stringliteral">&#39;weight&#39;</span> =&gt; <span class="stringliteral">&#39;Weight&#39;</span>),</div>
<div class="line"><a name="l00199"></a><span class="lineno">  199</span>&#160;      <span class="stringliteral">&#39;fields-default&#39;</span> =&gt; array(<span class="stringliteral">&#39;title&#39;</span>, <span class="stringliteral">&#39;severity&#39;</span>, <span class="stringliteral">&#39;description&#39;</span>),</div>
<div class="line"><a name="l00200"></a><span class="lineno">  200</span>&#160;      <span class="stringliteral">&#39;column-widths&#39;</span> =&gt; array(<span class="stringliteral">&#39;severity&#39;</span> =&gt; 8),</div>
<div class="line"><a name="l00201"></a><span class="lineno">  201</span>&#160;      <span class="stringliteral">&#39;concatenate-columns&#39;</span> =&gt; array(<span class="stringliteral">&#39;description&#39;</span> =&gt; array(<span class="stringliteral">&#39;value&#39;</span>, <span class="stringliteral">&#39;description&#39;</span>)),</div>
<div class="line"><a name="l00202"></a><span class="lineno">  202</span>&#160;      <span class="stringliteral">&#39;strip-tags&#39;</span> =&gt; TRUE,</div>
<div class="line"><a name="l00203"></a><span class="lineno">  203</span>&#160;      <span class="stringliteral">&#39;ini-item&#39;</span> =&gt; <span class="stringliteral">&#39;sid&#39;</span>,</div>
<div class="line"><a name="l00204"></a><span class="lineno">  204</span>&#160;      <span class="stringliteral">&#39;key-value-item&#39;</span> =&gt; <span class="stringliteral">&#39;severity&#39;</span>,</div>
<div class="line"><a name="l00205"></a><span class="lineno">  205</span>&#160;      <span class="stringliteral">&#39;list-metadata&#39;</span> =&gt; array(</div>
<div class="line"><a name="l00206"></a><span class="lineno">  206</span>&#160;        <span class="stringliteral">&#39;list-item&#39;</span> =&gt; <span class="stringliteral">&#39;severity&#39;</span>,</div>
<div class="line"><a name="l00207"></a><span class="lineno">  207</span>&#160;      ),</div>
<div class="line"><a name="l00208"></a><span class="lineno">  208</span>&#160;      <span class="stringliteral">&#39;output-data-type&#39;</span> =&gt; <span class="stringliteral">&#39;format-table&#39;</span>,</div>
<div class="line"><a name="l00209"></a><span class="lineno">  209</span>&#160;    ),</div>
<div class="line"><a name="l00210"></a><span class="lineno">  210</span>&#160;  );</div>
<div class="line"><a name="l00211"></a><span class="lineno">  211</span>&#160;  $items[<span class="stringliteral">&#39;php-eval&#39;</span>] = array(</div>
<div class="line"><a name="l00212"></a><span class="lineno">  212</span>&#160;    <span class="stringliteral">&#39;description&#39;</span> =&gt; <span class="stringliteral">&#39;Evaluate arbitrary php code after bootstrapping Drupal (if available).&#39;</span>,</div>
<div class="line"><a name="l00213"></a><span class="lineno">  213</span>&#160;    <span class="stringliteral">&#39;examples&#39;</span> =&gt; array(</div>
<div class="line"><a name="l00214"></a><span class="lineno">  214</span>&#160;      <span class="stringliteral">&#39;drush php-eval \&#39;variable_set(&quot;hello&quot;, &quot;world&quot;);\&#39;&#39;</span> =&gt; <span class="stringliteral">&#39;Sets the hello variable using Drupal API.&#39;</span>,</div>
<div class="line"><a name="l00215"></a><span class="lineno">  215</span>&#160;      <span class="stringliteral">&#39;drush php-eval \&#39;$node = node_load(1); print $node-&gt;title;\&#39;&#39;</span> =&gt; <span class="stringliteral">&#39;Loads node with nid 1 and then prints its title.&#39;</span>,</div>
<div class="line"><a name="l00216"></a><span class="lineno">  216</span>&#160;      <span class="stringliteral">&#39;drush php-eval &quot;file_unmanaged_copy(\&#39;$HOME/Pictures/image.jpg\&#39;, \&#39;public://image.jpg\&#39;);&quot;&#39;</span> =&gt; <span class="stringliteral">&#39;Copies a file whose path is determined by an environment\&#39;s variable. Note the use of double quotes so the variable $HOME gets replaced by its value.&#39;</span>,</div>
<div class="line"><a name="l00217"></a><span class="lineno">  217</span>&#160;      <span class="stringliteral">&#39;drush php-eval &quot;node_access_rebuild();&quot;&#39;</span> =&gt; <span class="stringliteral">&#39;Rebuild node access permissions.&#39;</span>,</div>
<div class="line"><a name="l00218"></a><span class="lineno">  218</span>&#160;    ),</div>
<div class="line"><a name="l00219"></a><span class="lineno">  219</span>&#160;    <span class="stringliteral">&#39;arguments&#39;</span> =&gt; array(</div>
<div class="line"><a name="l00220"></a><span class="lineno">  220</span>&#160;      <span class="stringliteral">&#39;code&#39;</span> =&gt; <span class="stringliteral">&#39;PHP code&#39;</span>,</div>
<div class="line"><a name="l00221"></a><span class="lineno">  221</span>&#160;    ),</div>
<div class="line"><a name="l00222"></a><span class="lineno">  222</span>&#160;    <span class="stringliteral">&#39;required-arguments&#39;</span> =&gt; TRUE,</div>
<div class="line"><a name="l00223"></a><span class="lineno">  223</span>&#160;    <span class="stringliteral">&#39;allow-additional-options&#39;</span> =&gt; TRUE,</div>
<div class="line"><a name="l00224"></a><span class="lineno">  224</span>&#160;    <span class="stringliteral">&#39;bootstrap&#39;</span> =&gt; DRUSH_BOOTSTRAP_MAX,</div>
<div class="line"><a name="l00225"></a><span class="lineno">  225</span>&#160;    <span class="stringliteral">&#39;aliases&#39;</span> =&gt; array(<span class="stringliteral">&#39;eval&#39;</span>, <span class="stringliteral">&#39;ev&#39;</span>),</div>
<div class="line"><a name="l00226"></a><span class="lineno">  226</span>&#160;    <span class="stringliteral">&#39;outputformat&#39;</span> =&gt; array(</div>
<div class="line"><a name="l00227"></a><span class="lineno">  227</span>&#160;      <span class="stringliteral">&#39;default&#39;</span> =&gt; <span class="stringliteral">&#39;var_export&#39;</span>,</div>
<div class="line"><a name="l00228"></a><span class="lineno">  228</span>&#160;    ),</div>
<div class="line"><a name="l00229"></a><span class="lineno">  229</span>&#160;  );</div>
<div class="line"><a name="l00230"></a><span class="lineno">  230</span>&#160;  $items[<span class="stringliteral">&#39;php-script&#39;</span>] = array(</div>
<div class="line"><a name="l00231"></a><span class="lineno">  231</span>&#160;    <span class="stringliteral">&#39;description&#39;</span> =&gt; <span class="stringliteral">&quot;Run php script(s).&quot;</span>,</div>
<div class="line"><a name="l00232"></a><span class="lineno">  232</span>&#160;    <span class="stringliteral">&#39;examples&#39;</span> =&gt; array(</div>
<div class="line"><a name="l00233"></a><span class="lineno">  233</span>&#160;      <span class="stringliteral">&#39;drush php-script example --script-path=/path/to/scripts:/another/path&#39;</span> =&gt; <span class="stringliteral">&#39;Run a script named example.php from specified paths&#39;</span>,</div>
<div class="line"><a name="l00234"></a><span class="lineno">  234</span>&#160;      <span class="stringliteral">&#39;drush php-script&#39;</span> =&gt; <span class="stringliteral">&#39;List all available scripts.&#39;</span>,</div>
<div class="line"><a name="l00235"></a><span class="lineno">  235</span>&#160;      <span class="stringliteral">&#39;&#39;</span> =&gt; <span class="stringliteral">&#39;&#39;</span>,</div>
<div class="line"><a name="l00236"></a><span class="lineno">  236</span>&#160;      <span class="stringliteral">&quot;#!/usr/bin/env drush\n&lt;?php\nvariable_set(&#39;key&#39;, drush_shift());&quot;</span> =&gt; <span class="stringliteral">&quot;Execute php code with a full Drupal bootstrap directly from a shell script.&quot;</span>,</div>
<div class="line"><a name="l00237"></a><span class="lineno">  237</span>&#160;    ),</div>
<div class="line"><a name="l00238"></a><span class="lineno">  238</span>&#160;    <span class="stringliteral">&#39;arguments&#39;</span> =&gt; array(</div>
<div class="line"><a name="l00239"></a><span class="lineno">  239</span>&#160;      <span class="stringliteral">&#39;filename&#39;</span> =&gt; <span class="stringliteral">&#39;Optional. The file you wish to execute (without extension). If omitted, list files ending in .php in the current working directory and specified script-path. Some might not be real drush scripts. Beware.&#39;</span>,</div>
<div class="line"><a name="l00240"></a><span class="lineno">  240</span>&#160;    ),</div>
<div class="line"><a name="l00241"></a><span class="lineno">  241</span>&#160;    <span class="stringliteral">&#39;options&#39;</span> =&gt; array(</div>
<div class="line"><a name="l00242"></a><span class="lineno">  242</span>&#160;      <span class="stringliteral">&#39;script-path&#39;</span> =&gt; array(</div>
<div class="line"><a name="l00243"></a><span class="lineno">  243</span>&#160;        <span class="stringliteral">&#39;description&#39;</span> =&gt; <span class="stringliteral">&quot;Additional paths to search for scripts, separated by : (Unix-based systems) or ; (Windows).&quot;</span>,</div>
<div class="line"><a name="l00244"></a><span class="lineno">  244</span>&#160;        <span class="stringliteral">&#39;example-value&#39;</span> =&gt; <span class="stringliteral">&#39;~/scripts&#39;</span>,</div>
<div class="line"><a name="l00245"></a><span class="lineno">  245</span>&#160;      ),</div>
<div class="line"><a name="l00246"></a><span class="lineno">  246</span>&#160;    ),</div>
<div class="line"><a name="l00247"></a><span class="lineno">  247</span>&#160;    <span class="stringliteral">&#39;allow-additional-options&#39;</span> =&gt; TRUE,</div>
<div class="line"><a name="l00248"></a><span class="lineno">  248</span>&#160;    <span class="stringliteral">&#39;bootstrap&#39;</span> =&gt; DRUSH_BOOTSTRAP_MAX,</div>
<div class="line"><a name="l00249"></a><span class="lineno">  249</span>&#160;    <span class="stringliteral">&#39;aliases&#39;</span> =&gt; array(<span class="stringliteral">&#39;scr&#39;</span>),</div>
<div class="line"><a name="l00250"></a><span class="lineno">  250</span>&#160;    <span class="stringliteral">&#39;topics&#39;</span> =&gt; array(<span class="stringliteral">&#39;docs-examplescript&#39;</span>, <span class="stringliteral">&#39;docs-scripts&#39;</span>),</div>
<div class="line"><a name="l00251"></a><span class="lineno">  251</span>&#160;  );</div>
<div class="line"><a name="l00252"></a><span class="lineno">  252</span>&#160;  $items[<span class="stringliteral">&#39;core-execute&#39;</span>] = array(</div>
<div class="line"><a name="l00253"></a><span class="lineno">  253</span>&#160;    <span class="stringliteral">&#39;description&#39;</span> =&gt; <span class="stringliteral">&#39;Execute a shell command. Usually used with a site alias.&#39;</span>,</div>
<div class="line"><a name="l00254"></a><span class="lineno">  254</span>&#160;    <span class="stringliteral">&#39;bootstrap&#39;</span> =&gt; DRUSH_BOOTSTRAP_NONE, <span class="comment">// No bootstrap.</span></div>
<div class="line"><a name="l00255"></a><span class="lineno">  255</span>&#160;    <span class="stringliteral">&#39;arguments&#39;</span> =&gt; array(</div>
<div class="line"><a name="l00256"></a><span class="lineno">  256</span>&#160;      <span class="stringliteral">&#39;command&#39;</span> =&gt; <span class="stringliteral">&#39;The shell command to be executed.&#39;</span>,</div>
<div class="line"><a name="l00257"></a><span class="lineno">  257</span>&#160;    ),</div>
<div class="line"><a name="l00258"></a><span class="lineno">  258</span>&#160;    <span class="stringliteral">&#39;options&#39;</span> =&gt; array(</div>
<div class="line"><a name="l00259"></a><span class="lineno">  259</span>&#160;      <span class="stringliteral">&#39;escape&#39;</span> =&gt; <span class="stringliteral">&#39;Escape parameters before executing them with the shell. Default is escape; use --no-escape to disable.&#39;</span>,</div>
<div class="line"><a name="l00260"></a><span class="lineno">  260</span>&#160;    ) + <a class="code" href="group__commandwrappers.html#ga20677b9bedd9fe4bd9710d5cf12e5182">drush_shell_exec_proc_build_options</a>(),</div>
<div class="line"><a name="l00261"></a><span class="lineno">  261</span>&#160;    <span class="stringliteral">&#39;required-arguments&#39;</span> =&gt; TRUE,</div>
<div class="line"><a name="l00262"></a><span class="lineno">  262</span>&#160;    <span class="stringliteral">&#39;allow-additional-options&#39;</span> =&gt; TRUE,</div>
<div class="line"><a name="l00263"></a><span class="lineno">  263</span>&#160;    <span class="stringliteral">&#39;handle-remote-commands&#39;</span> =&gt; TRUE,</div>
<div class="line"><a name="l00264"></a><span class="lineno">  264</span>&#160;    <span class="stringliteral">&#39;strict-option-handling&#39;</span> =&gt; TRUE,</div>
<div class="line"><a name="l00265"></a><span class="lineno">  265</span>&#160;    <span class="stringliteral">&#39;examples&#39;</span> =&gt; array(</div>
<div class="line"><a name="l00266"></a><span class="lineno">  266</span>&#160;      <span class="stringliteral">&#39;drush core-execute git pull origin rebase&#39;</span> =&gt; <span class="stringliteral">&#39;Retrieve latest code from git&#39;</span>,</div>
<div class="line"><a name="l00267"></a><span class="lineno">  267</span>&#160;    ),</div>
<div class="line"><a name="l00268"></a><span class="lineno">  268</span>&#160;    <span class="stringliteral">&#39;aliases&#39;</span> =&gt; array(<span class="stringliteral">&#39;exec&#39;</span>, <span class="stringliteral">&#39;execute&#39;</span>),</div>
<div class="line"><a name="l00269"></a><span class="lineno">  269</span>&#160;    <span class="stringliteral">&#39;topics&#39;</span> =&gt; array(<span class="stringliteral">&#39;docs-aliases&#39;</span>),</div>
<div class="line"><a name="l00270"></a><span class="lineno">  270</span>&#160;  );</div>
<div class="line"><a name="l00271"></a><span class="lineno">  271</span>&#160;  $items[<span class="stringliteral">&#39;core-rsync&#39;</span>] = array(</div>
<div class="line"><a name="l00272"></a><span class="lineno">  272</span>&#160;    <span class="stringliteral">&#39;description&#39;</span> =&gt; <span class="stringliteral">&#39;Rsync the Drupal tree to/from another server using ssh.&#39;</span>,</div>
<div class="line"><a name="l00273"></a><span class="lineno">  273</span>&#160;    <span class="stringliteral">&#39;bootstrap&#39;</span> =&gt; DRUSH_BOOTSTRAP_NONE, <span class="comment">// No bootstrap.</span></div>
<div class="line"><a name="l00274"></a><span class="lineno">  274</span>&#160;    <span class="stringliteral">&#39;arguments&#39;</span> =&gt; array(</div>
<div class="line"><a name="l00275"></a><span class="lineno">  275</span>&#160;      <span class="stringliteral">&#39;source&#39;</span> =&gt; <span class="stringliteral">&#39;May be rsync path or site alias. See rsync documentation and example.aliases.drushrc.php.&#39;</span>,</div>
<div class="line"><a name="l00276"></a><span class="lineno">  276</span>&#160;      <span class="stringliteral">&#39;destination&#39;</span> =&gt; <span class="stringliteral">&#39;May be rsync path or site alias. See rsync documentation and example.aliases.drushrc.php.&#39;</span>,</div>
<div class="line"><a name="l00277"></a><span class="lineno">  277</span>&#160;    ),</div>
<div class="line"><a name="l00278"></a><span class="lineno">  278</span>&#160;    <span class="stringliteral">&#39;options&#39;</span> =&gt; array(</div>
<div class="line"><a name="l00279"></a><span class="lineno">  279</span>&#160;      <span class="stringliteral">&#39;mode&#39;</span> =&gt; <span class="stringliteral">&#39;The unary flags to pass to rsync; --mode=rultz implies rsync -rultz.  Default is -akz.&#39;</span>,</div>
<div class="line"><a name="l00280"></a><span class="lineno">  280</span>&#160;      <span class="stringliteral">&#39;exclude-conf&#39;</span> =&gt; <span class="stringliteral">&#39;Excludes settings.php from being rsynced.  Default.&#39;</span>,</div>
<div class="line"><a name="l00281"></a><span class="lineno">  281</span>&#160;      <span class="stringliteral">&#39;include-conf&#39;</span> =&gt; <span class="stringliteral">&#39;Allow settings.php to be rsynced. Default is to exclude settings.php.&#39;</span>,</div>
<div class="line"><a name="l00282"></a><span class="lineno">  282</span>&#160;      <span class="stringliteral">&#39;include-vcs&#39;</span> =&gt; <span class="stringliteral">&#39;Include special version control directories (e.g. .svn).  Default is to exclude vcs files.&#39;</span>,</div>
<div class="line"><a name="l00283"></a><span class="lineno">  283</span>&#160;      <span class="stringliteral">&#39;exclude-files&#39;</span> =&gt; <span class="stringliteral">&#39;Exclude the files directory.&#39;</span>,</div>
<div class="line"><a name="l00284"></a><span class="lineno">  284</span>&#160;      <span class="stringliteral">&#39;exclude-sites&#39;</span> =&gt; <span class="stringliteral">&#39;Exclude all directories in &quot;sites/&quot; except for &quot;sites/all&quot;.&#39;</span>,</div>
<div class="line"><a name="l00285"></a><span class="lineno">  285</span>&#160;      <span class="stringliteral">&#39;exclude-other-sites&#39;</span> =&gt; <span class="stringliteral">&#39;Exclude all directories in &quot;sites/&quot; except for &quot;sites/all&quot; and the site directory for the site being synced.  Note: if the site directory is different between the source and destination, use --exclude-sites followed by &quot;drush rsync @from:%site @to:%site&quot;&#39;</span>,</div>
<div class="line"><a name="l00286"></a><span class="lineno">  286</span>&#160;      <span class="stringliteral">&#39;exclude-paths&#39;</span> =&gt; <span class="stringliteral">&#39;List of paths to exclude, seperated by : (Unix-based systems) or ; (Windows).&#39;</span>,</div>
<div class="line"><a name="l00287"></a><span class="lineno">  287</span>&#160;      <span class="stringliteral">&#39;include-paths&#39;</span> =&gt; <span class="stringliteral">&#39;List of paths to include, seperated by : (Unix-based systems) or ; (Windows).&#39;</span>,</div>
<div class="line"><a name="l00288"></a><span class="lineno">  288</span>&#160;      <span class="stringliteral">&#39;{rsync-option-name}&#39;</span> =&gt; <span class="stringliteral">&quot;Replace {rsync-option-name} with the rsync option (or option=&#39;value&#39;) that you would like to pass through to rsync. Examples include --delete, --exclude=*.sql, --filter=&#39;merge /etc/rsync/default.rules&#39;, etc. See the rsync documentation for a complete explanation of all the rsync options and values.&quot;</span>,</div>
<div class="line"><a name="l00289"></a><span class="lineno">  289</span>&#160;      <span class="stringliteral">&#39;rsync-version&#39;</span> =&gt; <span class="stringliteral">&#39;Set to the version of rsync you are using to signal Drush to go into backwards-compatibility mode when using very old versions of rsync. For example, --rsync-version=2.6.8 or earlier will cause Drush to avoid the --remove-source-files flag.&#39;</span>,</div>
<div class="line"><a name="l00290"></a><span class="lineno">  290</span>&#160;</div>
<div class="line"><a name="l00291"></a><span class="lineno">  291</span>&#160;    ),</div>
<div class="line"><a name="l00292"></a><span class="lineno">  292</span>&#160;    <span class="stringliteral">&#39;strict-option-handling&#39;</span> =&gt; TRUE,</div>
<div class="line"><a name="l00293"></a><span class="lineno">  293</span>&#160;    <span class="stringliteral">&#39;examples&#39;</span> =&gt; array(</div>
<div class="line"><a name="l00294"></a><span class="lineno">  294</span>&#160;      <span class="stringliteral">&#39;drush rsync @dev @stage&#39;</span> =&gt; <span class="stringliteral">&#39;Rsync Drupal root from Drush alias dev to the alias stage. Either or both may be remote.&#39;</span>,</div>
<div class="line"><a name="l00295"></a><span class="lineno">  295</span>&#160;      <span class="stringliteral">&#39;drush rsync ./ @stage:%files/img&#39;</span> =&gt; <span class="stringliteral">&#39;Rsync all files in the current directory to the \&#39;img\&#39; directory in the file storage folder on the Drush alias stage.&#39;</span>,</div>
<div class="line"><a name="l00296"></a><span class="lineno">  296</span>&#160;      <span class="stringliteral">&#39;drush -s rsync @dev @stage --exclude=*.sql --delete&#39;</span> =&gt; <span class="stringliteral">&quot;Simulate Rsync Drupal root from the Drush alias dev to the alias stage (one of which must be local), excluding all files that match the filter &#39;*.sql&#39; and delete all files on the destination that are no longer on the source.&quot;</span>,</div>
<div class="line"><a name="l00297"></a><span class="lineno">  297</span>&#160;    ),</div>
<div class="line"><a name="l00298"></a><span class="lineno">  298</span>&#160;    <span class="stringliteral">&#39;aliases&#39;</span> =&gt; array(<span class="stringliteral">&#39;rsync&#39;</span>),</div>
<div class="line"><a name="l00299"></a><span class="lineno">  299</span>&#160;    <span class="stringliteral">&#39;topics&#39;</span> =&gt; array(<span class="stringliteral">&#39;docs-aliases&#39;</span>),</div>
<div class="line"><a name="l00300"></a><span class="lineno">  300</span>&#160;  );</div>
<div class="line"><a name="l00301"></a><span class="lineno">  301</span>&#160;  $items[<span class="stringliteral">&#39;drupal-directory&#39;</span>] = array(</div>
<div class="line"><a name="l00302"></a><span class="lineno">  302</span>&#160;    <span class="stringliteral">&#39;description&#39;</span> =&gt; <span class="stringliteral">&#39;Return the filesystem path for modules/themes and other key folders.&#39;</span>,</div>
<div class="line"><a name="l00303"></a><span class="lineno">  303</span>&#160;    <span class="stringliteral">&#39;arguments&#39;</span> =&gt; array(</div>
<div class="line"><a name="l00304"></a><span class="lineno">  304</span>&#160;      <span class="stringliteral">&#39;target&#39;</span> =&gt; <span class="stringliteral">&#39;A module/theme name, or special names like root, files, private, or an alias : path alias string such as @alias:%files. Defaults to root.&#39;</span>,</div>
<div class="line"><a name="l00305"></a><span class="lineno">  305</span>&#160;    ),</div>
<div class="line"><a name="l00306"></a><span class="lineno">  306</span>&#160;    <span class="stringliteral">&#39;options&#39;</span> =&gt; array(</div>
<div class="line"><a name="l00307"></a><span class="lineno">  307</span>&#160;      <span class="stringliteral">&#39;component&#39;</span> =&gt; <span class="stringliteral">&quot;The portion of the evaluated path to return.  Defaults to &#39;path&#39;; &#39;name&#39; returns the site alias of the target.&quot;</span>,</div>
<div class="line"><a name="l00308"></a><span class="lineno">  308</span>&#160;      <span class="stringliteral">&#39;local-only&#39;</span> =&gt; <span class="stringliteral">&quot;Reject any target that specifies a remote site.&quot;</span>,</div>
<div class="line"><a name="l00309"></a><span class="lineno">  309</span>&#160;    ),</div>
<div class="line"><a name="l00310"></a><span class="lineno">  310</span>&#160;    <span class="stringliteral">&#39;examples&#39;</span> =&gt; array(</div>
<div class="line"><a name="l00311"></a><span class="lineno">  311</span>&#160;      <span class="stringliteral">&#39;cd `drush dd devel`&#39;</span> =&gt; <span class="stringliteral">&#39;Navigate into the devel module directory&#39;</span>,</div>
<div class="line"><a name="l00312"></a><span class="lineno">  312</span>&#160;      <span class="stringliteral">&#39;cd `drush dd` &#39;</span> =&gt; <span class="stringliteral">&#39;Navigate to the root of your Drupal site&#39;</span>,</div>
<div class="line"><a name="l00313"></a><span class="lineno">  313</span>&#160;      <span class="stringliteral">&#39;cd `drush dd files`&#39;</span> =&gt; <span class="stringliteral">&#39;Navigate to the files directory.&#39;</span>,</div>
<div class="line"><a name="l00314"></a><span class="lineno">  314</span>&#160;      <span class="stringliteral">&#39;drush dd @alias:%files&#39;</span> =&gt; <span class="stringliteral">&#39;Print the path to the files directory on the site @alias.&#39;</span>,</div>
<div class="line"><a name="l00315"></a><span class="lineno">  315</span>&#160;      <span class="stringliteral">&#39;edit `drush dd devel`/devel.module&#39;</span> =&gt; <span class="stringliteral">&quot;Open devel module in your editor (customize &#39;edit&#39; for your editor)&quot;</span>,</div>
<div class="line"><a name="l00316"></a><span class="lineno">  316</span>&#160;    ),</div>
<div class="line"><a name="l00317"></a><span class="lineno">  317</span>&#160;    <span class="stringliteral">&#39;aliases&#39;</span> =&gt; array(<span class="stringliteral">&#39;dd&#39;</span>),</div>
<div class="line"><a name="l00318"></a><span class="lineno">  318</span>&#160;    <span class="stringliteral">&#39;bootstrap&#39;</span> =&gt; DRUSH_BOOTSTRAP_NONE,</div>
<div class="line"><a name="l00319"></a><span class="lineno">  319</span>&#160;  );</div>
<div class="line"><a name="l00320"></a><span class="lineno">  320</span>&#160;</div>
<div class="line"><a name="l00321"></a><span class="lineno">  321</span>&#160;  $items[<span class="stringliteral">&#39;batch-process&#39;</span>] = array(</div>
<div class="line"><a name="l00322"></a><span class="lineno">  322</span>&#160;    <span class="stringliteral">&#39;description&#39;</span> =&gt; <span class="stringliteral">&#39;Process operations in the specified batch set&#39;</span>,</div>
<div class="line"><a name="l00323"></a><span class="lineno">  323</span>&#160;    <span class="stringliteral">&#39;hidden&#39;</span> =&gt; TRUE,</div>
<div class="line"><a name="l00324"></a><span class="lineno">  324</span>&#160;    <span class="stringliteral">&#39;arguments&#39;</span> =&gt; array(</div>
<div class="line"><a name="l00325"></a><span class="lineno">  325</span>&#160;      <span class="stringliteral">&#39;batch-id&#39;</span> =&gt; <span class="stringliteral">&#39;The batch id that will be processed.&#39;</span>,</div>
<div class="line"><a name="l00326"></a><span class="lineno">  326</span>&#160;    ),</div>
<div class="line"><a name="l00327"></a><span class="lineno">  327</span>&#160;    <span class="stringliteral">&#39;required-arguments&#39;</span> =&gt; TRUE,</div>
<div class="line"><a name="l00328"></a><span class="lineno">  328</span>&#160;    <span class="stringliteral">&#39;bootstrap&#39;</span> =&gt; DRUSH_BOOTSTRAP_DRUPAL_LOGIN,</div>
<div class="line"><a name="l00329"></a><span class="lineno">  329</span>&#160;  );</div>
<div class="line"><a name="l00330"></a><span class="lineno">  330</span>&#160;</div>
<div class="line"><a name="l00331"></a><span class="lineno">  331</span>&#160;  $items[<span class="stringliteral">&#39;updatedb-batch-process&#39;</span>] = array(</div>
<div class="line"><a name="l00332"></a><span class="lineno">  332</span>&#160;    <span class="stringliteral">&#39;description&#39;</span> =&gt; <span class="stringliteral">&#39;Perform update functions&#39;</span>,</div>
<div class="line"><a name="l00333"></a><span class="lineno">  333</span>&#160;    <span class="stringliteral">&#39;hidden&#39;</span> =&gt; TRUE,</div>
<div class="line"><a name="l00334"></a><span class="lineno">  334</span>&#160;    <span class="stringliteral">&#39;arguments&#39;</span> =&gt; array(</div>
<div class="line"><a name="l00335"></a><span class="lineno">  335</span>&#160;      <span class="stringliteral">&#39;batch-id&#39;</span> =&gt; <span class="stringliteral">&#39;The batch id that will be processed&#39;</span>,</div>
<div class="line"><a name="l00336"></a><span class="lineno">  336</span>&#160;    ),</div>
<div class="line"><a name="l00337"></a><span class="lineno">  337</span>&#160;    <span class="stringliteral">&#39;required-arguments&#39;</span> =&gt; TRUE,</div>
<div class="line"><a name="l00338"></a><span class="lineno">  338</span>&#160;    <span class="comment">// Drupal 7 needs DRUSH_BOOTSTRAP_DRUPAL_CONFIGURATION, while Drupal 8 needs _FULL.</span></div>
<div class="line"><a name="l00339"></a><span class="lineno">  339</span>&#160;    <span class="comment">// Therefore we bootstrap to _FULL in commands/core/drupal/update.inc.</span></div>
<div class="line"><a name="l00340"></a><span class="lineno">  340</span>&#160;    <span class="stringliteral">&#39;bootstrap&#39;</span> =&gt; DRUSH_BOOTSTRAP_DRUPAL_CONFIGURATION,</div>
<div class="line"><a name="l00341"></a><span class="lineno">  341</span>&#160;  );</div>
<div class="line"><a name="l00342"></a><span class="lineno">  342</span>&#160;  $items[<span class="stringliteral">&#39;core-global-options&#39;</span>] = array(</div>
<div class="line"><a name="l00343"></a><span class="lineno">  343</span>&#160;    <span class="stringliteral">&#39;description&#39;</span> =&gt; <span class="stringliteral">&#39;All global options&#39;</span>,</div>
<div class="line"><a name="l00344"></a><span class="lineno">  344</span>&#160;    <span class="stringliteral">&#39;hidden&#39;</span> =&gt; TRUE,</div>
<div class="line"><a name="l00345"></a><span class="lineno">  345</span>&#160;    <span class="stringliteral">&#39;topic&#39;</span> =&gt; TRUE,</div>
<div class="line"><a name="l00346"></a><span class="lineno">  346</span>&#160;    <span class="stringliteral">&#39;bootstrap&#39;</span> =&gt; DRUSH_BOOTSTRAP_NONE,</div>
<div class="line"><a name="l00347"></a><span class="lineno">  347</span>&#160;    <span class="stringliteral">&#39;outputformat&#39;</span> =&gt; array(</div>
<div class="line"><a name="l00348"></a><span class="lineno">  348</span>&#160;      <span class="stringliteral">&#39;default&#39;</span> =&gt; <span class="stringliteral">&#39;table&#39;</span>,</div>
<div class="line"><a name="l00349"></a><span class="lineno">  349</span>&#160;      <span class="stringliteral">&#39;pipe-format&#39;</span> =&gt; <span class="stringliteral">&#39;csv&#39;</span>,</div>
<div class="line"><a name="l00350"></a><span class="lineno">  350</span>&#160;      <span class="stringliteral">&#39;field-labels&#39;</span> =&gt; array(<span class="stringliteral">&#39;label&#39;</span> =&gt; <span class="stringliteral">&#39;Label&#39;</span>, <span class="stringliteral">&#39;description&#39;</span> =&gt; <span class="stringliteral">&#39;Description&#39;</span>),</div>
<div class="line"><a name="l00351"></a><span class="lineno">  351</span>&#160;      <span class="stringliteral">&#39;output-data-type&#39;</span> =&gt; <span class="stringliteral">&#39;format-table&#39;</span>,</div>
<div class="line"><a name="l00352"></a><span class="lineno">  352</span>&#160;    ),</div>
<div class="line"><a name="l00353"></a><span class="lineno">  353</span>&#160;  );</div>
<div class="line"><a name="l00354"></a><span class="lineno">  354</span>&#160;  $items[<span class="stringliteral">&#39;core-quick-drupal&#39;</span>] = array(</div>
<div class="line"><a name="l00355"></a><span class="lineno">  355</span>&#160;    <span class="stringliteral">&#39;description&#39;</span> =&gt; <span class="stringliteral">&#39;Download, install, serve and login to Drupal with minimal configuration and dependencies.&#39;</span>,</div>
<div class="line"><a name="l00356"></a><span class="lineno">  356</span>&#160;    <span class="stringliteral">&#39;bootstrap&#39;</span> =&gt; DRUSH_BOOTSTRAP_NONE,</div>
<div class="line"><a name="l00357"></a><span class="lineno">  357</span>&#160;    <span class="stringliteral">&#39;aliases&#39;</span> =&gt; array(<span class="stringliteral">&#39;qd&#39;</span>, <span class="stringliteral">&#39;cutie&#39;</span>),</div>
<div class="line"><a name="l00358"></a><span class="lineno">  358</span>&#160;    <span class="stringliteral">&#39;arguments&#39;</span> =&gt; array(</div>
<div class="line"><a name="l00359"></a><span class="lineno">  359</span>&#160;      <span class="stringliteral">&#39;site&#39;</span> =&gt; <span class="stringliteral">&#39;Short name for the site to be created - used as a directory name and as sqlite file name. Optional - if omitted timestamped &quot;quick-drupal&quot; directory will be used instead.&#39;</span>,</div>
<div class="line"><a name="l00360"></a><span class="lineno">  360</span>&#160;      <span class="stringliteral">&#39;projects&#39;</span> =&gt; <span class="stringliteral">&#39;A list of projects to download into the new site. If projects contain extensions (modules or themes) with the same name they will be enabled by default. See --enable option to control this behaviour further.&#39;</span>,</div>
<div class="line"><a name="l00361"></a><span class="lineno">  361</span>&#160;    ),</div>
<div class="line"><a name="l00362"></a><span class="lineno">  362</span>&#160;    <span class="stringliteral">&#39;examples&#39;</span> =&gt; array(</div>
<div class="line"><a name="l00363"></a><span class="lineno">  363</span>&#160;      <span class="stringliteral">&#39;drush qd&#39;</span> =&gt; <span class="stringliteral">&#39;Download and install stable release of Drupal into a timestamped directory, start server, and open the site logged in as admin.&#39;</span>,</div>
<div class="line"><a name="l00364"></a><span class="lineno">  364</span>&#160;      <span class="stringliteral">&#39;drush qd --profile=minimal --cache --core=drupal-8.0.x --yes&#39;</span> =&gt; <span class="stringliteral">&#39;Fire up dev release of Drupal site with minimal install profile.&#39;</span>,</div>
<div class="line"><a name="l00365"></a><span class="lineno">  365</span>&#160;      <span class="stringliteral">&#39;drush qd testsite devel --server=:8081/admin --browser=firefox --cache --yes&#39;</span> =&gt; <span class="stringliteral">&#39;Fire up stable release (using the cache) of Drupal site called &quot;testsite&quot;, download and enable devel module, start a server on port 8081 and open /admin in firefox.&#39;</span>,</div>
<div class="line"><a name="l00366"></a><span class="lineno">  366</span>&#160;      <span class="stringliteral">&#39;drush qd commercesite --core=commerce_kickstart --profile=commerce_kickstart --cache --yes --watchdog&#39;</span> =&gt; <span class="stringliteral">&#39;Download and install the &quot;Commerce Kickstart&quot; distribution/install profile, display watchdog messages on the server console.&#39;</span>,</div>
<div class="line"><a name="l00367"></a><span class="lineno">  367</span>&#160;      <span class="stringliteral">&#39;drush qd --makefile=mysite.make&#39;</span> =&gt; <span class="stringliteral">&#39;Create and install a site from a makefile.&#39;</span>,</div>
<div class="line"><a name="l00368"></a><span class="lineno">  368</span>&#160;    ),</div>
<div class="line"><a name="l00369"></a><span class="lineno">  369</span>&#160;  );</div>
<div class="line"><a name="l00370"></a><span class="lineno">  370</span>&#160;  <span class="comment">// Add in options/engines.</span></div>
<div class="line"><a name="l00371"></a><span class="lineno">  371</span>&#160;  <a class="code" href="core_8drush_8inc.html#a15db942a3ad909cf9b3d7d3ffaf78ac9">drush_core_quick_drupal_options</a>($items);</div>
<div class="line"><a name="l00372"></a><span class="lineno">  372</span>&#160;  <span class="comment">// Add in topics for engines</span></div>
<div class="line"><a name="l00373"></a><span class="lineno">  373</span>&#160;  $items += <a class="code" href="engines_8inc.html#ad7c7ef01f88180e6010e2d2cbb24b347">drush_get_engine_topics</a>();</div>
<div class="line"><a name="l00374"></a><span class="lineno">  374</span>&#160;  <span class="keywordflow">return</span> $items;</div>
<div class="line"><a name="l00375"></a><span class="lineno">  375</span>&#160;}</div>
<div class="line"><a name="l00376"></a><span class="lineno">  376</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00377"></a><span class="lineno">  377</span>&#160;<span class="comment">/**</span></div>
<div class="line"><a name="l00378"></a><span class="lineno">  378</span>&#160;<span class="comment"> * Command argument complete callback.</span></div>
<div class="line"><a name="l00379"></a><span class="lineno">  379</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00380"></a><span class="lineno">  380</span>&#160;<span class="comment"> * @return</span></div>
<div class="line"><a name="l00381"></a><span class="lineno">  381</span>&#160;<span class="comment"> *   Array of available profile names.</span></div>
<div class="line"><a name="l00382"></a><span class="lineno">  382</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l00383"></a><span class="lineno"><a class="code" href="core_8drush_8inc.html#acb8d761c0357c377a517a7336c1e4352">  383</a></span>&#160;<span class="keyword">function</span> <a class="code" href="core_8drush_8inc.html#acb8d761c0357c377a517a7336c1e4352">core_site_install_complete</a>() {</div>
<div class="line"><a name="l00384"></a><span class="lineno">  384</span>&#160;  $max = drush_bootstrap_max(DRUSH_BOOTSTRAP_DRUPAL_ROOT);</div>
<div class="line"><a name="l00385"></a><span class="lineno">  385</span>&#160;  <span class="keywordflow">if</span> ($max &gt;= DRUSH_BOOTSTRAP_DRUPAL_ROOT) {</div>
<div class="line"><a name="l00386"></a><span class="lineno">  386</span>&#160;    <span class="keywordflow">return</span> array(<span class="stringliteral">&#39;values&#39;</span> =&gt; array_keys(drush_find_profiles(DRUPAL_ROOT)));</div>
<div class="line"><a name="l00387"></a><span class="lineno">  387</span>&#160;  }</div>
<div class="line"><a name="l00388"></a><span class="lineno">  388</span>&#160;}</div>
<div class="line"><a name="l00389"></a><span class="lineno">  389</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00390"></a><span class="lineno">  390</span>&#160;<span class="comment">/**</span></div>
<div class="line"><a name="l00391"></a><span class="lineno">  391</span>&#160;<span class="comment"> * Command argument complete callback.</span></div>
<div class="line"><a name="l00392"></a><span class="lineno">  392</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00393"></a><span class="lineno">  393</span>&#160;<span class="comment"> * @return</span></div>
<div class="line"><a name="l00394"></a><span class="lineno">  394</span>&#160;<span class="comment"> *  Array of available site aliases.</span></div>
<div class="line"><a name="l00395"></a><span class="lineno">  395</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l00396"></a><span class="lineno"><a class="code" href="core_8drush_8inc.html#a2a2d7804784871fbbc8b14699d17b79c">  396</a></span>&#160;<span class="keyword">function</span> <a class="code" href="core_8drush_8inc.html#a2a2d7804784871fbbc8b14699d17b79c">core_core_rsync_complete</a>() {</div>
<div class="line"><a name="l00397"></a><span class="lineno">  397</span>&#160;  <span class="keywordflow">return</span> array(<span class="stringliteral">&#39;values&#39;</span> =&gt; array_keys(<a class="code" href="sitealias_8drush_8inc.html#ab84f25812ecd477686e6fa349503ed8d">_drush_sitealias_all_list</a>()));</div>
<div class="line"><a name="l00398"></a><span class="lineno">  398</span>&#160;}</div>
<div class="line"><a name="l00399"></a><span class="lineno">  399</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00400"></a><span class="lineno">  400</span>&#160;<span class="comment">/**</span></div>
<div class="line"><a name="l00401"></a><span class="lineno">  401</span>&#160;<span class="comment"> * @defgroup engines Engine types</span></div>
<div class="line"><a name="l00402"></a><span class="lineno">  402</span>&#160;<span class="comment"> * @{</span></div>
<div class="line"><a name="l00403"></a><span class="lineno">  403</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l00404"></a><span class="lineno">  404</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00405"></a><span class="lineno">  405</span>&#160;<span class="comment">/**</span></div>
<div class="line"><a name="l00406"></a><span class="lineno">  406</span>&#160;<span class="comment"> * Implementation of hook_drush_engine_type_info().</span></div>
<div class="line"><a name="l00407"></a><span class="lineno">  407</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l00408"></a><span class="lineno"><a class="code" href="group__engines.html#ga9d03fdbc78d29494d4433b6dbe74e857">  408</a></span>&#160;<span class="keyword">function</span> <a class="code" href="group__engines.html#ga9d03fdbc78d29494d4433b6dbe74e857">core_drush_engine_type_info</a>() {</div>
<div class="line"><a name="l00409"></a><span class="lineno">  409</span>&#160;  $info = array();</div>
<div class="line"><a name="l00410"></a><span class="lineno">  410</span>&#160;  $info[<span class="stringliteral">&#39;drupal&#39;</span>] = array();</div>
<div class="line"><a name="l00411"></a><span class="lineno">  411</span>&#160;  <span class="keywordflow">return</span> $info;</div>
<div class="line"><a name="l00412"></a><span class="lineno">  412</span>&#160;}</div>
<div class="line"><a name="l00413"></a><span class="lineno">  413</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00414"></a><span class="lineno">  414</span>&#160;<span class="comment">/**</span></div>
<div class="line"><a name="l00415"></a><span class="lineno">  415</span>&#160;<span class="comment"> * Implements hook_drush_engine_ENGINE_TYPE().</span></div>
<div class="line"><a name="l00416"></a><span class="lineno">  416</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l00417"></a><span class="lineno"><a class="code" href="group__engines.html#gad167f8f919914c95171867fdc12cd6e8">  417</a></span>&#160;<span class="keyword">function</span> <a class="code" href="group__engines.html#gad167f8f919914c95171867fdc12cd6e8">core_drush_engine_drupal</a>() {</div>
<div class="line"><a name="l00418"></a><span class="lineno">  418</span>&#160;  $engines = array(</div>
<div class="line"><a name="l00419"></a><span class="lineno">  419</span>&#160;    <span class="stringliteral">&#39;batch&#39;</span> =&gt; array(),</div>
<div class="line"><a name="l00420"></a><span class="lineno">  420</span>&#160;    <span class="stringliteral">&#39;update&#39;</span>=&gt; array(),</div>
<div class="line"><a name="l00421"></a><span class="lineno">  421</span>&#160;    <span class="stringliteral">&#39;environment&#39;</span> =&gt; array(),</div>
<div class="line"><a name="l00422"></a><span class="lineno">  422</span>&#160;    <span class="stringliteral">&#39;site_install&#39;</span> =&gt; array(),</div>
<div class="line"><a name="l00423"></a><span class="lineno">  423</span>&#160;    <span class="stringliteral">&#39;pm&#39;</span> =&gt; array(),</div>
<div class="line"><a name="l00424"></a><span class="lineno">  424</span>&#160;    <span class="stringliteral">&#39;cache&#39;</span> =&gt; array(),</div>
<div class="line"><a name="l00425"></a><span class="lineno">  425</span>&#160;    <span class="stringliteral">&#39;image&#39;</span> =&gt; array(),</div>
<div class="line"><a name="l00426"></a><span class="lineno">  426</span>&#160;  );</div>
<div class="line"><a name="l00427"></a><span class="lineno">  427</span>&#160;  <span class="keywordflow">return</span> $engines;</div>
<div class="line"><a name="l00428"></a><span class="lineno">  428</span>&#160;}</div>
<div class="line"><a name="l00429"></a><span class="lineno">  429</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00430"></a><span class="lineno">  430</span>&#160;<span class="comment">/**</span></div>
<div class="line"><a name="l00431"></a><span class="lineno">  431</span>&#160;<span class="comment"> * @} End of &quot;Engine types&quot;.</span></div>
<div class="line"><a name="l00432"></a><span class="lineno">  432</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l00433"></a><span class="lineno">  433</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00434"></a><span class="lineno">  434</span>&#160;<span class="comment">/**</span></div>
<div class="line"><a name="l00435"></a><span class="lineno">  435</span>&#160;<span class="comment"> * Command handler. Apply pending entity schema updates.</span></div>
<div class="line"><a name="l00436"></a><span class="lineno">  436</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l00437"></a><span class="lineno"><a class="code" href="core_8drush_8inc.html#af9e3ee874296f0d45567d5e4eb08e25a">  437</a></span>&#160;<span class="keyword">function</span> <a class="code" href="core_8drush_8inc.html#af9e3ee874296f0d45567d5e4eb08e25a">drush_core_entity_updates</a>() {</div>
<div class="line"><a name="l00438"></a><span class="lineno">  438</span>&#160;  <span class="keywordflow">if</span> (<a class="code" href="context_8inc.html#ad25559f8d7d753f636fbeac347c29fc5">drush_get_context</a>(<span class="stringliteral">&#39;DRUSH_SIMULATE&#39;</span>)) {</div>
<div class="line"><a name="l00439"></a><span class="lineno">  439</span>&#160;    <a class="code" href="group__logging.html#ga47324b65808524558a488916b150dd51">drush_log</a>(<a class="code" href="group__outputfunctions.html#ga1218abcb1e27dd3bb412113d1e344d96">dt</a>(<span class="stringliteral">&#39;entity-updates command does not support --simulate option.&#39;</span>), LogLevel::OK);</div>
<div class="line"><a name="l00440"></a><span class="lineno">  440</span>&#160;  }</div>
<div class="line"><a name="l00441"></a><span class="lineno">  441</span>&#160;</div>
<div class="line"><a name="l00442"></a><span class="lineno">  442</span>&#160;  <a class="code" href="engines_8inc.html#a92390a2dd40c8ed5190be4af058813a8">drush_include_engine</a>(<span class="stringliteral">&#39;drupal&#39;</span>, <span class="stringliteral">&#39;update&#39;</span>);</div>
<div class="line"><a name="l00443"></a><span class="lineno">  443</span>&#160;  <span class="keywordflow">if</span> (<a class="code" href="update_8inc.html#a32ab583b70acb38949ea75843692b3ed">entity_updates_main</a>() === FALSE) {</div>
<div class="line"><a name="l00444"></a><span class="lineno">  444</span>&#160;    <span class="keywordflow">return</span> FALSE;</div>
<div class="line"><a name="l00445"></a><span class="lineno">  445</span>&#160;  }</div>
<div class="line"><a name="l00446"></a><span class="lineno">  446</span>&#160;</div>
<div class="line"><a name="l00447"></a><span class="lineno">  447</span>&#160;  drush_drupal_cache_clear_all();</div>
<div class="line"><a name="l00448"></a><span class="lineno">  448</span>&#160;</div>
<div class="line"><a name="l00449"></a><span class="lineno">  449</span>&#160;  <a class="code" href="group__logging.html#ga47324b65808524558a488916b150dd51">drush_log</a>(<a class="code" href="group__outputfunctions.html#ga1218abcb1e27dd3bb412113d1e344d96">dt</a>(<span class="stringliteral">&#39;Finished performing updates.&#39;</span>), LogLevel::OK);</div>
<div class="line"><a name="l00450"></a><span class="lineno">  450</span>&#160;}</div>
<div class="line"><a name="l00451"></a><span class="lineno">  451</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00452"></a><span class="lineno">  452</span>&#160;<span class="comment">/**</span></div>
<div class="line"><a name="l00453"></a><span class="lineno">  453</span>&#160;<span class="comment"> * Command handler. Execute update.php code from drush.</span></div>
<div class="line"><a name="l00454"></a><span class="lineno">  454</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l00455"></a><span class="lineno"><a class="code" href="core_8drush_8inc.html#a496a7a4d064f54c13fc03c1c6e2844f4">  455</a></span>&#160;<span class="keyword">function</span> <a class="code" href="core_8drush_8inc.html#a496a7a4d064f54c13fc03c1c6e2844f4">drush_core_updatedb</a>() {</div>
<div class="line"><a name="l00456"></a><span class="lineno">  456</span>&#160;  <span class="keywordflow">if</span> (<a class="code" href="context_8inc.html#ad25559f8d7d753f636fbeac347c29fc5">drush_get_context</a>(<span class="stringliteral">&#39;DRUSH_SIMULATE&#39;</span>)) {</div>
<div class="line"><a name="l00457"></a><span class="lineno">  457</span>&#160;    <a class="code" href="group__logging.html#ga47324b65808524558a488916b150dd51">drush_log</a>(<a class="code" href="group__outputfunctions.html#ga1218abcb1e27dd3bb412113d1e344d96">dt</a>(<span class="stringliteral">&#39;updatedb command does not support --simulate option.&#39;</span>), LogLevel::OK);</div>
<div class="line"><a name="l00458"></a><span class="lineno">  458</span>&#160;    <span class="keywordflow">return</span> TRUE;</div>
<div class="line"><a name="l00459"></a><span class="lineno">  459</span>&#160;  }</div>
<div class="line"><a name="l00460"></a><span class="lineno">  460</span>&#160;</div>
<div class="line"><a name="l00461"></a><span class="lineno">  461</span>&#160;  <a class="code" href="engines_8inc.html#a92390a2dd40c8ed5190be4af058813a8">drush_include_engine</a>(<span class="stringliteral">&#39;drupal&#39;</span>, <span class="stringliteral">&#39;update&#39;</span>);</div>
<div class="line"><a name="l00462"></a><span class="lineno">  462</span>&#160;  $result = update_main();</div>
<div class="line"><a name="l00463"></a><span class="lineno">  463</span>&#160;  <span class="keywordflow">if</span> ($result === FALSE) {</div>
<div class="line"><a name="l00464"></a><span class="lineno">  464</span>&#160;    <span class="keywordflow">return</span> FALSE;</div>
<div class="line"><a name="l00465"></a><span class="lineno">  465</span>&#160;  }</div>
<div class="line"><a name="l00466"></a><span class="lineno">  466</span>&#160;  elseif ($result &gt; 0) {</div>
<div class="line"><a name="l00467"></a><span class="lineno">  467</span>&#160;    <span class="comment">// Clear all caches in a new process. We just performed major surgery.</span></div>
<div class="line"><a name="l00468"></a><span class="lineno">  468</span>&#160;    drush_drupal_cache_clear_all();</div>
<div class="line"><a name="l00469"></a><span class="lineno">  469</span>&#160;</div>
<div class="line"><a name="l00470"></a><span class="lineno">  470</span>&#160;    <a class="code" href="group__logging.html#ga47324b65808524558a488916b150dd51">drush_log</a>(<a class="code" href="group__outputfunctions.html#ga1218abcb1e27dd3bb412113d1e344d96">dt</a>(<span class="stringliteral">&#39;Finished performing updates.&#39;</span>), LogLevel::OK);</div>
<div class="line"><a name="l00471"></a><span class="lineno">  471</span>&#160;  }</div>
<div class="line"><a name="l00472"></a><span class="lineno">  472</span>&#160;}</div>
<div class="line"><a name="l00473"></a><span class="lineno">  473</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00474"></a><span class="lineno">  474</span>&#160;<span class="comment">/**</span></div>
<div class="line"><a name="l00475"></a><span class="lineno">  475</span>&#160;<span class="comment"> * Command handler. List pending DB updates.</span></div>
<div class="line"><a name="l00476"></a><span class="lineno">  476</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l00477"></a><span class="lineno"><a class="code" href="core_8drush_8inc.html#aefd8feb109bb44eb6543dbd18f64b91b">  477</a></span>&#160;<span class="keyword">function</span> <a class="code" href="core_8drush_8inc.html#aefd8feb109bb44eb6543dbd18f64b91b">drush_core_updatedb_status</a>() {</div>
<div class="line"><a name="l00478"></a><span class="lineno">  478</span>&#160;  require_once DRUSH_DRUPAL_CORE . <span class="stringliteral">&#39;/includes/install.inc&#39;</span>;</div>
<div class="line"><a name="l00479"></a><span class="lineno">  479</span>&#160;  drupal_load_updates();</div>
<div class="line"><a name="l00480"></a><span class="lineno">  480</span>&#160;  <a class="code" href="engines_8inc.html#a92390a2dd40c8ed5190be4af058813a8">drush_include_engine</a>(<span class="stringliteral">&#39;drupal&#39;</span>, <span class="stringliteral">&#39;update&#39;</span>);</div>
<div class="line"><a name="l00481"></a><span class="lineno">  481</span>&#160;  list($pending, $start) = <a class="code" href="update_8inc.html#ad074fc63b51c042f4d752543db9ad0e6">updatedb_status</a>();</div>
<div class="line"><a name="l00482"></a><span class="lineno">  482</span>&#160;  <span class="keywordflow">if</span> (empty($pending)) {</div>
<div class="line"><a name="l00483"></a><span class="lineno">  483</span>&#160;    <a class="code" href="group__logging.html#ga47324b65808524558a488916b150dd51">drush_log</a>(<a class="code" href="group__outputfunctions.html#ga1218abcb1e27dd3bb412113d1e344d96">dt</a>(<span class="stringliteral">&quot;No database updates required&quot;</span>), LogLevel::OK);</div>
<div class="line"><a name="l00484"></a><span class="lineno">  484</span>&#160;  }</div>
<div class="line"><a name="l00485"></a><span class="lineno">  485</span>&#160;  <span class="keywordflow">return</span> $pending;</div>
<div class="line"><a name="l00486"></a><span class="lineno">  486</span>&#160;}</div>
<div class="line"><a name="l00487"></a><span class="lineno">  487</span>&#160;</div>
<div class="line"><a name="l00488"></a><span class="lineno">  488</span>&#160;<span class="keyword">function</span> _core_site_credentials($right_margin = 0) {</div>
<div class="line"><a name="l00489"></a><span class="lineno">  489</span>&#160;  <span class="comment">// Leave some space on the right so that we can put the result into the</span></div>
<div class="line"><a name="l00490"></a><span class="lineno">  490</span>&#160;  <span class="comment">// drush_log, which will again wordwrap the result.</span></div>
<div class="line"><a name="l00491"></a><span class="lineno">  491</span>&#160;  $original_columns = <a class="code" href="context_8inc.html#ad25559f8d7d753f636fbeac347c29fc5">drush_get_context</a>(<span class="stringliteral">&#39;DRUSH_COLUMNS&#39;</span>, 80);</div>
<div class="line"><a name="l00492"></a><span class="lineno">  492</span>&#160;  <a class="code" href="context_8inc.html#af983acfe90e7d7bbdbd67c57f93708ba">drush_set_context</a>(<span class="stringliteral">&#39;DRUSH_COLUMNS&#39;</span>, $original_columns - $right_margin);</div>
<div class="line"><a name="l00493"></a><span class="lineno">  493</span>&#160;  $status_table = _core_site_status_table();</div>
<div class="line"><a name="l00494"></a><span class="lineno">  494</span>&#160;  $metadata = <a class="code" href="outputformat_8drush_8inc.html#a4a9cc3871032fba8891b665d2606dcc0">drush_get_command_format_metadata</a>(<span class="stringliteral">&#39;core-status&#39;</span>);</div>
<div class="line"><a name="l00495"></a><span class="lineno">  495</span>&#160;  $output = <a class="code" href="group__outputfunctions.html#ga9949217d2df2776bd355c4a3d50bba79">drush_format</a>($status_table, $metadata, <span class="stringliteral">&#39;key-value&#39;</span>);</div>
<div class="line"><a name="l00496"></a><span class="lineno">  496</span>&#160;  <a class="code" href="context_8inc.html#af983acfe90e7d7bbdbd67c57f93708ba">drush_set_context</a>(<span class="stringliteral">&#39;DRUSH_COLUMNS&#39;</span>, $original_columns);</div>
<div class="line"><a name="l00497"></a><span class="lineno">  497</span>&#160;  <span class="keywordflow">return</span> $output;</div>
<div class="line"><a name="l00498"></a><span class="lineno">  498</span>&#160;}</div>
<div class="line"><a name="l00499"></a><span class="lineno">  499</span>&#160;</div>
<div class="line"><a name="l00500"></a><span class="lineno">  500</span>&#160;<span class="keyword">function</span> _core_path_aliases($project = <span class="stringliteral">&#39;&#39;</span>) {</div>
<div class="line"><a name="l00501"></a><span class="lineno">  501</span>&#160;  $paths = array();</div>
<div class="line"><a name="l00502"></a><span class="lineno">  502</span>&#160;  $site_wide = <a class="code" href="includes_2environment_8inc.html#a6f651473a044c97c2a17e63e6455d08e">drush_drupal_sitewide_directory</a>();</div>
<div class="line"><a name="l00503"></a><span class="lineno">  503</span>&#160;  $boot = <a class="code" href="classDrush.html#aa0028a6c4611724e20f33169dd5147a6">\Drush::bootstrap</a>();</div>
<div class="line"><a name="l00504"></a><span class="lineno">  504</span>&#160;  <span class="keywordflow">if</span> ($drupal_root = <a class="code" href="context_8inc.html#ad25559f8d7d753f636fbeac347c29fc5">drush_get_context</a>(<span class="stringliteral">&#39;DRUSH_DRUPAL_ROOT&#39;</span>)) {</div>
<div class="line"><a name="l00505"></a><span class="lineno">  505</span>&#160;    $paths[<span class="stringliteral">&#39;%root&#39;</span>] = $drupal_root;</div>
<div class="line"><a name="l00506"></a><span class="lineno">  506</span>&#160;    <span class="keywordflow">if</span> ($site_root = <a class="code" href="context_8inc.html#ad25559f8d7d753f636fbeac347c29fc5">drush_get_context</a>(<span class="stringliteral">&#39;DRUSH_DRUPAL_SITE_ROOT&#39;</span>)) {</div>
<div class="line"><a name="l00507"></a><span class="lineno">  507</span>&#160;      $paths[<span class="stringliteral">&#39;%site&#39;</span>] = $site_root;</div>
<div class="line"><a name="l00508"></a><span class="lineno">  508</span>&#160;      <span class="keywordflow">if</span> (is_dir($modules_path = $boot-&gt;conf_path() . <span class="stringliteral">&#39;/modules&#39;</span>)) {</div>
<div class="line"><a name="l00509"></a><span class="lineno">  509</span>&#160;        $paths[<span class="stringliteral">&#39;%modules&#39;</span>] = $modules_path;</div>
<div class="line"><a name="l00510"></a><span class="lineno">  510</span>&#160;      }</div>
<div class="line"><a name="l00511"></a><span class="lineno">  511</span>&#160;      <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00512"></a><span class="lineno">  512</span>&#160;        $paths[<span class="stringliteral">&#39;%modules&#39;</span>] = ltrim($site_wide . <span class="stringliteral">&#39;/modules&#39;</span>, <span class="charliteral">&#39;/&#39;</span>);</div>
<div class="line"><a name="l00513"></a><span class="lineno">  513</span>&#160;      }</div>
<div class="line"><a name="l00514"></a><span class="lineno">  514</span>&#160;      <span class="keywordflow">if</span> (is_dir($themes_path = $boot-&gt;conf_path() . <span class="stringliteral">&#39;/themes&#39;</span>)) {</div>
<div class="line"><a name="l00515"></a><span class="lineno">  515</span>&#160;        $paths[<span class="stringliteral">&#39;%themes&#39;</span>] = $themes_path;</div>
<div class="line"><a name="l00516"></a><span class="lineno">  516</span>&#160;      }</div>
<div class="line"><a name="l00517"></a><span class="lineno">  517</span>&#160;      <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00518"></a><span class="lineno">  518</span>&#160;        $paths[<span class="stringliteral">&#39;%themes&#39;</span>] = ltrim($site_wide . <span class="stringliteral">&#39;/themes&#39;</span>, <span class="charliteral">&#39;/&#39;</span>);</div>
<div class="line"><a name="l00519"></a><span class="lineno">  519</span>&#160;      }</div>
<div class="line"><a name="l00520"></a><span class="lineno">  520</span>&#160;      <span class="keywordflow">if</span> (<a class="code" href="drupal_8inc.html#ad2ccab77d4bc8e7355186f26cd328ac0">drush_drupal_major_version</a>() &gt;= 8 &amp;&amp; drush_has_boostrapped(DRUSH_BOOTSTRAP_DRUPAL_CONFIGURATION)) {</div>
<div class="line"><a name="l00521"></a><span class="lineno">  521</span>&#160;        <span class="keywordflow">try</span> {</div>
<div class="line"><a name="l00522"></a><span class="lineno">  522</span>&#160;          <span class="keywordflow">if</span> (isset($GLOBALS[<span class="stringliteral">&#39;config_directories&#39;</span>])) {</div>
<div class="line"><a name="l00523"></a><span class="lineno">  523</span>&#160;            <span class="keywordflow">foreach</span> ($GLOBALS[<span class="stringliteral">&#39;config_directories&#39;</span>] as $label =&gt; $unused) {</div>
<div class="line"><a name="l00524"></a><span class="lineno">  524</span>&#160;              $paths[<span class="stringliteral">&quot;%config-$label&quot;</span>] = config_get_config_directory($label);</div>
<div class="line"><a name="l00525"></a><span class="lineno">  525</span>&#160;            }</div>
<div class="line"><a name="l00526"></a><span class="lineno">  526</span>&#160;          }</div>
<div class="line"><a name="l00527"></a><span class="lineno">  527</span>&#160;        }</div>
<div class="line"><a name="l00528"></a><span class="lineno">  528</span>&#160;        <span class="keywordflow">catch</span> (Exception $e) {</div>
<div class="line"><a name="l00529"></a><span class="lineno">  529</span>&#160;          <span class="comment">// Nothing to do.</span></div>
<div class="line"><a name="l00530"></a><span class="lineno">  530</span>&#160;        }</div>
<div class="line"><a name="l00531"></a><span class="lineno">  531</span>&#160;      }</div>
<div class="line"><a name="l00532"></a><span class="lineno">  532</span>&#160;</div>
<div class="line"><a name="l00533"></a><span class="lineno">  533</span>&#160;      <span class="keywordflow">if</span> (drush_has_boostrapped(DRUSH_BOOTSTRAP_DRUPAL_FULL)) {</div>
<div class="line"><a name="l00534"></a><span class="lineno">  534</span>&#160;        $paths[<span class="stringliteral">&#39;%files&#39;</span>] = <a class="code" href="includes_2environment_8inc.html#aec9b1fcb95f06fe8101c3deb3e5d0be0">drush_file_get_public</a>();</div>
<div class="line"><a name="l00535"></a><span class="lineno">  535</span>&#160;        <span class="keywordflow">if</span> ($private_path = <a class="code" href="includes_2environment_8inc.html#a222673d87e8d1364deecea540731945f">drush_file_get_private</a>()) {</div>
<div class="line"><a name="l00536"></a><span class="lineno">  536</span>&#160;          $paths[<span class="stringliteral">&#39;%private&#39;</span>] = $private_path;</div>
<div class="line"><a name="l00537"></a><span class="lineno">  537</span>&#160;        }</div>
<div class="line"><a name="l00538"></a><span class="lineno">  538</span>&#160;      }</div>
<div class="line"><a name="l00539"></a><span class="lineno">  539</span>&#160;</div>
<div class="line"><a name="l00540"></a><span class="lineno">  540</span>&#160;      <span class="keywordflow">if</span> (function_exists(<span class="stringliteral">&#39;file_directory_temp&#39;</span>)) {</div>
<div class="line"><a name="l00541"></a><span class="lineno">  541</span>&#160;        $paths[<span class="stringliteral">&#39;%temp&#39;</span>] = file_directory_temp();</div>
<div class="line"><a name="l00542"></a><span class="lineno">  542</span>&#160;      }</div>
<div class="line"><a name="l00543"></a><span class="lineno">  543</span>&#160;      <span class="comment">// If the &#39;project&#39; parameter was specified, then search</span></div>
<div class="line"><a name="l00544"></a><span class="lineno">  544</span>&#160;      <span class="comment">// for a project (or a few) and add its path to the path list</span></div>
<div class="line"><a name="l00545"></a><span class="lineno">  545</span>&#160;      <span class="keywordflow">if</span> (!empty($project)) {</div>
<div class="line"><a name="l00546"></a><span class="lineno">  546</span>&#160;        <a class="code" href="engines_8inc.html#a92390a2dd40c8ed5190be4af058813a8">drush_include_engine</a>(<span class="stringliteral">&#39;drupal&#39;</span>, <span class="stringliteral">&#39;environment&#39;</span>);</div>
<div class="line"><a name="l00547"></a><span class="lineno">  547</span>&#160;        $projects = array_merge(<a class="code" href="commands_2core_2drupal_2environment_8inc.html#a7bab407b662383206abfd7d40e129e10">drush_get_modules</a>(), <a class="code" href="commands_2core_2drupal_2environment_8inc.html#ad5a30ae04efcc0bd416f2c555bb7c144">drush_get_themes</a>());</div>
<div class="line"><a name="l00548"></a><span class="lineno">  548</span>&#160;        <span class="keywordflow">foreach</span>(explode(<span class="charliteral">&#39;,&#39;</span>, $project) as $target) {</div>
<div class="line"><a name="l00549"></a><span class="lineno">  549</span>&#160;          <span class="keywordflow">if</span> (array_key_exists($target, $projects)) {</div>
<div class="line"><a name="l00550"></a><span class="lineno">  550</span>&#160;            $paths[<span class="charliteral">&#39;%&#39;</span> . $target] = $drupal_root . <span class="charliteral">&#39;/&#39;</span> . <a class="code" href="commands_2core_2drupal_2environment_8inc.html#a3a2d23907fbfa722e287ccadd5fe49ae">_drush_extension_get_path</a>($projects[$target]);</div>
<div class="line"><a name="l00551"></a><span class="lineno">  551</span>&#160;          }</div>
<div class="line"><a name="l00552"></a><span class="lineno">  552</span>&#160;        }</div>
<div class="line"><a name="l00553"></a><span class="lineno">  553</span>&#160;      }</div>
<div class="line"><a name="l00554"></a><span class="lineno">  554</span>&#160;    }</div>
<div class="line"><a name="l00555"></a><span class="lineno">  555</span>&#160;  }</div>
<div class="line"><a name="l00556"></a><span class="lineno">  556</span>&#160;</div>
<div class="line"><a name="l00557"></a><span class="lineno">  557</span>&#160;  <span class="comment">// Add in all of the global paths from $options[&#39;path-aliases&#39;]</span></div>
<div class="line"><a name="l00558"></a><span class="lineno">  558</span>&#160;  $paths = array_merge($paths, <a class="code" href="context_8inc.html#afe91fb3e5219ecb2208c3b036b1f0cb8">drush_get_option</a>(<span class="stringliteral">&#39;path-aliases&#39;</span>, array()));</div>
<div class="line"><a name="l00559"></a><span class="lineno">  559</span>&#160;</div>
<div class="line"><a name="l00560"></a><span class="lineno">  560</span>&#160;  <span class="keywordflow">return</span> $paths;</div>
<div class="line"><a name="l00561"></a><span class="lineno">  561</span>&#160;}</div>
<div class="line"><a name="l00562"></a><span class="lineno">  562</span>&#160;</div>
<div class="line"><a name="l00563"></a><span class="lineno">  563</span>&#160;<span class="keyword">function</span> _core_site_status_table($project = <span class="stringliteral">&#39;&#39;</span>) {</div>
<div class="line"><a name="l00564"></a><span class="lineno">  564</span>&#160;  $phase = <a class="code" href="context_8inc.html#ad25559f8d7d753f636fbeac347c29fc5">drush_get_context</a>(<span class="stringliteral">&#39;DRUSH_BOOTSTRAP_PHASE&#39;</span>);</div>
<div class="line"><a name="l00565"></a><span class="lineno">  565</span>&#160;  <span class="keywordflow">if</span> ($drupal_root = <a class="code" href="context_8inc.html#ad25559f8d7d753f636fbeac347c29fc5">drush_get_context</a>(<span class="stringliteral">&#39;DRUSH_DRUPAL_ROOT&#39;</span>)) {</div>
<div class="line"><a name="l00566"></a><span class="lineno">  566</span>&#160;    $status_table[<span class="stringliteral">&#39;drupal-version&#39;</span>] = <a class="code" href="drupal_8inc.html#a203e989fd043d054d774954e2b2dff21">drush_drupal_version</a>();</div>
<div class="line"><a name="l00567"></a><span class="lineno">  567</span>&#160;    $boot_object = <a class="code" href="classDrush.html#aa0028a6c4611724e20f33169dd5147a6">\Drush::bootstrap</a>();</div>
<div class="line"><a name="l00568"></a><span class="lineno">  568</span>&#160;    $conf_dir = $boot_object-&gt;conf_path();</div>
<div class="line"><a name="l00569"></a><span class="lineno">  569</span>&#160;    $settings_file = <span class="stringliteral">&quot;$conf_dir/settings.php&quot;</span>;</div>
<div class="line"><a name="l00570"></a><span class="lineno">  570</span>&#160;    $status_table[<span class="stringliteral">&#39;drupal-settings-file&#39;</span>] = file_exists($settings_file) ? $settings_file : <span class="stringliteral">&#39;&#39;</span>;</div>
<div class="line"><a name="l00571"></a><span class="lineno">  571</span>&#160;    <span class="keywordflow">if</span> ($site_root = <a class="code" href="context_8inc.html#ad25559f8d7d753f636fbeac347c29fc5">drush_get_context</a>(<span class="stringliteral">&#39;DRUSH_DRUPAL_SITE_ROOT&#39;</span>)) {</div>
<div class="line"><a name="l00572"></a><span class="lineno">  572</span>&#160;      $status_table[<span class="stringliteral">&#39;uri&#39;</span>] = <a class="code" href="context_8inc.html#ad25559f8d7d753f636fbeac347c29fc5">drush_get_context</a>(<span class="stringliteral">&#39;DRUSH_URI&#39;</span>);</div>
<div class="line"><a name="l00573"></a><span class="lineno">  573</span>&#160;      <span class="keywordflow">try</span> {</div>
<div class="line"><a name="l00574"></a><span class="lineno">  574</span>&#160;        $sql = <a class="code" href="sql_8drush_8inc.html#a828cf565e2e7e569e41c3fbe8a8e0cf0">drush_sql_get_class</a>();</div>
<div class="line"><a name="l00575"></a><span class="lineno">  575</span>&#160;        $db_spec = $sql-&gt;db_spec();</div>
<div class="line"><a name="l00576"></a><span class="lineno">  576</span>&#160;        $status_table[<span class="stringliteral">&#39;db-driver&#39;</span>] = $db_spec[<span class="stringliteral">&#39;driver&#39;</span>];</div>
<div class="line"><a name="l00577"></a><span class="lineno">  577</span>&#160;        <span class="keywordflow">if</span> (!empty($db_spec[<span class="stringliteral">&#39;unix_socket&#39;</span>])) {</div>
<div class="line"><a name="l00578"></a><span class="lineno">  578</span>&#160;          $status_table[<span class="stringliteral">&#39;db-socket&#39;</span>] = $db_spec[<span class="stringliteral">&#39;unix_socket&#39;</span>];</div>
<div class="line"><a name="l00579"></a><span class="lineno">  579</span>&#160;        }</div>
<div class="line"><a name="l00580"></a><span class="lineno">  580</span>&#160;        elseif (isset($db_spec[<span class="stringliteral">&#39;host&#39;</span>])) {</div>
<div class="line"><a name="l00581"></a><span class="lineno">  581</span>&#160;          $status_table[<span class="stringliteral">&#39;db-hostname&#39;</span>] = $db_spec[<span class="stringliteral">&#39;host&#39;</span>];</div>
<div class="line"><a name="l00582"></a><span class="lineno">  582</span>&#160;        }</div>
<div class="line"><a name="l00583"></a><span class="lineno">  583</span>&#160;        $status_table[<span class="stringliteral">&#39;db-username&#39;</span>] = isset($db_spec[<span class="stringliteral">&#39;username&#39;</span>]) ? $db_spec[<span class="stringliteral">&#39;username&#39;</span>] : NULL;</div>
<div class="line"><a name="l00584"></a><span class="lineno">  584</span>&#160;        $status_table[<span class="stringliteral">&#39;db-password&#39;</span>] = isset($db_spec[<span class="stringliteral">&#39;password&#39;</span>]) ? $db_spec[<span class="stringliteral">&#39;password&#39;</span>] : NULL;</div>
<div class="line"><a name="l00585"></a><span class="lineno">  585</span>&#160;        $status_table[<span class="stringliteral">&#39;db-name&#39;</span>] = isset($db_spec[<span class="stringliteral">&#39;database&#39;</span>]) ? $db_spec[<span class="stringliteral">&#39;database&#39;</span>] : NULL;</div>
<div class="line"><a name="l00586"></a><span class="lineno">  586</span>&#160;        $status_table[<span class="stringliteral">&#39;db-port&#39;</span>] = isset($db_spec[<span class="stringliteral">&#39;port&#39;</span>]) ? $db_spec[<span class="stringliteral">&#39;port&#39;</span>] : NULL;</div>
<div class="line"><a name="l00587"></a><span class="lineno">  587</span>&#160;        <span class="keywordflow">if</span> ($phase &gt; DRUSH_BOOTSTRAP_DRUPAL_CONFIGURATION) {</div>
<div class="line"><a name="l00588"></a><span class="lineno">  588</span>&#160;          $status_table[<span class="stringliteral">&#39;install-profile&#39;</span>] = $boot_object-&gt;get_profile();</div>
<div class="line"><a name="l00589"></a><span class="lineno">  589</span>&#160;          <span class="keywordflow">if</span> ($phase &gt; DRUSH_BOOTSTRAP_DRUPAL_DATABASE) {</div>
<div class="line"><a name="l00590"></a><span class="lineno">  590</span>&#160;            $status_table[<span class="stringliteral">&#39;db-status&#39;</span>] = <a class="code" href="group__outputfunctions.html#ga1218abcb1e27dd3bb412113d1e344d96">dt</a>(<span class="stringliteral">&#39;Connected&#39;</span>);</div>
<div class="line"><a name="l00591"></a><span class="lineno">  591</span>&#160;            <span class="keywordflow">if</span> ($phase &gt; DRUSH_BOOTSTRAP_DRUPAL_FULL) {</div>
<div class="line"><a name="l00592"></a><span class="lineno">  592</span>&#160;              $status_table[<span class="stringliteral">&#39;bootstrap&#39;</span>] = <a class="code" href="group__outputfunctions.html#ga1218abcb1e27dd3bb412113d1e344d96">dt</a>(<span class="stringliteral">&#39;Successful&#39;</span>);</div>
<div class="line"><a name="l00593"></a><span class="lineno">  593</span>&#160;              <span class="keywordflow">if</span> ($phase == DRUSH_BOOTSTRAP_DRUPAL_LOGIN) {</div>
<div class="line"><a name="l00594"></a><span class="lineno">  594</span>&#160;                $status_table[<span class="stringliteral">&#39;user&#39;</span>] = <a class="code" href="user_8drush_8inc.html#a9391875688c0d7b0ba392d6e0adbe704">drush_user_get_class</a>()-&gt;getCurrentUserAsSingle()-&gt;getUsername();</div>
<div class="line"><a name="l00595"></a><span class="lineno">  595</span>&#160;              }</div>
<div class="line"><a name="l00596"></a><span class="lineno">  596</span>&#160;            }</div>
<div class="line"><a name="l00597"></a><span class="lineno">  597</span>&#160;          }</div>
<div class="line"><a name="l00598"></a><span class="lineno">  598</span>&#160;        }</div>
<div class="line"><a name="l00599"></a><span class="lineno">  599</span>&#160;      }</div>
<div class="line"><a name="l00600"></a><span class="lineno">  600</span>&#160;      <span class="keywordflow">catch</span> (Exception $e) {</div>
<div class="line"><a name="l00601"></a><span class="lineno">  601</span>&#160;        <span class="comment">// Don&#39;t worry be happy.</span></div>
<div class="line"><a name="l00602"></a><span class="lineno">  602</span>&#160;      }</div>
<div class="line"><a name="l00603"></a><span class="lineno">  603</span>&#160;    }</div>
<div class="line"><a name="l00604"></a><span class="lineno">  604</span>&#160;    <span class="keywordflow">if</span> (drush_has_boostrapped(DRUSH_BOOTSTRAP_DRUPAL_FULL)) {</div>
<div class="line"><a name="l00605"></a><span class="lineno">  605</span>&#160;      $status_table[<span class="stringliteral">&#39;theme&#39;</span>] = <a class="code" href="includes_2environment_8inc.html#a57dd90a056796e9c5cd43b9c0ddb8f3e">drush_theme_get_default</a>();</div>
<div class="line"><a name="l00606"></a><span class="lineno">  606</span>&#160;      $status_table[<span class="stringliteral">&#39;admin-theme&#39;</span>] = <a class="code" href="includes_2environment_8inc.html#a53d271b99022c85e63b4b47015d47341">drush_theme_get_admin</a>();</div>
<div class="line"><a name="l00607"></a><span class="lineno">  607</span>&#160;    }</div>
<div class="line"><a name="l00608"></a><span class="lineno">  608</span>&#160;  }</div>
<div class="line"><a name="l00609"></a><span class="lineno">  609</span>&#160;  <span class="keywordflow">if</span> ($php_bin = <a class="code" href="context_8inc.html#afe91fb3e5219ecb2208c3b036b1f0cb8">drush_get_option</a>(<span class="stringliteral">&#39;php&#39;</span>)) {</div>
<div class="line"><a name="l00610"></a><span class="lineno">  610</span>&#160;    $status_table[<span class="stringliteral">&#39;php-bin&#39;</span>] = $php_bin;</div>
<div class="line"><a name="l00611"></a><span class="lineno">  611</span>&#160;  }</div>
<div class="line"><a name="l00612"></a><span class="lineno">  612</span>&#160;  $status_table[<span class="stringliteral">&#39;php-os&#39;</span>] = PHP_OS;</div>
<div class="line"><a name="l00613"></a><span class="lineno">  613</span>&#160;  <span class="keywordflow">if</span> ($php_ini_files = _drush_core_config_php_ini_files()) {</div>
<div class="line"><a name="l00614"></a><span class="lineno">  614</span>&#160;    $status_table[<span class="stringliteral">&#39;php-conf&#39;</span>] = $php_ini_files;</div>
<div class="line"><a name="l00615"></a><span class="lineno">  615</span>&#160;  }</div>
<div class="line"><a name="l00616"></a><span class="lineno">  616</span>&#160;  $status_table[<span class="stringliteral">&#39;drush-script&#39;</span>] = DRUSH_COMMAND;</div>
<div class="line"><a name="l00617"></a><span class="lineno">  617</span>&#160;  $status_table[<span class="stringliteral">&#39;drush-version&#39;</span>] = <a class="code" href="classDrush.html#a7fd94bdcfdc97722498b22f8c901d866">Drush::getVersion</a>();</div>
<div class="line"><a name="l00618"></a><span class="lineno">  618</span>&#160;  $status_table[<span class="stringliteral">&#39;drush-temp&#39;</span>] = <a class="code" href="group__filesystemfunctions.html#gad1036a8fb12d105b55de87b4f3fe8002">drush_find_tmp</a>();</div>
<div class="line"><a name="l00619"></a><span class="lineno">  619</span>&#160;  $status_table[<span class="stringliteral">&#39;drush-conf&#39;</span>] = <a class="code" href="drush_8inc.html#ad5c64f6b9992f47ec358e1ad820c36f9">drush_flatten_array</a>(<a class="code" href="context_8inc.html#ae7691e4635dc346aae09eb3f0bbd6092">drush_get_context_options</a>(<span class="stringliteral">&#39;context-path&#39;</span>, <span class="stringliteral">&#39;&#39;</span>));</div>
<div class="line"><a name="l00620"></a><span class="lineno">  620</span>&#160;  $alias_files = <a class="code" href="sitealias_8inc.html#a9ccbaf4417b01e474a01db9c985fb103">_drush_sitealias_find_alias_files</a>();</div>
<div class="line"><a name="l00621"></a><span class="lineno">  621</span>&#160;  $status_table[<span class="stringliteral">&#39;drush-alias-files&#39;</span>] = $alias_files;</div>
<div class="line"><a name="l00622"></a><span class="lineno">  622</span>&#160;</div>
<div class="line"><a name="l00623"></a><span class="lineno">  623</span>&#160;  $paths = _core_path_aliases($project);</div>
<div class="line"><a name="l00624"></a><span class="lineno">  624</span>&#160;  <span class="keywordflow">if</span> (!empty($paths)) {</div>
<div class="line"><a name="l00625"></a><span class="lineno">  625</span>&#160;    <span class="keywordflow">foreach</span> ($paths as $target =&gt; $one_path) {</div>
<div class="line"><a name="l00626"></a><span class="lineno">  626</span>&#160;      $name = $target;</div>
<div class="line"><a name="l00627"></a><span class="lineno">  627</span>&#160;      <span class="keywordflow">if</span> (substr($name,0,1) == <span class="charliteral">&#39;%&#39;</span>) {</div>
<div class="line"><a name="l00628"></a><span class="lineno">  628</span>&#160;        $name = substr($name,1);</div>
<div class="line"><a name="l00629"></a><span class="lineno">  629</span>&#160;      }</div>
<div class="line"><a name="l00630"></a><span class="lineno">  630</span>&#160;      $status_table[$name] = $one_path;</div>
<div class="line"><a name="l00631"></a><span class="lineno">  631</span>&#160;    }</div>
<div class="line"><a name="l00632"></a><span class="lineno">  632</span>&#160;  }</div>
<div class="line"><a name="l00633"></a><span class="lineno">  633</span>&#160;</div>
<div class="line"><a name="l00634"></a><span class="lineno">  634</span>&#160;  <span class="comment">// Store the paths into the &#39;%paths&#39; index; this will be</span></div>
<div class="line"><a name="l00635"></a><span class="lineno">  635</span>&#160;  <span class="comment">// used by other code, but will not be included in the output</span></div>
<div class="line"><a name="l00636"></a><span class="lineno">  636</span>&#160;  <span class="comment">// of the drush status command.</span></div>
<div class="line"><a name="l00637"></a><span class="lineno">  637</span>&#160;  $status_table[<span class="stringliteral">&#39;%paths&#39;</span>] = $paths;</div>
<div class="line"><a name="l00638"></a><span class="lineno">  638</span>&#160;</div>
<div class="line"><a name="l00639"></a><span class="lineno">  639</span>&#160;  <span class="keywordflow">return</span> $status_table;</div>
<div class="line"><a name="l00640"></a><span class="lineno">  640</span>&#160;}</div>
<div class="line"><a name="l00641"></a><span class="lineno">  641</span>&#160;</div>
<div class="line"><a name="l00642"></a><span class="lineno">  642</span>&#160;<span class="comment">// Adjust the status output for any non-pipe output format</span></div>
<div class="line"><a name="l00643"></a><span class="lineno">  643</span>&#160;<span class="keyword">function</span> _drush_core_status_format_table_data($output, $metadata) {</div>
<div class="line"><a name="l00644"></a><span class="lineno">  644</span>&#160;  <span class="keywordflow">if</span> (<a class="code" href="context_8inc.html#afe91fb3e5219ecb2208c3b036b1f0cb8">drush_get_option</a>(<span class="stringliteral">&#39;full&#39;</span>, FALSE) == FALSE) {</div>
<div class="line"><a name="l00645"></a><span class="lineno">  645</span>&#160;    <span class="comment">// Hide any key that begins with a %</span></div>
<div class="line"><a name="l00646"></a><span class="lineno">  646</span>&#160;    <span class="keywordflow">foreach</span> ($output as $key =&gt; $value) {</div>
<div class="line"><a name="l00647"></a><span class="lineno">  647</span>&#160;      <span class="keywordflow">if</span> ($key[0] == <span class="charliteral">&#39;%&#39;</span>) {</div>
<div class="line"><a name="l00648"></a><span class="lineno">  648</span>&#160;        unset($output[$key]);</div>
<div class="line"><a name="l00649"></a><span class="lineno">  649</span>&#160;      }</div>
<div class="line"><a name="l00650"></a><span class="lineno">  650</span>&#160;    }</div>
<div class="line"><a name="l00651"></a><span class="lineno">  651</span>&#160;    <span class="comment">// Hide &#39;Modules path&#39; and &#39;Themes path&#39; as well</span></div>
<div class="line"><a name="l00652"></a><span class="lineno">  652</span>&#160;    unset($output[<span class="stringliteral">&#39;modules&#39;</span>]);</div>
<div class="line"><a name="l00653"></a><span class="lineno">  653</span>&#160;    unset($output[<span class="stringliteral">&#39;themes&#39;</span>]);</div>
<div class="line"><a name="l00654"></a><span class="lineno">  654</span>&#160;    <span class="comment">// Shorten the list of alias files if there are too many</span></div>
<div class="line"><a name="l00655"></a><span class="lineno">  655</span>&#160;    <span class="keywordflow">if</span> (isset($output[<span class="stringliteral">&#39;drush-alias-files&#39;</span>]) &amp;&amp; count($output[<span class="stringliteral">&#39;drush-alias-files&#39;</span>]) &gt; 24) {</div>
<div class="line"><a name="l00656"></a><span class="lineno">  656</span>&#160;      $msg = <a class="code" href="group__outputfunctions.html#ga1218abcb1e27dd3bb412113d1e344d96">dt</a>(<span class="stringliteral">&quot;\nThere are !count more alias files. Run with --full to see the full list.&quot;</span>, array(<span class="stringliteral">&#39;!count&#39;</span> =&gt; count($output[<span class="stringliteral">&#39;drush-alias-files&#39;</span>]) - 1));</div>
<div class="line"><a name="l00657"></a><span class="lineno">  657</span>&#160;      $output[<span class="stringliteral">&#39;drush-alias-files&#39;</span>] = array($output[<span class="stringliteral">&#39;drush-alias-files&#39;</span>][0] , $msg);</div>
<div class="line"><a name="l00658"></a><span class="lineno">  658</span>&#160;    }</div>
<div class="line"><a name="l00659"></a><span class="lineno">  659</span>&#160;    <span class="keywordflow">if</span> (isset($output[<span class="stringliteral">&#39;drupal-settings-file&#39;</span>]) &amp;&amp; empty($output[<span class="stringliteral">&#39;drupal-settings-file&#39;</span>])) {</div>
<div class="line"><a name="l00660"></a><span class="lineno">  660</span>&#160;      $output[<span class="stringliteral">&#39;drupal-settings-file&#39;</span>] = <a class="code" href="group__outputfunctions.html#ga1218abcb1e27dd3bb412113d1e344d96">dt</a>(<span class="stringliteral">&#39;MISSING&#39;</span>);</div>
<div class="line"><a name="l00661"></a><span class="lineno">  661</span>&#160;    }</div>
<div class="line"><a name="l00662"></a><span class="lineno">  662</span>&#160;  }</div>
<div class="line"><a name="l00663"></a><span class="lineno">  663</span>&#160;  <span class="keywordflow">return</span> $output;</div>
<div class="line"><a name="l00664"></a><span class="lineno">  664</span>&#160;}</div>
<div class="line"><a name="l00665"></a><span class="lineno">  665</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00666"></a><span class="lineno">  666</span>&#160;<span class="comment">/**</span></div>
<div class="line"><a name="l00667"></a><span class="lineno">  667</span>&#160;<span class="comment"> * Command callback. Runs all cron hooks.</span></div>
<div class="line"><a name="l00668"></a><span class="lineno">  668</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l00669"></a><span class="lineno"><a class="code" href="core_8drush_8inc.html#aa4653becec42d140691bb014e52e8145">  669</a></span>&#160;<span class="keyword">function</span> <a class="code" href="core_8drush_8inc.html#aa4653becec42d140691bb014e52e8145">drush_core_cron</a>() {</div>
<div class="line"><a name="l00670"></a><span class="lineno">  670</span>&#160;  <span class="keywordflow">if</span> (<a class="code" href="drupal_8inc.html#ad2ccab77d4bc8e7355186f26cd328ac0">drush_drupal_major_version</a>() &lt; 8) {</div>
<div class="line"><a name="l00671"></a><span class="lineno">  671</span>&#160;    $result = drupal_cron_run();</div>
<div class="line"><a name="l00672"></a><span class="lineno">  672</span>&#160;  }</div>
<div class="line"><a name="l00673"></a><span class="lineno">  673</span>&#160;  <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00674"></a><span class="lineno">  674</span>&#160;    $result = \Drupal::service(<span class="stringliteral">&#39;cron&#39;</span>)-&gt;run();</div>
<div class="line"><a name="l00675"></a><span class="lineno">  675</span>&#160;  }</div>
<div class="line"><a name="l00676"></a><span class="lineno">  676</span>&#160;  <span class="keywordflow">if</span> ($result) {</div>
<div class="line"><a name="l00677"></a><span class="lineno">  677</span>&#160;    <a class="code" href="group__logging.html#ga47324b65808524558a488916b150dd51">drush_log</a>(<a class="code" href="group__outputfunctions.html#ga1218abcb1e27dd3bb412113d1e344d96">dt</a>(<span class="stringliteral">&#39;Cron run successful.&#39;</span>), LogLevel::SUCCESS);</div>
<div class="line"><a name="l00678"></a><span class="lineno">  678</span>&#160;  }</div>
<div class="line"><a name="l00679"></a><span class="lineno">  679</span>&#160;  <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00680"></a><span class="lineno">  680</span>&#160;    <span class="keywordflow">return</span> <a class="code" href="group__errorhandling.html#ga23fe9e1e8c1e5ade39256106044b6da4">drush_set_error</a>(<span class="stringliteral">&#39;DRUSH_CRON_FAILED&#39;</span>, <a class="code" href="group__outputfunctions.html#ga1218abcb1e27dd3bb412113d1e344d96">dt</a>(<span class="stringliteral">&#39;Cron run failed.&#39;</span>));</div>
<div class="line"><a name="l00681"></a><span class="lineno">  681</span>&#160;  }</div>
<div class="line"><a name="l00682"></a><span class="lineno">  682</span>&#160;}</div>
<div class="line"><a name="l00683"></a><span class="lineno">  683</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00684"></a><span class="lineno">  684</span>&#160;<span class="comment">/**</span></div>
<div class="line"><a name="l00685"></a><span class="lineno">  685</span>&#160;<span class="comment"> * Command callback. Edit drushrc and alias files.</span></div>
<div class="line"><a name="l00686"></a><span class="lineno">  686</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l00687"></a><span class="lineno"><a class="code" href="core_8drush_8inc.html#a7f88afe2a5459be981ef1cfa4a60af65">  687</a></span>&#160;<span class="keyword">function</span> <a class="code" href="core_8drush_8inc.html#a7f88afe2a5459be981ef1cfa4a60af65">drush_core_config</a>($filter = NULL) {</div>
<div class="line"><a name="l00688"></a><span class="lineno">  688</span>&#160;  $all = drush_core_config_load();</div>
<div class="line"><a name="l00689"></a><span class="lineno">  689</span>&#160;</div>
<div class="line"><a name="l00690"></a><span class="lineno">  690</span>&#160;  <span class="comment">// Apply any filter that was supplied.</span></div>
<div class="line"><a name="l00691"></a><span class="lineno">  691</span>&#160;  <span class="keywordflow">if</span> ($filter) {</div>
<div class="line"><a name="l00692"></a><span class="lineno">  692</span>&#160;    <span class="keywordflow">foreach</span> ($all as $key =&gt; $file) {</div>
<div class="line"><a name="l00693"></a><span class="lineno">  693</span>&#160;      <span class="keywordflow">if</span> (strpos($file, $filter) === FALSE) {</div>
<div class="line"><a name="l00694"></a><span class="lineno">  694</span>&#160;        unset($all[$key]);</div>
<div class="line"><a name="l00695"></a><span class="lineno">  695</span>&#160;      }</div>
<div class="line"><a name="l00696"></a><span class="lineno">  696</span>&#160;    }</div>
<div class="line"><a name="l00697"></a><span class="lineno">  697</span>&#160;  }</div>
<div class="line"><a name="l00698"></a><span class="lineno">  698</span>&#160;  $all = <a class="code" href="drush_8inc.html#ad847f03f1d1c046f9eb472aafa56137c">drush_map_assoc</a>(array_values($all));</div>
<div class="line"><a name="l00699"></a><span class="lineno">  699</span>&#160;</div>
<div class="line"><a name="l00700"></a><span class="lineno">  700</span>&#160;  $exec = <a class="code" href="group__commandwrappers.html#ga516aab026be224e57d9fc0fe9c3de79f">drush_get_editor</a>();</div>
<div class="line"><a name="l00701"></a><span class="lineno">  701</span>&#160;  <span class="keywordflow">if</span> (count($all) == 1) {</div>
<div class="line"><a name="l00702"></a><span class="lineno">  702</span>&#160;    $filepath = current($all);</div>
<div class="line"><a name="l00703"></a><span class="lineno">  703</span>&#160;  }</div>
<div class="line"><a name="l00704"></a><span class="lineno">  704</span>&#160;  <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00705"></a><span class="lineno">  705</span>&#160;    $choice = <a class="code" href="group__userinput.html#ga7e823bcd58051b17e6e5601340f0c784">drush_choice</a>($all, <span class="stringliteral">&#39;Enter a number to choose which file to edit.&#39;</span>, <span class="stringliteral">&#39;!key&#39;</span>);</div>
<div class="line"><a name="l00706"></a><span class="lineno">  706</span>&#160;    <span class="keywordflow">if</span> (!$choice) {</div>
<div class="line"><a name="l00707"></a><span class="lineno">  707</span>&#160;      <span class="keywordflow">return</span> <a class="code" href="group__errorhandling.html#ga366aaafdf8c774a58653c64a65b6d91c">drush_user_abort</a>();</div>
<div class="line"><a name="l00708"></a><span class="lineno">  708</span>&#160;    }</div>
<div class="line"><a name="l00709"></a><span class="lineno">  709</span>&#160;    $filepath = $all[$choice];</div>
<div class="line"><a name="l00710"></a><span class="lineno">  710</span>&#160;  }</div>
<div class="line"><a name="l00711"></a><span class="lineno">  711</span>&#160;  <span class="keywordflow">return</span> <a class="code" href="group__commandwrappers.html#gad0b72e62d81d339d68dc2d3d36db75d6">drush_shell_exec_interactive</a>($exec, $filepath, $filepath);</div>
<div class="line"><a name="l00712"></a><span class="lineno">  712</span>&#160;}</div>
<div class="line"><a name="l00713"></a><span class="lineno">  713</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00714"></a><span class="lineno">  714</span>&#160;<span class="comment">/**</span></div>
<div class="line"><a name="l00715"></a><span class="lineno">  715</span>&#160;<span class="comment"> * Command argument complete callback.</span></div>
<div class="line"><a name="l00716"></a><span class="lineno">  716</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00717"></a><span class="lineno">  717</span>&#160;<span class="comment"> * @return</span></div>
<div class="line"><a name="l00718"></a><span class="lineno">  718</span>&#160;<span class="comment"> *   Array of available configuration files for editing.</span></div>
<div class="line"><a name="l00719"></a><span class="lineno">  719</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l00720"></a><span class="lineno"><a class="code" href="core_8drush_8inc.html#ae52899c6a63327872020143464aa3191">  720</a></span>&#160;<span class="keyword">function</span> <a class="code" href="core_8drush_8inc.html#ae52899c6a63327872020143464aa3191">core_core_config_complete</a>() {</div>
<div class="line"><a name="l00721"></a><span class="lineno">  721</span>&#160;  <span class="keywordflow">return</span> array(<span class="stringliteral">&#39;values&#39;</span> =&gt; drush_core_config_load(FALSE));</div>
<div class="line"><a name="l00722"></a><span class="lineno">  722</span>&#160;}</div>
<div class="line"><a name="l00723"></a><span class="lineno">  723</span>&#160;</div>
<div class="line"><a name="l00724"></a><span class="lineno">  724</span>&#160;<span class="keyword">function</span> drush_core_config_load($headers = TRUE) {</div>
<div class="line"><a name="l00725"></a><span class="lineno">  725</span>&#160;  $php_header = $php = $rcs_header = $rcs = $aliases_header = $aliases = $drupal_header = $drupal = array();</div>
<div class="line"><a name="l00726"></a><span class="lineno">  726</span>&#160;  $php = _drush_core_config_php_ini_files();</div>
<div class="line"><a name="l00727"></a><span class="lineno">  727</span>&#160;  <span class="keywordflow">if</span> (!empty($php)) {</div>
<div class="line"><a name="l00728"></a><span class="lineno">  728</span>&#160;    <span class="keywordflow">if</span> ($headers) {</div>
<div class="line"><a name="l00729"></a><span class="lineno">  729</span>&#160;      $php_header = array(<span class="stringliteral">&#39;phpini&#39;</span> =&gt; <span class="stringliteral">&#39;-- PHP ini files --&#39;</span>);</div>
<div class="line"><a name="l00730"></a><span class="lineno">  730</span>&#160;    }</div>
<div class="line"><a name="l00731"></a><span class="lineno">  731</span>&#160;  }</div>
<div class="line"><a name="l00732"></a><span class="lineno">  732</span>&#160;</div>
<div class="line"><a name="l00733"></a><span class="lineno">  733</span>&#160;  $bash = _drush_core_config_bash_files();</div>
<div class="line"><a name="l00734"></a><span class="lineno">  734</span>&#160;  <span class="keywordflow">if</span> (!empty($bash)) {</div>
<div class="line"><a name="l00735"></a><span class="lineno">  735</span>&#160;    <span class="keywordflow">if</span> ($headers) {</div>
<div class="line"><a name="l00736"></a><span class="lineno">  736</span>&#160;      $bash_header = array(<span class="stringliteral">&#39;bash&#39;</span> =&gt; <span class="stringliteral">&#39;-- Bash files --&#39;</span>);</div>
<div class="line"><a name="l00737"></a><span class="lineno">  737</span>&#160;    }</div>
<div class="line"><a name="l00738"></a><span class="lineno">  738</span>&#160;  }</div>
<div class="line"><a name="l00739"></a><span class="lineno">  739</span>&#160;</div>
<div class="line"><a name="l00740"></a><span class="lineno">  740</span>&#160;  <a class="code" href="sitealias_8inc.html#a1313cf54d1c18ec59bcc91127becc166">drush_sitealias_load_all</a>();</div>
<div class="line"><a name="l00741"></a><span class="lineno">  741</span>&#160;  <span class="keywordflow">if</span> ($rcs = <a class="code" href="context_8inc.html#ae7691e4635dc346aae09eb3f0bbd6092">drush_get_context_options</a>(<span class="stringliteral">&#39;context-path&#39;</span>, TRUE)) {</div>
<div class="line"><a name="l00742"></a><span class="lineno">  742</span>&#160;    <span class="keywordflow">if</span> ($headers) {</div>
<div class="line"><a name="l00743"></a><span class="lineno">  743</span>&#160;      $rcs_header = array(<span class="stringliteral">&#39;drushrc&#39;</span> =&gt; <span class="stringliteral">&#39;-- Drushrc --&#39;</span>);</div>
<div class="line"><a name="l00744"></a><span class="lineno">  744</span>&#160;    }</div>
<div class="line"><a name="l00745"></a><span class="lineno">  745</span>&#160;  }</div>
<div class="line"><a name="l00746"></a><span class="lineno">  746</span>&#160;  <span class="keywordflow">if</span> ($aliases = <a class="code" href="context_8inc.html#ad25559f8d7d753f636fbeac347c29fc5">drush_get_context</a>(<span class="stringliteral">&#39;drush-alias-files&#39;</span>)) {</div>
<div class="line"><a name="l00747"></a><span class="lineno">  747</span>&#160;    <span class="keywordflow">if</span> ($headers) {</div>
<div class="line"><a name="l00748"></a><span class="lineno">  748</span>&#160;      $aliases_header = array(<span class="stringliteral">&#39;aliases&#39;</span> =&gt; <span class="stringliteral">&#39;-- Aliases --&#39;</span>);</div>
<div class="line"><a name="l00749"></a><span class="lineno">  749</span>&#160;    }</div>
<div class="line"><a name="l00750"></a><span class="lineno">  750</span>&#160;  }</div>
<div class="line"><a name="l00751"></a><span class="lineno">  751</span>&#160;  <span class="keywordflow">if</span> ($site_root = <a class="code" href="context_8inc.html#ad25559f8d7d753f636fbeac347c29fc5">drush_get_context</a>(<span class="stringliteral">&#39;DRUSH_DRUPAL_SITE_ROOT&#39;</span>)) {</div>
<div class="line"><a name="l00752"></a><span class="lineno">  752</span>&#160;    $drupal[] = realpath($site_root . <span class="stringliteral">&#39;/settings.php&#39;</span>);</div>
<div class="line"><a name="l00753"></a><span class="lineno">  753</span>&#160;    <span class="keywordflow">if</span> (file_exists($site_root . <span class="stringliteral">&#39;/settings.local.php&#39;</span>)) {</div>
<div class="line"><a name="l00754"></a><span class="lineno">  754</span>&#160;      $drupal[] = realpath($site_root . <span class="stringliteral">&#39;/settings.local.php&#39;</span>);</div>
<div class="line"><a name="l00755"></a><span class="lineno">  755</span>&#160;    }</div>
<div class="line"><a name="l00756"></a><span class="lineno">  756</span>&#160;    $drupal[] = realpath(DRUPAL_ROOT . <span class="stringliteral">&#39;/.htaccess&#39;</span>);</div>
<div class="line"><a name="l00757"></a><span class="lineno">  757</span>&#160;    <span class="keywordflow">if</span> ($headers) {</div>
<div class="line"><a name="l00758"></a><span class="lineno">  758</span>&#160;      $drupal_header = array(<span class="stringliteral">&#39;drupal&#39;</span> =&gt; <span class="stringliteral">&#39;-- Drupal --&#39;</span>);</div>
<div class="line"><a name="l00759"></a><span class="lineno">  759</span>&#160;    }</div>
<div class="line"><a name="l00760"></a><span class="lineno">  760</span>&#160;  }</div>
<div class="line"><a name="l00761"></a><span class="lineno">  761</span>&#160;  <span class="keywordflow">return</span> array_merge($php_header, $php, $bash_header, $bash, $rcs_header, $rcs, $aliases_header, $aliases, $drupal_header, $drupal);</div>
<div class="line"><a name="l00762"></a><span class="lineno">  762</span>&#160;}</div>
<div class="line"><a name="l00763"></a><span class="lineno">  763</span>&#160;</div>
<div class="line"><a name="l00764"></a><span class="lineno">  764</span>&#160;<span class="keyword">function</span> _drush_core_config_php_ini_files() {</div>
<div class="line"><a name="l00765"></a><span class="lineno">  765</span>&#160;  $ini_files = array();</div>
<div class="line"><a name="l00766"></a><span class="lineno">  766</span>&#160;  $ini_files[] = php_ini_loaded_file();</div>
<div class="line"><a name="l00767"></a><span class="lineno">  767</span>&#160;  <span class="keywordflow">if</span> ($drush_ini = getenv(<span class="stringliteral">&#39;DRUSH_INI&#39;</span>)) {</div>
<div class="line"><a name="l00768"></a><span class="lineno">  768</span>&#160;    <span class="keywordflow">if</span> (file_exists($drush_ini)) {</div>
<div class="line"><a name="l00769"></a><span class="lineno">  769</span>&#160;      $ini_files[] = $drush_ini;</div>
<div class="line"><a name="l00770"></a><span class="lineno">  770</span>&#160;    }</div>
<div class="line"><a name="l00771"></a><span class="lineno">  771</span>&#160;  }</div>
<div class="line"><a name="l00772"></a><span class="lineno">  772</span>&#160;  <span class="keywordflow">foreach</span> (array(DRUSH_BASE_PATH, <span class="stringliteral">&#39;/etc/drush&#39;</span>, <a class="code" href="includes_2environment_8inc.html#afae6d4a5a12623e5502ca262346c799b">drush_server_home</a>() . <span class="stringliteral">&#39;/.drush&#39;</span>) as $ini_dir) {</div>
<div class="line"><a name="l00773"></a><span class="lineno">  773</span>&#160;    <span class="keywordflow">if</span> (file_exists($ini_dir . <span class="stringliteral">&quot;/drush.ini&quot;</span>)) {</div>
<div class="line"><a name="l00774"></a><span class="lineno">  774</span>&#160;      $ini_files[] = realpath($ini_dir . <span class="stringliteral">&quot;/drush.ini&quot;</span>);</div>
<div class="line"><a name="l00775"></a><span class="lineno">  775</span>&#160;    }</div>
<div class="line"><a name="l00776"></a><span class="lineno">  776</span>&#160;  }</div>
<div class="line"><a name="l00777"></a><span class="lineno">  777</span>&#160;  <span class="keywordflow">return</span> array_unique($ini_files);</div>
<div class="line"><a name="l00778"></a><span class="lineno">  778</span>&#160;}</div>
<div class="line"><a name="l00779"></a><span class="lineno">  779</span>&#160;</div>
<div class="line"><a name="l00780"></a><span class="lineno">  780</span>&#160;<span class="keyword">function</span> _drush_core_config_bash_files() {</div>
<div class="line"><a name="l00781"></a><span class="lineno">  781</span>&#160;  $bash_files = array();</div>
<div class="line"><a name="l00782"></a><span class="lineno">  782</span>&#160;  $home = <a class="code" href="includes_2environment_8inc.html#afae6d4a5a12623e5502ca262346c799b">drush_server_home</a>();</div>
<div class="line"><a name="l00783"></a><span class="lineno">  783</span>&#160;  <span class="keywordflow">if</span> ($bashrc = drush_init_find_bashrc($home)) {</div>
<div class="line"><a name="l00784"></a><span class="lineno">  784</span>&#160;    $bash_files[] = $bashrc;</div>
<div class="line"><a name="l00785"></a><span class="lineno">  785</span>&#160;  }</div>
<div class="line"><a name="l00786"></a><span class="lineno">  786</span>&#160;  $prompt = $home . <span class="stringliteral">&#39;/.drush/drush.prompt.sh&#39;</span>;</div>
<div class="line"><a name="l00787"></a><span class="lineno">  787</span>&#160;  <span class="keywordflow">if</span> (file_exists($prompt)) {</div>
<div class="line"><a name="l00788"></a><span class="lineno">  788</span>&#160;    $bash_files[] = $prompt;</div>
<div class="line"><a name="l00789"></a><span class="lineno">  789</span>&#160;  }</div>
<div class="line"><a name="l00790"></a><span class="lineno">  790</span>&#160;  <span class="keywordflow">return</span> $bash_files;</div>
<div class="line"><a name="l00791"></a><span class="lineno">  791</span>&#160;}</div>
<div class="line"><a name="l00792"></a><span class="lineno">  792</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00793"></a><span class="lineno">  793</span>&#160;<span class="comment">/**</span></div>
<div class="line"><a name="l00794"></a><span class="lineno">  794</span>&#160;<span class="comment"> * Command callback. Provides information from the &#39;Status Reports&#39; admin page.</span></div>
<div class="line"><a name="l00795"></a><span class="lineno">  795</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l00796"></a><span class="lineno"><a class="code" href="core_8drush_8inc.html#adebaebb0b4f27f018d98cf29420de69f">  796</a></span>&#160;<span class="keyword">function</span> <a class="code" href="core_8drush_8inc.html#adebaebb0b4f27f018d98cf29420de69f">drush_core_requirements</a>() {</div>
<div class="line"><a name="l00797"></a><span class="lineno">  797</span>&#160;  include_once DRUSH_DRUPAL_CORE . <span class="stringliteral">&#39;/includes/install.inc&#39;</span>;</div>
<div class="line"><a name="l00798"></a><span class="lineno">  798</span>&#160;  $severities = array(</div>
<div class="line"><a name="l00799"></a><span class="lineno">  799</span>&#160;    REQUIREMENT_INFO =&gt; t(<span class="stringliteral">&#39;Info&#39;</span>),</div>
<div class="line"><a name="l00800"></a><span class="lineno">  800</span>&#160;    REQUIREMENT_OK =&gt; t(<span class="stringliteral">&#39;OK&#39;</span>),</div>
<div class="line"><a name="l00801"></a><span class="lineno">  801</span>&#160;    REQUIREMENT_WARNING =&gt; t(<span class="stringliteral">&#39;Warning&#39;</span>),</div>
<div class="line"><a name="l00802"></a><span class="lineno">  802</span>&#160;    REQUIREMENT_ERROR =&gt; t(<span class="stringliteral">&#39;Error&#39;</span>),</div>
<div class="line"><a name="l00803"></a><span class="lineno">  803</span>&#160;  );</div>
<div class="line"><a name="l00804"></a><span class="lineno">  804</span>&#160;</div>
<div class="line"><a name="l00805"></a><span class="lineno">  805</span>&#160;  drupal_load_updates();</div>
<div class="line"><a name="l00806"></a><span class="lineno">  806</span>&#160;</div>
<div class="line"><a name="l00807"></a><span class="lineno">  807</span>&#160;  <a class="code" href="engines_8inc.html#a92390a2dd40c8ed5190be4af058813a8">drush_include_engine</a>(<span class="stringliteral">&#39;drupal&#39;</span>, <span class="stringliteral">&#39;environment&#39;</span>);</div>
<div class="line"><a name="l00808"></a><span class="lineno">  808</span>&#160;  $requirements = <a class="code" href="commands_2core_2drupal_2environment_8inc.html#a28a5df4f4cf276afe3f24adb34035733">drush_module_invoke_all</a>(<span class="stringliteral">&#39;requirements&#39;</span>, <span class="stringliteral">&#39;runtime&#39;</span>);</div>
<div class="line"><a name="l00809"></a><span class="lineno">  809</span>&#160;  <span class="comment">// If a module uses &quot;$requirements[] = &quot; instead of</span></div>
<div class="line"><a name="l00810"></a><span class="lineno">  810</span>&#160;  <span class="comment">// &quot;$requirements[&#39;label&#39;] = &quot;, then build a label from</span></div>
<div class="line"><a name="l00811"></a><span class="lineno">  811</span>&#160;  <span class="comment">// the title.</span></div>
<div class="line"><a name="l00812"></a><span class="lineno">  812</span>&#160;  <span class="keywordflow">foreach</span>($requirements as $key =&gt; $info) {</div>
<div class="line"><a name="l00813"></a><span class="lineno">  813</span>&#160;    <span class="keywordflow">if</span> (is_numeric($key)) {</div>
<div class="line"><a name="l00814"></a><span class="lineno">  814</span>&#160;      unset($requirements[$key]);</div>
<div class="line"><a name="l00815"></a><span class="lineno">  815</span>&#160;      $new_key = strtolower(str_replace(<span class="charliteral">&#39; &#39;</span>, <span class="charliteral">&#39;_&#39;</span>, $info[<span class="stringliteral">&#39;title&#39;</span>]));</div>
<div class="line"><a name="l00816"></a><span class="lineno">  816</span>&#160;      $requirements[$new_key] = $info;</div>
<div class="line"><a name="l00817"></a><span class="lineno">  817</span>&#160;    }</div>
<div class="line"><a name="l00818"></a><span class="lineno">  818</span>&#160;  }</div>
<div class="line"><a name="l00819"></a><span class="lineno">  819</span>&#160;  $ignore_requirements = <a class="code" href="context_8inc.html#ade60e65f76863ed34db22f5e7f83a150">drush_get_option_list</a>(<span class="stringliteral">&#39;ignore&#39;</span>);</div>
<div class="line"><a name="l00820"></a><span class="lineno">  820</span>&#160;  <span class="keywordflow">foreach</span> ($ignore_requirements as $ignore) {</div>
<div class="line"><a name="l00821"></a><span class="lineno">  821</span>&#160;    unset($requirements[$ignore]);</div>
<div class="line"><a name="l00822"></a><span class="lineno">  822</span>&#160;  }</div>
<div class="line"><a name="l00823"></a><span class="lineno">  823</span>&#160;  ksort($requirements);</div>
<div class="line"><a name="l00824"></a><span class="lineno">  824</span>&#160;</div>
<div class="line"><a name="l00825"></a><span class="lineno">  825</span>&#160;  $min_severity = <a class="code" href="context_8inc.html#afe91fb3e5219ecb2208c3b036b1f0cb8">drush_get_option</a>(<span class="stringliteral">&#39;severity&#39;</span>, -1);</div>
<div class="line"><a name="l00826"></a><span class="lineno">  826</span>&#160;  <span class="keywordflow">foreach</span>($requirements as $key =&gt; $info) {</div>
<div class="line"><a name="l00827"></a><span class="lineno">  827</span>&#160;    $severity = array_key_exists(<span class="stringliteral">&#39;severity&#39;</span>, $info) ? $info[<span class="stringliteral">&#39;severity&#39;</span>] : -1;</div>
<div class="line"><a name="l00828"></a><span class="lineno">  828</span>&#160;    $requirements[$key][<span class="stringliteral">&#39;sid&#39;</span>] = $severity;</div>
<div class="line"><a name="l00829"></a><span class="lineno">  829</span>&#160;    $requirements[$key][<span class="stringliteral">&#39;severity&#39;</span>] = $severities[$severity];</div>
<div class="line"><a name="l00830"></a><span class="lineno">  830</span>&#160;    <span class="keywordflow">if</span> ($severity &lt; $min_severity) {</div>
<div class="line"><a name="l00831"></a><span class="lineno">  831</span>&#160;      unset($requirements[$key]);</div>
<div class="line"><a name="l00832"></a><span class="lineno">  832</span>&#160;    }</div>
<div class="line"><a name="l00833"></a><span class="lineno">  833</span>&#160;  }</div>
<div class="line"><a name="l00834"></a><span class="lineno">  834</span>&#160;  <span class="keywordflow">return</span> $requirements;</div>
<div class="line"><a name="l00835"></a><span class="lineno">  835</span>&#160;}</div>
<div class="line"><a name="l00836"></a><span class="lineno">  836</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00837"></a><span class="lineno">  837</span>&#160;<span class="comment">/**</span></div>
<div class="line"><a name="l00838"></a><span class="lineno">  838</span>&#160;<span class="comment"> * Command callback. Provides a birds-eye view of the current Drupal</span></div>
<div class="line"><a name="l00839"></a><span class="lineno">  839</span>&#160;<span class="comment"> * installation.</span></div>
<div class="line"><a name="l00840"></a><span class="lineno">  840</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l00841"></a><span class="lineno"><a class="code" href="core_8drush_8inc.html#aa7e3d1ac48eb92dab34abeb42f84cd3f">  841</a></span>&#160;<span class="keyword">function</span> <a class="code" href="core_8drush_8inc.html#aa7e3d1ac48eb92dab34abeb42f84cd3f">drush_core_status</a>() {</div>
<div class="line"><a name="l00842"></a><span class="lineno">  842</span>&#160;  $status_table = _core_site_status_table(<a class="code" href="context_8inc.html#afe91fb3e5219ecb2208c3b036b1f0cb8">drush_get_option</a>(<span class="stringliteral">&#39;project&#39;</span>,<span class="stringliteral">&#39;&#39;</span>));</div>
<div class="line"><a name="l00843"></a><span class="lineno">  843</span>&#160;  <span class="comment">// If args are specified, filter out any entry that is not named</span></div>
<div class="line"><a name="l00844"></a><span class="lineno">  844</span>&#160;  <span class="comment">// (in other words, only show lines named by one of the arg values)</span></div>
<div class="line"><a name="l00845"></a><span class="lineno">  845</span>&#160;  $args = func_get_args();</div>
<div class="line"><a name="l00846"></a><span class="lineno">  846</span>&#160;  <span class="keywordflow">if</span> (!empty($args)) {</div>
<div class="line"><a name="l00847"></a><span class="lineno">  847</span>&#160;    $field_list = $args;</div>
<div class="line"><a name="l00848"></a><span class="lineno">  848</span>&#160;    $metadata = <a class="code" href="outputformat_8drush_8inc.html#a4a9cc3871032fba8891b665d2606dcc0">drush_get_command_format_metadata</a>(<span class="stringliteral">&#39;core-status&#39;</span>);</div>
<div class="line"><a name="l00849"></a><span class="lineno">  849</span>&#160;    <span class="keywordflow">foreach</span> ($metadata[<span class="stringliteral">&#39;field-labels&#39;</span>] as $field_key =&gt; $field_label) {</div>
<div class="line"><a name="l00850"></a><span class="lineno">  850</span>&#160;      <span class="keywordflow">if</span> (_drush_core_is_named_in_array($field_label, $args)) {</div>
<div class="line"><a name="l00851"></a><span class="lineno">  851</span>&#160;        $field_list[] = $field_key;</div>
<div class="line"><a name="l00852"></a><span class="lineno">  852</span>&#160;      }</div>
<div class="line"><a name="l00853"></a><span class="lineno">  853</span>&#160;    }</div>
<div class="line"><a name="l00854"></a><span class="lineno">  854</span>&#160;    <span class="keywordflow">foreach</span> ($status_table as $key =&gt; $value) {</div>
<div class="line"><a name="l00855"></a><span class="lineno">  855</span>&#160;      <span class="keywordflow">if</span> (!_drush_core_is_named_in_array($key, $field_list)) {</div>
<div class="line"><a name="l00856"></a><span class="lineno">  856</span>&#160;        unset($status_table[$key]);</div>
<div class="line"><a name="l00857"></a><span class="lineno">  857</span>&#160;      }</div>
<div class="line"><a name="l00858"></a><span class="lineno">  858</span>&#160;    }</div>
<div class="line"><a name="l00859"></a><span class="lineno">  859</span>&#160;  }</div>
<div class="line"><a name="l00860"></a><span class="lineno">  860</span>&#160;  <span class="keywordflow">return</span> $status_table;</div>
<div class="line"><a name="l00861"></a><span class="lineno">  861</span>&#160;}</div>
<div class="line"><a name="l00862"></a><span class="lineno">  862</span>&#160;</div>
<div class="line"><a name="l00863"></a><span class="lineno">  863</span>&#160;<span class="comment">// Command callback. Show all global options. Exposed via topic command.</span></div>
<div class="line"><a name="l00864"></a><span class="lineno">  864</span>&#160;<span class="keyword">function</span> drush_core_global_options() {</div>
<div class="line"><a name="l00865"></a><span class="lineno">  865</span>&#160;  <a class="code" href="group__outputfunctions.html#ga63acbb94925d6d2693e235e966bba740">drush_print</a>(<a class="code" href="group__outputfunctions.html#ga1218abcb1e27dd3bb412113d1e344d96">dt</a>(<span class="stringliteral">&#39;These options are applicable to most drush commands. Most options can be disabled by using --no-option (i.e. --no-debug to disable --debug.)&#39;</span>));</div>
<div class="line"><a name="l00866"></a><span class="lineno">  866</span>&#160;  <a class="code" href="group__outputfunctions.html#ga63acbb94925d6d2693e235e966bba740">drush_print</a>();</div>
<div class="line"><a name="l00867"></a><span class="lineno">  867</span>&#160;  $fake = drush_global_options_command(FALSE);</div>
<div class="line"><a name="l00868"></a><span class="lineno">  868</span>&#160;  <span class="keywordflow">return</span> drush_format_help_section($fake, <span class="stringliteral">&#39;options&#39;</span>);</div>
<div class="line"><a name="l00869"></a><span class="lineno">  869</span>&#160;}</div>
<div class="line"><a name="l00870"></a><span class="lineno">  870</span>&#160;</div>
<div class="line"><a name="l00871"></a><span class="lineno">  871</span>&#160;<span class="keyword">function</span> _drush_core_is_named_in_array($key, $the_array) {</div>
<div class="line"><a name="l00872"></a><span class="lineno">  872</span>&#160;  $is_named = FALSE;</div>
<div class="line"><a name="l00873"></a><span class="lineno">  873</span>&#160;</div>
<div class="line"><a name="l00874"></a><span class="lineno">  874</span>&#160;  $simplified_key = str_replace(array(<span class="charliteral">&#39; &#39;</span>, <span class="charliteral">&#39;_&#39;</span>, <span class="charliteral">&#39;-&#39;</span>), array(<span class="stringliteral">&#39;&#39;</span>, <span class="stringliteral">&#39;&#39;</span>, <span class="stringliteral">&#39;&#39;</span>), $key);</div>
<div class="line"><a name="l00875"></a><span class="lineno">  875</span>&#160;</div>
<div class="line"><a name="l00876"></a><span class="lineno">  876</span>&#160;  <span class="keywordflow">foreach</span> ($the_array as $name) {</div>
<div class="line"><a name="l00877"></a><span class="lineno">  877</span>&#160;    <span class="keywordflow">if</span> (stristr($simplified_key, str_replace(array(<span class="charliteral">&#39; &#39;</span>, <span class="charliteral">&#39;_&#39;</span>, <span class="charliteral">&#39;-&#39;</span>), array(<span class="stringliteral">&#39;&#39;</span>, <span class="stringliteral">&#39;&#39;</span>, <span class="stringliteral">&#39;&#39;</span>), $name))) {</div>
<div class="line"><a name="l00878"></a><span class="lineno">  878</span>&#160;      $is_named = TRUE;</div>
<div class="line"><a name="l00879"></a><span class="lineno">  879</span>&#160;    }</div>
<div class="line"><a name="l00880"></a><span class="lineno">  880</span>&#160;  }</div>
<div class="line"><a name="l00881"></a><span class="lineno">  881</span>&#160;</div>
<div class="line"><a name="l00882"></a><span class="lineno">  882</span>&#160;  <span class="keywordflow">return</span> $is_named;</div>
<div class="line"><a name="l00883"></a><span class="lineno">  883</span>&#160;}</div>
<div class="line"><a name="l00884"></a><span class="lineno">  884</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l00885"></a><span class="lineno">  885</span>&#160;<span class="comment">/**</span></div>
<div class="line"><a name="l00886"></a><span class="lineno">  886</span>&#160;<span class="comment"> * Callback for core-quick-drupal command.</span></div>
<div class="line"><a name="l00887"></a><span class="lineno">  887</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l00888"></a><span class="lineno"><a class="code" href="core_8drush_8inc.html#a90902b3f529eb012f2ae825cd60f00f1">  888</a></span>&#160;<span class="keyword">function</span> <a class="code" href="core_8drush_8inc.html#a90902b3f529eb012f2ae825cd60f00f1">drush_core_quick_drupal</a>() {</div>
<div class="line"><a name="l00889"></a><span class="lineno">  889</span>&#160;  $requests = FALSE;</div>
<div class="line"><a name="l00890"></a><span class="lineno">  890</span>&#160;  $make_projects = array();</div>
<div class="line"><a name="l00891"></a><span class="lineno">  891</span>&#160;  $args = func_get_args();</div>
<div class="line"><a name="l00892"></a><span class="lineno">  892</span>&#160;  $name = <a class="code" href="context_8inc.html#afe91fb3e5219ecb2208c3b036b1f0cb8">drush_get_option</a>(<span class="stringliteral">&#39;use-name&#39;</span>);</div>
<div class="line"><a name="l00893"></a><span class="lineno">  893</span>&#160;  <a class="code" href="context_8inc.html#aa4b55e2f6174c8b6efaa8f23a0f9e0af">drush_set_option</a>(<span class="stringliteral">&#39;backend&#39;</span>, TRUE);</div>
<div class="line"><a name="l00894"></a><span class="lineno">  894</span>&#160;  <a class="code" href="context_8inc.html#aa4b55e2f6174c8b6efaa8f23a0f9e0af">drush_set_option</a>(<span class="stringliteral">&#39;strict&#39;</span>, FALSE); <span class="comment">// We fail option validation because do so much internal drush_invoke().</span></div>
<div class="line"><a name="l00895"></a><span class="lineno">  895</span>&#160;  $makefile = <a class="code" href="context_8inc.html#afe91fb3e5219ecb2208c3b036b1f0cb8">drush_get_option</a>(<span class="stringliteral">&#39;makefile&#39;</span>);</div>
<div class="line"><a name="l00896"></a><span class="lineno">  896</span>&#160;  $root = <a class="code" href="classDrush.html#a104f09419bc8a46c4bf205b49268b3a4">\Drush::bootstrapManager</a>()-&gt;getRoot();</div>
<div class="line"><a name="l00897"></a><span class="lineno">  897</span>&#160;  <span class="keywordflow">if</span> (<a class="code" href="context_8inc.html#afe91fb3e5219ecb2208c3b036b1f0cb8">drush_get_option</a>(<span class="stringliteral">&#39;use-existing&#39;</span>, ($root != FALSE))) {</div>
<div class="line"><a name="l00898"></a><span class="lineno">  898</span>&#160;    <span class="keywordflow">if</span> (!$root) {</div>
<div class="line"><a name="l00899"></a><span class="lineno">  899</span>&#160;      <span class="keywordflow">return</span> <a class="code" href="group__errorhandling.html#ga23fe9e1e8c1e5ade39256106044b6da4">drush_set_error</a>(<span class="stringliteral">&#39;QUICK_DRUPAL_NO_ROOT_SPECIFIED&#39;</span>, <span class="stringliteral">&#39;Must specify site with --root when using --use-existing.&#39;</span>);</div>
<div class="line"><a name="l00900"></a><span class="lineno">  900</span>&#160;    }</div>
<div class="line"><a name="l00901"></a><span class="lineno">  901</span>&#160;    <span class="comment">// If a --db-url was not explicitly provided, and if there is already</span></div>
<div class="line"><a name="l00902"></a><span class="lineno">  902</span>&#160;    <span class="comment">// a settings.php file provided, then use the db-url defined inside it.</span></div>
<div class="line"><a name="l00903"></a><span class="lineno">  903</span>&#160;    <span class="keywordflow">if</span> (!<a class="code" href="context_8inc.html#afe91fb3e5219ecb2208c3b036b1f0cb8">drush_get_option</a>(<span class="stringliteral">&#39;db-url&#39;</span>, FALSE)) {</div>
<div class="line"><a name="l00904"></a><span class="lineno">  904</span>&#160;      $values = <a class="code" href="group__dispatching.html#ga125471885af052278a0874446b332cf9">drush_invoke_process</a>(<span class="stringliteral">&#39;@self&#39;</span>, <span class="stringliteral">&#39;site-alias&#39;</span>, array(<span class="stringliteral">&#39;@self&#39;</span>), array(<span class="stringliteral">&#39;with-db-url&#39;</span> =&gt; TRUE), array(<span class="stringliteral">&#39;integrate&#39;</span> =&gt; FALSE, <span class="stringliteral">&#39;override-simulated&#39;</span> =&gt; TRUE));</div>
<div class="line"><a name="l00905"></a><span class="lineno">  905</span>&#160;      <span class="keywordflow">if</span> (!empty($values[<span class="stringliteral">&#39;object&#39;</span>][<span class="stringliteral">&#39;self&#39;</span>][<span class="stringliteral">&#39;db-url&#39;</span>])) {</div>
<div class="line"><a name="l00906"></a><span class="lineno">  906</span>&#160;        <a class="code" href="context_8inc.html#aa4b55e2f6174c8b6efaa8f23a0f9e0af">drush_set_option</a>(<span class="stringliteral">&#39;db-url&#39;</span>, $values[<span class="stringliteral">&#39;object&#39;</span>][<span class="stringliteral">&#39;self&#39;</span>][<span class="stringliteral">&#39;db-url&#39;</span>]);</div>
<div class="line"><a name="l00907"></a><span class="lineno">  907</span>&#160;      }</div>
<div class="line"><a name="l00908"></a><span class="lineno">  908</span>&#160;    }</div>
<div class="line"><a name="l00909"></a><span class="lineno">  909</span>&#160;    <span class="keywordflow">if</span> (empty($name)) {</div>
<div class="line"><a name="l00910"></a><span class="lineno">  910</span>&#160;      $name = basename($root);</div>
<div class="line"><a name="l00911"></a><span class="lineno">  911</span>&#160;    }</div>
<div class="line"><a name="l00912"></a><span class="lineno">  912</span>&#160;    $base = dirname($root);</div>
<div class="line"><a name="l00913"></a><span class="lineno">  913</span>&#160;  }</div>
<div class="line"><a name="l00914"></a><span class="lineno">  914</span>&#160;  <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00915"></a><span class="lineno">  915</span>&#160;    <span class="keywordflow">if</span> (!empty($args) &amp;&amp; empty($name)) {</div>
<div class="line"><a name="l00916"></a><span class="lineno">  916</span>&#160;      $name = array_shift($args);</div>
<div class="line"><a name="l00917"></a><span class="lineno">  917</span>&#160;    }</div>
<div class="line"><a name="l00918"></a><span class="lineno">  918</span>&#160;    <span class="keywordflow">if</span> (empty($name)) {</div>
<div class="line"><a name="l00919"></a><span class="lineno">  919</span>&#160;      $name = <span class="stringliteral">&#39;quick-drupal-&#39;</span> . gmdate(<span class="stringliteral">&#39;YmdHis&#39;</span>, $_SERVER[<span class="stringliteral">&#39;REQUEST_TIME&#39;</span>]);</div>
<div class="line"><a name="l00920"></a><span class="lineno">  920</span>&#160;    }</div>
<div class="line"><a name="l00921"></a><span class="lineno">  921</span>&#160;    $root = <a class="code" href="context_8inc.html#afe91fb3e5219ecb2208c3b036b1f0cb8">drush_get_option</a>(<span class="stringliteral">&#39;root&#39;</span>, FALSE);</div>
<div class="line"><a name="l00922"></a><span class="lineno">  922</span>&#160;    $core = <a class="code" href="context_8inc.html#afe91fb3e5219ecb2208c3b036b1f0cb8">drush_get_option</a>(<span class="stringliteral">&#39;core&#39;</span>, <span class="stringliteral">&#39;drupal&#39;</span>);</div>
<div class="line"><a name="l00923"></a><span class="lineno">  923</span>&#160;    $project_rename = $core;</div>
<div class="line"><a name="l00924"></a><span class="lineno">  924</span>&#160;    <span class="keywordflow">if</span> ($root) {</div>
<div class="line"><a name="l00925"></a><span class="lineno">  925</span>&#160;      $base = dirname($root);</div>
<div class="line"><a name="l00926"></a><span class="lineno">  926</span>&#160;      $project_rename = basename($root);</div>
<div class="line"><a name="l00927"></a><span class="lineno">  927</span>&#160;    }</div>
<div class="line"><a name="l00928"></a><span class="lineno">  928</span>&#160;    <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00929"></a><span class="lineno">  929</span>&#160;      $base = getcwd() . <span class="charliteral">&#39;/&#39;</span> . $name;</div>
<div class="line"><a name="l00930"></a><span class="lineno">  930</span>&#160;      $root = $base . <span class="charliteral">&#39;/&#39;</span> . $core;</div>
<div class="line"><a name="l00931"></a><span class="lineno">  931</span>&#160;    }</div>
<div class="line"><a name="l00932"></a><span class="lineno">  932</span>&#160;    <span class="keywordflow">if</span> (!empty($makefile)) {</div>
<div class="line"><a name="l00933"></a><span class="lineno">  933</span>&#160;      <span class="comment">// Invoke &#39;drush make $makefile&#39;.</span></div>
<div class="line"><a name="l00934"></a><span class="lineno">  934</span>&#160;      $result = <a class="code" href="group__dispatching.html#ga125471885af052278a0874446b332cf9">drush_invoke_process</a>(<span class="stringliteral">&#39;@none&#39;</span>, <span class="stringliteral">&#39;make&#39;</span>, array($makefile, $root), array(<span class="stringliteral">&#39;core-quick-drupal&#39;</span> =&gt; TRUE));</div>
<div class="line"><a name="l00935"></a><span class="lineno">  935</span>&#160;      <span class="keywordflow">if</span> ($result[<span class="stringliteral">&#39;error_status&#39;</span>] != 0) {</div>
<div class="line"><a name="l00936"></a><span class="lineno">  936</span>&#160;        <span class="keywordflow">return</span> <a class="code" href="group__errorhandling.html#ga23fe9e1e8c1e5ade39256106044b6da4">drush_set_error</a>(<span class="stringliteral">&#39;DRUSH_QD_MAKE&#39;</span>, <span class="stringliteral">&#39;Could not make; aborting.&#39;</span>);</div>
<div class="line"><a name="l00937"></a><span class="lineno">  937</span>&#160;      }</div>
<div class="line"><a name="l00938"></a><span class="lineno">  938</span>&#160;      $make_projects = array_diff(array_keys($result[<span class="stringliteral">&#39;object&#39;</span>][<span class="stringliteral">&#39;projects&#39;</span>]), array(<span class="stringliteral">&#39;drupal&#39;</span>));</div>
<div class="line"><a name="l00939"></a><span class="lineno">  939</span>&#160;    }</div>
<div class="line"><a name="l00940"></a><span class="lineno">  940</span>&#160;    <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00941"></a><span class="lineno">  941</span>&#160;      <a class="code" href="group__filesystemfunctions.html#ga6027285d97028ad3299d3aa262be8c2f">drush_mkdir</a>($base);</div>
<div class="line"><a name="l00942"></a><span class="lineno">  942</span>&#160;      <a class="code" href="context_8inc.html#aa4b55e2f6174c8b6efaa8f23a0f9e0af">drush_set_option</a>(<span class="stringliteral">&#39;destination&#39;</span>, $base);</div>
<div class="line"><a name="l00943"></a><span class="lineno">  943</span>&#160;      <a class="code" href="context_8inc.html#aa4b55e2f6174c8b6efaa8f23a0f9e0af">drush_set_option</a>(<span class="stringliteral">&#39;drupal-project-rename&#39;</span>, $project_rename);</div>
<div class="line"><a name="l00944"></a><span class="lineno">  944</span>&#160;      <span class="keywordflow">if</span> (<a class="code" href="group__dispatching.html#gad45b0ad6ccdc34ebb10d38d5c2d6a1d1">drush_invoke</a>(<span class="stringliteral">&#39;pm-download&#39;</span>, array($core)) === FALSE) {</div>
<div class="line"><a name="l00945"></a><span class="lineno">  945</span>&#160;        <span class="keywordflow">return</span> <a class="code" href="group__errorhandling.html#ga23fe9e1e8c1e5ade39256106044b6da4">drush_set_error</a>(<span class="stringliteral">&#39;QUICK_DRUPAL_CORE_DOWNLOAD_FAIL&#39;</span>, <span class="stringliteral">&#39;Drupal core download/extract failed.&#39;</span>);</div>
<div class="line"><a name="l00946"></a><span class="lineno">  946</span>&#160;      }</div>
<div class="line"><a name="l00947"></a><span class="lineno">  947</span>&#160;    }</div>
<div class="line"><a name="l00948"></a><span class="lineno">  948</span>&#160;  }</div>
<div class="line"><a name="l00949"></a><span class="lineno">  949</span>&#160;  <span class="keywordflow">if</span> (!<a class="code" href="context_8inc.html#afe91fb3e5219ecb2208c3b036b1f0cb8">drush_get_option</a>(<span class="stringliteral">&#39;db-url&#39;</span>, FALSE)) {</div>
<div class="line"><a name="l00950"></a><span class="lineno">  950</span>&#160;    <a class="code" href="context_8inc.html#aa4b55e2f6174c8b6efaa8f23a0f9e0af">drush_set_option</a>(<span class="stringliteral">&#39;db-url&#39;</span>, <span class="stringliteral">&#39;sqlite://sites/&#39;</span> . strtolower(<a class="code" href="context_8inc.html#afe91fb3e5219ecb2208c3b036b1f0cb8">drush_get_option</a>(<span class="stringliteral">&#39;sites-subdir&#39;</span>, <span class="stringliteral">&#39;default&#39;</span>)) . <span class="stringliteral">&quot;/files/$name.sqlite&quot;</span>);</div>
<div class="line"><a name="l00951"></a><span class="lineno">  951</span>&#160;  }</div>
<div class="line"><a name="l00952"></a><span class="lineno">  952</span>&#160;  <span class="comment">// We have just created a site root where one did not exist before.</span></div>
<div class="line"><a name="l00953"></a><span class="lineno">  953</span>&#160;  <span class="comment">// We therefore must manually reset the selected root to</span></div>
<div class="line"><a name="l00954"></a><span class="lineno">  954</span>&#160;  <span class="comment">// our new root, and force a bootstrap to DRUSH_BOOTSTRAP_DRUPAL_ROOT.</span></div>
<div class="line"><a name="l00955"></a><span class="lineno">  955</span>&#160;  <a class="code" href="classDrush.html#a104f09419bc8a46c4bf205b49268b3a4">\Drush::bootstrapManager</a>()-&gt;setRoot($root);</div>
<div class="line"><a name="l00956"></a><span class="lineno">  956</span>&#160;  <span class="keywordflow">if</span> (!drush_bootstrap_to_phase(DRUSH_BOOTSTRAP_DRUPAL_ROOT)) {</div>
<div class="line"><a name="l00957"></a><span class="lineno">  957</span>&#160;    <span class="keywordflow">return</span> <a class="code" href="group__errorhandling.html#ga23fe9e1e8c1e5ade39256106044b6da4">drush_set_error</a>(<span class="stringliteral">&#39;QUICK_DRUPAL_ROOT_LOCATE_FAIL&#39;</span>, <span class="stringliteral">&#39;Unable to locate Drupal root directory.&#39;</span>);</div>
<div class="line"><a name="l00958"></a><span class="lineno">  958</span>&#160;  }</div>
<div class="line"><a name="l00959"></a><span class="lineno">  959</span>&#160;  <span class="keywordflow">if</span> (!empty($args)) {</div>
<div class="line"><a name="l00960"></a><span class="lineno">  960</span>&#160;    $requests = <a class="code" href="pm_8drush_8inc.html#a34b2e74a73c176eed08207d9bcb4c587">pm_parse_arguments</a>($args, FALSE);</div>
<div class="line"><a name="l00961"></a><span class="lineno">  961</span>&#160;  }</div>
<div class="line"><a name="l00962"></a><span class="lineno">  962</span>&#160;  <span class="keywordflow">if</span> ($requests) {</div>
<div class="line"><a name="l00963"></a><span class="lineno">  963</span>&#160;    <span class="comment">// Unset --destination, so that downloads go to the site directories.</span></div>
<div class="line"><a name="l00964"></a><span class="lineno">  964</span>&#160;    <a class="code" href="context_8inc.html#a2d9c3fdcab304aaf56293d3881e98a9a">drush_unset_option</a>(<span class="stringliteral">&#39;destination&#39;</span>);</div>
<div class="line"><a name="l00965"></a><span class="lineno">  965</span>&#160;    <span class="keywordflow">if</span> (<a class="code" href="group__dispatching.html#gad45b0ad6ccdc34ebb10d38d5c2d6a1d1">drush_invoke</a>(<span class="stringliteral">&#39;pm-download&#39;</span>, $requests) === FALSE) {</div>
<div class="line"><a name="l00966"></a><span class="lineno">  966</span>&#160;      <span class="keywordflow">return</span> <a class="code" href="group__errorhandling.html#ga23fe9e1e8c1e5ade39256106044b6da4">drush_set_error</a>(<span class="stringliteral">&#39;QUICK_DRUPAL_PROJECT_DOWNLOAD_FAIL&#39;</span>, <span class="stringliteral">&#39;Project download/extract failed.&#39;</span>);</div>
<div class="line"><a name="l00967"></a><span class="lineno">  967</span>&#160;    }</div>
<div class="line"><a name="l00968"></a><span class="lineno">  968</span>&#160;  }</div>
<div class="line"><a name="l00969"></a><span class="lineno">  969</span>&#160;  <a class="code" href="group__dispatching.html#gad45b0ad6ccdc34ebb10d38d5c2d6a1d1">drush_invoke</a>(<span class="stringliteral">&#39;site-install&#39;</span>, array(<a class="code" href="context_8inc.html#afe91fb3e5219ecb2208c3b036b1f0cb8">drush_get_option</a>(<span class="stringliteral">&#39;profile&#39;</span>)));</div>
<div class="line"><a name="l00970"></a><span class="lineno">  970</span>&#160;  <span class="comment">// Log in with the admin user.</span></div>
<div class="line"><a name="l00971"></a><span class="lineno">  971</span>&#160;  <span class="comment">// TODO: If site-install is given a sites-subdir other than &#39;default&#39;,</span></div>
<div class="line"><a name="l00972"></a><span class="lineno">  972</span>&#160;  <span class="comment">// then it will bootstrap to DRUSH_BOOTSTRAP_DRUPAL_SITE get the installer</span></div>
<div class="line"><a name="l00973"></a><span class="lineno">  973</span>&#160;  <span class="comment">// to recognize the desired site directory. This somehow interferes</span></div>
<div class="line"><a name="l00974"></a><span class="lineno">  974</span>&#160;  <span class="comment">// with our desire to bootstrap to DRUSH_BOOTSTRAP_DRUPAL_LOGIN here.</span></div>
<div class="line"><a name="l00975"></a><span class="lineno">  975</span>&#160;  <span class="comment">// We could do the last few steps in a new process if uri is not &#39;default&#39;.</span></div>
<div class="line"><a name="l00976"></a><span class="lineno">  976</span>&#160;  <a class="code" href="context_8inc.html#aa4b55e2f6174c8b6efaa8f23a0f9e0af">drush_set_option</a>(<span class="stringliteral">&#39;user&#39;</span>, <span class="charliteral">&#39;1&#39;</span>);</div>
<div class="line"><a name="l00977"></a><span class="lineno">  977</span>&#160;  <span class="keywordflow">if</span> (!drush_bootstrap_to_phase(DRUSH_BOOTSTRAP_DRUPAL_LOGIN)) {</div>
<div class="line"><a name="l00978"></a><span class="lineno">  978</span>&#160;    <span class="keywordflow">return</span> <a class="code" href="group__errorhandling.html#ga23fe9e1e8c1e5ade39256106044b6da4">drush_set_error</a>(<span class="stringliteral">&#39;QUICK_DRUPAL_INSTALL_FAIL&#39;</span>, <span class="stringliteral">&#39;Drupal core install failed.&#39;</span>);</div>
<div class="line"><a name="l00979"></a><span class="lineno">  979</span>&#160;  }</div>
<div class="line"><a name="l00980"></a><span class="lineno">  980</span>&#160;  $enable = array_merge(<a class="code" href="pm_8drush_8inc.html#a34b2e74a73c176eed08207d9bcb4c587">pm_parse_arguments</a>(<a class="code" href="context_8inc.html#afe91fb3e5219ecb2208c3b036b1f0cb8">drush_get_option</a>(<span class="stringliteral">&#39;enable&#39;</span>, $requests)), $make_projects);</div>
<div class="line"><a name="l00981"></a><span class="lineno">  981</span>&#160;  <span class="keywordflow">if</span> (!empty($enable)) {</div>
<div class="line"><a name="l00982"></a><span class="lineno">  982</span>&#160;    <span class="keywordflow">if</span> (<a class="code" href="group__dispatching.html#gad45b0ad6ccdc34ebb10d38d5c2d6a1d1">drush_invoke</a>(<span class="stringliteral">&#39;pm-enable&#39;</span>, $enable) === FALSE) {</div>
<div class="line"><a name="l00983"></a><span class="lineno">  983</span>&#160;     <span class="keywordflow">return</span> <a class="code" href="group__errorhandling.html#ga23fe9e1e8c1e5ade39256106044b6da4">drush_set_error</a>(<span class="stringliteral">&#39;QUICK_DRUPAL_PROJECT_ENABLE_FAIL&#39;</span>, <span class="stringliteral">&#39;Project enable failed.&#39;</span>);</div>
<div class="line"><a name="l00984"></a><span class="lineno">  984</span>&#160;    }</div>
<div class="line"><a name="l00985"></a><span class="lineno">  985</span>&#160;  }</div>
<div class="line"><a name="l00986"></a><span class="lineno">  986</span>&#160;  $server = <a class="code" href="context_8inc.html#afe91fb3e5219ecb2208c3b036b1f0cb8">drush_get_option</a>(<span class="stringliteral">&#39;server&#39;</span>, <span class="charliteral">&#39;/&#39;</span>);</div>
<div class="line"><a name="l00987"></a><span class="lineno">  987</span>&#160;  <span class="keywordflow">if</span> ($server) {</div>
<div class="line"><a name="l00988"></a><span class="lineno">  988</span>&#160;    $server_uri = <a class="code" href="runserver_8drush_8inc.html#ab9cdb775e4e7fca95509836bd09fe279">runserver_uri</a>($server);</div>
<div class="line"><a name="l00989"></a><span class="lineno">  989</span>&#160;    _drush_core_qd_cache_uri($server_uri);</div>
<div class="line"><a name="l00990"></a><span class="lineno">  990</span>&#160;  }</div>
<div class="line"><a name="l00991"></a><span class="lineno">  991</span>&#160;  <span class="keywordflow">if</span> (!<a class="code" href="context_8inc.html#afe91fb3e5219ecb2208c3b036b1f0cb8">drush_get_option</a>(<span class="stringliteral">&#39;no-server&#39;</span>, FALSE)) {</div>
<div class="line"><a name="l00992"></a><span class="lineno">  992</span>&#160;    <span class="keywordflow">if</span> ($server) {</div>
<div class="line"><a name="l00993"></a><span class="lineno">  993</span>&#160;      <span class="comment">// Current CLI user is also the web server user, which is for development</span></div>
<div class="line"><a name="l00994"></a><span class="lineno">  994</span>&#160;      <span class="comment">// only. Hence we can safely make the site directory writable. This makes</span></div>
<div class="line"><a name="l00995"></a><span class="lineno">  995</span>&#160;      <span class="comment">// it easier to delete and edit settings.php.</span></div>
<div class="line"><a name="l00996"></a><span class="lineno">  996</span>&#160;      $boot = <a class="code" href="classDrush.html#aa0028a6c4611724e20f33169dd5147a6">\Drush::bootstrap</a>();</div>
<div class="line"><a name="l00997"></a><span class="lineno">  997</span>&#160;      @chmod($boot-&gt;conf_path(), 0700);</div>
<div class="line"><a name="l00998"></a><span class="lineno">  998</span>&#160;      <a class="code" href="group__dispatching.html#ga125471885af052278a0874446b332cf9">drush_invoke_process</a>(array(<span class="stringliteral">&#39;root&#39;</span> =&gt; $root, <span class="stringliteral">&#39;uri&#39;</span> =&gt; $server_uri), <span class="stringliteral">&#39;runserver&#39;</span>, array($server));</div>
<div class="line"><a name="l00999"></a><span class="lineno">  999</span>&#160;    }</div>
<div class="line"><a name="l01000"></a><span class="lineno"> 1000</span>&#160;  }</div>
<div class="line"><a name="l01001"></a><span class="lineno"> 1001</span>&#160;  <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l01002"></a><span class="lineno"> 1002</span>&#160;    <a class="code" href="group__outputfunctions.html#ga63acbb94925d6d2693e235e966bba740">drush_print</a>(<a class="code" href="group__outputfunctions.html#ga1218abcb1e27dd3bb412113d1e344d96">dt</a>(<span class="stringliteral">&#39;Login URL: &#39;</span>) . <a class="code" href="group__dispatching.html#gad45b0ad6ccdc34ebb10d38d5c2d6a1d1">drush_invoke</a>(<span class="stringliteral">&#39;user-login&#39;</span>));</div>
<div class="line"><a name="l01003"></a><span class="lineno"> 1003</span>&#160;  }</div>
<div class="line"><a name="l01004"></a><span class="lineno"> 1004</span>&#160;}</div>
<div class="line"><a name="l01005"></a><span class="lineno"> 1005</span>&#160;</div>
<div class="line"><a name="l01006"></a><span class="lineno"> 1006</span>&#160;<span class="comment">// Write a drushrc.php to cache the server information for future Drush calls</span></div>
<div class="line"><a name="l01007"></a><span class="lineno"> 1007</span>&#160;<span class="keyword">function</span> _drush_core_qd_cache_uri($uri) {</div>
<div class="line"><a name="l01008"></a><span class="lineno"> 1008</span>&#160;  $server = $uri[<span class="stringliteral">&#39;host&#39;</span>];</div>
<div class="line"><a name="l01009"></a><span class="lineno"> 1009</span>&#160;  <span class="keywordflow">if</span> (!empty($uri[<span class="stringliteral">&quot;port&quot;</span>])) {</div>
<div class="line"><a name="l01010"></a><span class="lineno"> 1010</span>&#160;    $server .= <span class="charliteral">&#39;:&#39;</span> . $uri[<span class="stringliteral">&quot;port&quot;</span>];</div>
<div class="line"><a name="l01011"></a><span class="lineno"> 1011</span>&#160;  }</div>
<div class="line"><a name="l01012"></a><span class="lineno"> 1012</span>&#160;  $dir = DRUPAL_ROOT . <span class="stringliteral">&#39;/drush&#39;</span>;</div>
<div class="line"><a name="l01013"></a><span class="lineno"> 1013</span>&#160;  $target_file = $dir . <span class="stringliteral">&#39;/drushrc.php&#39;</span>;</div>
<div class="line"><a name="l01014"></a><span class="lineno"> 1014</span>&#160;  <a class="code" href="group__logging.html#ga47324b65808524558a488916b150dd51">drush_log</a>(<a class="code" href="group__outputfunctions.html#ga1218abcb1e27dd3bb412113d1e344d96">dt</a>(<span class="stringliteral">&quot;Caching &#39;uri&#39; !uri in !target&quot;</span>, array(<span class="stringliteral">&#39;!uri&#39;</span> =&gt; $server, <span class="stringliteral">&#39;!target&#39;</span> =&gt; $target_file)), LogLevel::OK);</div>
<div class="line"><a name="l01015"></a><span class="lineno"> 1015</span>&#160;  $create_file = TRUE;</div>
<div class="line"><a name="l01016"></a><span class="lineno"> 1016</span>&#160;  <span class="keywordflow">if</span> (file_exists($target_file)) {</div>
<div class="line"><a name="l01017"></a><span class="lineno"> 1017</span>&#160;    <span class="comment">// Don&#39;t bother to ask with --use-existing; just</span></div>
<div class="line"><a name="l01018"></a><span class="lineno"> 1018</span>&#160;    <span class="comment">// continue.</span></div>
<div class="line"><a name="l01019"></a><span class="lineno"> 1019</span>&#160;    <span class="keywordflow">if</span> (<a class="code" href="context_8inc.html#afe91fb3e5219ecb2208c3b036b1f0cb8">drush_get_option</a>(<span class="stringliteral">&#39;use-existing&#39;</span>, FALSE)) {</div>
<div class="line"><a name="l01020"></a><span class="lineno"> 1020</span>&#160;      $create_file = FALSE;</div>
<div class="line"><a name="l01021"></a><span class="lineno"> 1021</span>&#160;    }</div>
<div class="line"><a name="l01022"></a><span class="lineno"> 1022</span>&#160;    <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l01023"></a><span class="lineno"> 1023</span>&#160;      $create_file = <a class="code" href="group__userinput.html#gaa4169b83ff9dc4222af95d376b21268b">drush_confirm</a>(<a class="code" href="group__outputfunctions.html#ga1218abcb1e27dd3bb412113d1e344d96">dt</a>(<span class="stringliteral">&#39;!target already exists. Overwrite?&#39;</span>, array(<span class="stringliteral">&#39;!target&#39;</span> =&gt; $target_file)));</div>
<div class="line"><a name="l01024"></a><span class="lineno"> 1024</span>&#160;    }</div>
<div class="line"><a name="l01025"></a><span class="lineno"> 1025</span>&#160;  }</div>
<div class="line"><a name="l01026"></a><span class="lineno"> 1026</span>&#160;  $content = &lt;&lt;&lt;EOT</div>
<div class="line"><a name="l01027"></a><span class="lineno"> 1027</span>&#160;&lt;?php</div>
<div class="line"><a name="l01028"></a><span class="lineno"> 1028</span>&#160;</div>
<div class="line"><a name="l01029"></a><span class="lineno"> 1029</span>&#160;<span class="comment">// Inserted by `drush quick-drupal`.  This allows `drush user-login`</span></div>
<div class="line"><a name="l01030"></a><span class="lineno"> 1030</span>&#160;<span class="comment">// and similar commands to work seemlessly.  Remove if using</span></div>
<div class="line"><a name="l01031"></a><span class="lineno"> 1031</span>&#160;<span class="comment">// Drupal multisite feature.</span></div>
<div class="line"><a name="l01032"></a><span class="lineno"> 1032</span>&#160;\$options[<span class="stringliteral">&#39;uri&#39;</span>] = <span class="stringliteral">&quot;$server&quot;</span>;</div>
<div class="line"><a name="l01033"></a><span class="lineno"> 1033</span>&#160;EOT;</div>
<div class="line"><a name="l01034"></a><span class="lineno"> 1034</span>&#160;  <span class="keywordflow">if</span> ($create_file) {</div>
<div class="line"><a name="l01035"></a><span class="lineno"> 1035</span>&#160;    <a class="code" href="group__filesystemfunctions.html#ga6027285d97028ad3299d3aa262be8c2f">drush_mkdir</a>($dir);</div>
<div class="line"><a name="l01036"></a><span class="lineno"> 1036</span>&#160;    file_put_contents($target_file, $content);</div>
<div class="line"><a name="l01037"></a><span class="lineno"> 1037</span>&#160;  }</div>
<div class="line"><a name="l01038"></a><span class="lineno"> 1038</span>&#160;}</div>
<div class="line"><a name="l01039"></a><span class="lineno"> 1039</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l01040"></a><span class="lineno"> 1040</span>&#160;<span class="comment">/**</span></div>
<div class="line"><a name="l01041"></a><span class="lineno"> 1041</span>&#160;<span class="comment"> * Include options and engines for core-quick-drupal command, aggregated from</span></div>
<div class="line"><a name="l01042"></a><span class="lineno"> 1042</span>&#160;<span class="comment"> * other command options that are available. We prefix option descriptons,</span></div>
<div class="line"><a name="l01043"></a><span class="lineno"> 1043</span>&#160;<span class="comment"> * to make the long list more navigable.</span></div>
<div class="line"><a name="l01044"></a><span class="lineno"> 1044</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l01045"></a><span class="lineno"> 1045</span>&#160;<span class="comment"> * @param $items</span></div>
<div class="line"><a name="l01046"></a><span class="lineno"> 1046</span>&#160;<span class="comment"> *   The core commandfile command array, by reference. Used to include</span></div>
<div class="line"><a name="l01047"></a><span class="lineno"> 1047</span>&#160;<span class="comment"> *   site-install options and add options and engines for core-quick-drupal.</span></div>
<div class="line"><a name="l01048"></a><span class="lineno"> 1048</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l01049"></a><span class="lineno"><a class="code" href="core_8drush_8inc.html#a15db942a3ad909cf9b3d7d3ffaf78ac9"> 1049</a></span>&#160;<span class="keyword">function</span> <a class="code" href="core_8drush_8inc.html#a15db942a3ad909cf9b3d7d3ffaf78ac9">drush_core_quick_drupal_options</a>(&amp;$items) {</div>
<div class="line"><a name="l01050"></a><span class="lineno"> 1050</span>&#160;  $options = array(</div>
<div class="line"><a name="l01051"></a><span class="lineno"> 1051</span>&#160;    <span class="stringliteral">&#39;core&#39;</span> =&gt; <span class="stringliteral">&#39;Drupal core to download. Defaults to &quot;drupal&quot; (latest stable version).&#39;</span>,</div>
<div class="line"><a name="l01052"></a><span class="lineno"> 1052</span>&#160;    <span class="stringliteral">&#39;use-existing&#39;</span> =&gt; <span class="stringliteral">&#39;Use an existing Drupal root, specified with --root. Overrides --core. Defaults to true when run from an existing site.&#39;</span>,</div>
<div class="line"><a name="l01053"></a><span class="lineno"> 1053</span>&#160;    <span class="stringliteral">&#39;profile&#39;</span> =&gt; <span class="stringliteral">&#39;The install profile to use. Defaults to standard.&#39;</span>,</div>
<div class="line"><a name="l01054"></a><span class="lineno"> 1054</span>&#160;    <span class="stringliteral">&#39;enable&#39;</span> =&gt; <span class="stringliteral">&#39;Specific extensions (modules or themes) to enable. By default, extensions with the same name as requested projects will be enabled automatically.&#39;</span>,</div>
<div class="line"><a name="l01055"></a><span class="lineno"> 1055</span>&#160;    <span class="stringliteral">&#39;server&#39;</span> =&gt; <span class="stringliteral">&#39;Host IP address and port number to bind to and path to open in web browser (hyphen to clear a default path), all elements optional. See runserver examples for shorthand.&#39;</span>,</div>
<div class="line"><a name="l01056"></a><span class="lineno"> 1056</span>&#160;    <span class="stringliteral">&#39;no-server&#39;</span> =&gt; <span class="stringliteral">&#39;Avoid starting runserver (and browser) for the created Drupal site.&#39;</span>,</div>
<div class="line"><a name="l01057"></a><span class="lineno"> 1057</span>&#160;    <span class="stringliteral">&#39;browser&#39;</span> =&gt; <span class="stringliteral">&#39;Optional name of a browser to open site in. If omitted the OS default browser will be used. Set --no-browser to disable.&#39;</span>,</div>
<div class="line"><a name="l01058"></a><span class="lineno"> 1058</span>&#160;    <span class="stringliteral">&#39;use-name&#39;</span> =&gt; array(<span class="stringliteral">&#39;hidden&#39;</span> =&gt; TRUE, <span class="stringliteral">&#39;description&#39;</span> =&gt; <span class="stringliteral">&#39;Overrides &quot;name&quot; argument.&#39;</span>),</div>
<div class="line"><a name="l01059"></a><span class="lineno"> 1059</span>&#160;    <span class="stringliteral">&#39;makefile&#39;</span> =&gt; array(<span class="stringliteral">&#39;description&#39;</span> =&gt; <span class="stringliteral">&#39;Makefile to use. Makefile must specify which version of Drupal core to build.&#39;</span>, <span class="stringliteral">&#39;example-value&#39;</span> =&gt; <span class="stringliteral">&#39;mysite.make&#39;</span>, <span class="stringliteral">&#39;value&#39;</span> =&gt; <span class="stringliteral">&#39;optional&#39;</span>),</div>
<div class="line"><a name="l01060"></a><span class="lineno"> 1060</span>&#160;    <span class="stringliteral">&#39;root&#39;</span> =&gt; array(<span class="stringliteral">&#39;description&#39;</span> =&gt; <span class="stringliteral">&#39;Path to Drupal root.&#39;</span>, <span class="stringliteral">&#39;example-value&#39;</span> =&gt; <span class="stringliteral">&#39;/path/to/root&#39;</span>, <span class="stringliteral">&#39;value&#39;</span> =&gt; <span class="stringliteral">&#39;optional&#39;</span>),</div>
<div class="line"><a name="l01061"></a><span class="lineno"> 1061</span>&#160;  );</div>
<div class="line"><a name="l01062"></a><span class="lineno"> 1062</span>&#160;  $pm = <a class="code" href="pm_8drush_8inc.html#a9f267e6ae37b4f67eccab48af016ef2d">pm_drush_command</a>();</div>
<div class="line"><a name="l01063"></a><span class="lineno"> 1063</span>&#160;  <span class="keywordflow">foreach</span> ($pm[<span class="stringliteral">&#39;pm-download&#39;</span>][<span class="stringliteral">&#39;options&#39;</span>] as $option =&gt; $description) {</div>
<div class="line"><a name="l01064"></a><span class="lineno"> 1064</span>&#160;    <span class="keywordflow">if</span> (is_array($description)) {</div>
<div class="line"><a name="l01065"></a><span class="lineno"> 1065</span>&#160;      $description = $description[<span class="stringliteral">&#39;description&#39;</span>];</div>
<div class="line"><a name="l01066"></a><span class="lineno"> 1066</span>&#160;    }</div>
<div class="line"><a name="l01067"></a><span class="lineno"> 1067</span>&#160;    $options[$option] = <span class="stringliteral">&#39;Download option: &#39;</span> . $description;</div>
<div class="line"><a name="l01068"></a><span class="lineno"> 1068</span>&#160;  }</div>
<div class="line"><a name="l01069"></a><span class="lineno"> 1069</span>&#160;  <span class="comment">// Unset a few options that are not usable here, as we control them ourselves</span></div>
<div class="line"><a name="l01070"></a><span class="lineno"> 1070</span>&#160;  <span class="comment">// or they are otherwise implied by the environment.</span></div>
<div class="line"><a name="l01071"></a><span class="lineno"> 1071</span>&#160;  unset($options[<span class="stringliteral">&#39;destination&#39;</span>]);</div>
<div class="line"><a name="l01072"></a><span class="lineno"> 1072</span>&#160;  unset($options[<span class="stringliteral">&#39;drupal-project-rename&#39;</span>]);</div>
<div class="line"><a name="l01073"></a><span class="lineno"> 1073</span>&#160;  unset($options[<span class="stringliteral">&#39;default-major&#39;</span>]);</div>
<div class="line"><a name="l01074"></a><span class="lineno"> 1074</span>&#160;  unset($options[<span class="stringliteral">&#39;use-site-dir&#39;</span>]);</div>
<div class="line"><a name="l01075"></a><span class="lineno"> 1075</span>&#160;  $si = site_install_drush_command();</div>
<div class="line"><a name="l01076"></a><span class="lineno"> 1076</span>&#160;  <span class="keywordflow">foreach</span> ($si[<span class="stringliteral">&#39;site-install&#39;</span>][<span class="stringliteral">&#39;options&#39;</span>] as $option =&gt; $description) {</div>
<div class="line"><a name="l01077"></a><span class="lineno"> 1077</span>&#160;    <span class="keywordflow">if</span> (is_array($description)) {</div>
<div class="line"><a name="l01078"></a><span class="lineno"> 1078</span>&#160;      $description = $description[<span class="stringliteral">&#39;description&#39;</span>];</div>
<div class="line"><a name="l01079"></a><span class="lineno"> 1079</span>&#160;    }</div>
<div class="line"><a name="l01080"></a><span class="lineno"> 1080</span>&#160;    $options[$option] = <span class="stringliteral">&#39;Site install option: &#39;</span> . $description;</div>
<div class="line"><a name="l01081"></a><span class="lineno"> 1081</span>&#160;  }</div>
<div class="line"><a name="l01082"></a><span class="lineno"> 1082</span>&#160;  unset($options[<span class="stringliteral">&#39;sites-subdir&#39;</span>]);</div>
<div class="line"><a name="l01083"></a><span class="lineno"> 1083</span>&#160;  $runserver = <a class="code" href="runserver_8drush_8inc.html#ac2e927a6bc2378dc6239cc87bbd985d3">runserver_drush_command</a>();</div>
<div class="line"><a name="l01084"></a><span class="lineno"> 1084</span>&#160;  <span class="keywordflow">foreach</span> ($runserver[<span class="stringliteral">&#39;runserver&#39;</span>][<span class="stringliteral">&#39;options&#39;</span>] as $option =&gt; $description) {</div>
<div class="line"><a name="l01085"></a><span class="lineno"> 1085</span>&#160;    $options[$option] = <span class="stringliteral">&#39;Runserver option: &#39;</span> . $description;</div>
<div class="line"><a name="l01086"></a><span class="lineno"> 1086</span>&#160;  }</div>
<div class="line"><a name="l01087"></a><span class="lineno"> 1087</span>&#160;  unset($options[<span class="stringliteral">&#39;user&#39;</span>]);</div>
<div class="line"><a name="l01088"></a><span class="lineno"> 1088</span>&#160;  $items[<span class="stringliteral">&#39;core-quick-drupal&#39;</span>][<span class="stringliteral">&#39;options&#39;</span>] = $options;</div>
<div class="line"><a name="l01089"></a><span class="lineno"> 1089</span>&#160;  $items[<span class="stringliteral">&#39;core-quick-drupal&#39;</span>][<span class="stringliteral">&#39;engines&#39;</span>] = $pm[<span class="stringliteral">&#39;pm-download&#39;</span>][<span class="stringliteral">&#39;engines&#39;</span>];</div>
<div class="line"><a name="l01090"></a><span class="lineno"> 1090</span>&#160;}</div>
<div class="line"><a name="l01091"></a><span class="lineno"> 1091</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l01092"></a><span class="lineno"> 1092</span>&#160;<span class="comment">/**</span></div>
<div class="line"><a name="l01093"></a><span class="lineno"> 1093</span>&#160;<span class="comment"> * Command callback. Runs &quot;naked&quot; php scripts</span></div>
<div class="line"><a name="l01094"></a><span class="lineno"> 1094</span>&#160;<span class="comment"> * and drush &quot;shebang&quot; scripts (&quot;#!/usr/bin/env drush&quot;).</span></div>
<div class="line"><a name="l01095"></a><span class="lineno"> 1095</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l01096"></a><span class="lineno"><a class="code" href="core_8drush_8inc.html#a318e7d1eefff92580b72fca9d6623939"> 1096</a></span>&#160;<span class="keyword">function</span> <a class="code" href="core_8drush_8inc.html#a318e7d1eefff92580b72fca9d6623939">drush_core_php_script</a>() {</div>
<div class="line"><a name="l01097"></a><span class="lineno"> 1097</span>&#160;  $found = FALSE;</div>
<div class="line"><a name="l01098"></a><span class="lineno"> 1098</span>&#160;  $script = NULL;</div>
<div class="line"><a name="l01099"></a><span class="lineno"> 1099</span>&#160;  <span class="keywordflow">if</span> ($args = func_get_args()) {</div>
<div class="line"><a name="l01100"></a><span class="lineno"> 1100</span>&#160;    $script = $args[0];</div>
<div class="line"><a name="l01101"></a><span class="lineno"> 1101</span>&#160;  }</div>
<div class="line"><a name="l01102"></a><span class="lineno"> 1102</span>&#160;</div>
<div class="line"><a name="l01103"></a><span class="lineno"> 1103</span>&#160;  <span class="keywordflow">if</span> ($script == <span class="charliteral">&#39;-&#39;</span>) {</div>
<div class="line"><a name="l01104"></a><span class="lineno"> 1104</span>&#160;    <span class="keywordflow">return</span> eval(stream_get_contents(STDIN));</div>
<div class="line"><a name="l01105"></a><span class="lineno"> 1105</span>&#160;  }</div>
<div class="line"><a name="l01106"></a><span class="lineno"> 1106</span>&#160;  elseif (file_exists($script)) {</div>
<div class="line"><a name="l01107"></a><span class="lineno"> 1107</span>&#160;    $found = $script;</div>
<div class="line"><a name="l01108"></a><span class="lineno"> 1108</span>&#160;  }</div>
<div class="line"><a name="l01109"></a><span class="lineno"> 1109</span>&#160;  <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l01110"></a><span class="lineno"> 1110</span>&#160;    <span class="comment">// Array of paths to search for scripts</span></div>
<div class="line"><a name="l01111"></a><span class="lineno"> 1111</span>&#160;    $searchpath[<span class="stringliteral">&#39;cwd&#39;</span>] = <a class="code" href="includes_2environment_8inc.html#a339c57f584d4f3d910d8c36763d054c2">drush_cwd</a>();</div>
<div class="line"><a name="l01112"></a><span class="lineno"> 1112</span>&#160;</div>
<div class="line"><a name="l01113"></a><span class="lineno"> 1113</span>&#160;    <span class="comment">// Additional script paths, specified by &#39;script-path&#39; option</span></div>
<div class="line"><a name="l01114"></a><span class="lineno"> 1114</span>&#160;    <span class="keywordflow">if</span> ($script_path = <a class="code" href="context_8inc.html#afe91fb3e5219ecb2208c3b036b1f0cb8">drush_get_option</a>(<span class="stringliteral">&#39;script-path&#39;</span>, FALSE)) {</div>
<div class="line"><a name="l01115"></a><span class="lineno"> 1115</span>&#160;      <span class="keywordflow">foreach</span> (explode(PATH_SEPARATOR, $script_path) as $path) {</div>
<div class="line"><a name="l01116"></a><span class="lineno"> 1116</span>&#160;        $searchpath[] = $path;</div>
<div class="line"><a name="l01117"></a><span class="lineno"> 1117</span>&#160;      }</div>
<div class="line"><a name="l01118"></a><span class="lineno"> 1118</span>&#160;    }</div>
<div class="line"><a name="l01119"></a><span class="lineno"> 1119</span>&#160;    <a class="code" href="group__logging.html#ga47324b65808524558a488916b150dd51">drush_log</a>(<a class="code" href="group__outputfunctions.html#ga1218abcb1e27dd3bb412113d1e344d96">dt</a>(<span class="stringliteral">&#39;Searching for scripts in &#39;</span>) . implode(<span class="charliteral">&#39;,&#39;</span>, $searchpath), LogLevel::DEBUG);</div>
<div class="line"><a name="l01120"></a><span class="lineno"> 1120</span>&#160;</div>
<div class="line"><a name="l01121"></a><span class="lineno"> 1121</span>&#160;    <span class="keywordflow">if</span> (!isset($script)) {</div>
<div class="line"><a name="l01122"></a><span class="lineno"> 1122</span>&#160;      <span class="comment">// List all available scripts.</span></div>
<div class="line"><a name="l01123"></a><span class="lineno"> 1123</span>&#160;      $all = array();</div>
<div class="line"><a name="l01124"></a><span class="lineno"> 1124</span>&#160;      <span class="keywordflow">foreach</span>($searchpath as $key =&gt; $path) {</div>
<div class="line"><a name="l01125"></a><span class="lineno"> 1125</span>&#160;        $recurse = !(($key == <span class="stringliteral">&#39;cwd&#39;</span>) || ($path == <span class="charliteral">&#39;/&#39;</span>));</div>
<div class="line"><a name="l01126"></a><span class="lineno"> 1126</span>&#160;        $all = array_merge( $all , array_keys(<a class="code" href="group__filesystemfunctions.html#ga1c545390a8890f6ea47385f79fbe2e82">drush_scan_directory</a>($path, <span class="stringliteral">&#39;/\.php$/&#39;</span>, array(<span class="charliteral">&#39;.&#39;</span>, <span class="stringliteral">&#39;..&#39;</span>, <span class="stringliteral">&#39;CVS&#39;</span>), NULL, $recurse)) );</div>
<div class="line"><a name="l01127"></a><span class="lineno"> 1127</span>&#160;      }</div>
<div class="line"><a name="l01128"></a><span class="lineno"> 1128</span>&#160;      <a class="code" href="group__outputfunctions.html#ga63acbb94925d6d2693e235e966bba740">drush_print</a>(implode(<span class="stringliteral">&quot;\n&quot;</span>, $all));</div>
<div class="line"><a name="l01129"></a><span class="lineno"> 1129</span>&#160;    }</div>
<div class="line"><a name="l01130"></a><span class="lineno"> 1130</span>&#160;    <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l01131"></a><span class="lineno"> 1131</span>&#160;      <span class="comment">// Execute the specified script.</span></div>
<div class="line"><a name="l01132"></a><span class="lineno"> 1132</span>&#160;      <span class="keywordflow">foreach</span>($searchpath as $path) {</div>
<div class="line"><a name="l01133"></a><span class="lineno"> 1133</span>&#160;        $script_filename = $path . <span class="charliteral">&#39;/&#39;</span> . $script;</div>
<div class="line"><a name="l01134"></a><span class="lineno"> 1134</span>&#160;        <span class="keywordflow">if</span> (file_exists($script_filename . <span class="stringliteral">&#39;.php&#39;</span>)) {</div>
<div class="line"><a name="l01135"></a><span class="lineno"> 1135</span>&#160;          $script_filename .= <span class="stringliteral">&#39;.php&#39;</span>;</div>
<div class="line"><a name="l01136"></a><span class="lineno"> 1136</span>&#160;        }</div>
<div class="line"><a name="l01137"></a><span class="lineno"> 1137</span>&#160;        <span class="keywordflow">if</span> (file_exists($script_filename)) {</div>
<div class="line"><a name="l01138"></a><span class="lineno"> 1138</span>&#160;          $found = $script_filename;</div>
<div class="line"><a name="l01139"></a><span class="lineno"> 1139</span>&#160;          <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l01140"></a><span class="lineno"> 1140</span>&#160;        }</div>
<div class="line"><a name="l01141"></a><span class="lineno"> 1141</span>&#160;        $all[] = $script_filename;</div>
<div class="line"><a name="l01142"></a><span class="lineno"> 1142</span>&#160;      }</div>
<div class="line"><a name="l01143"></a><span class="lineno"> 1143</span>&#160;      <span class="keywordflow">if</span> (!$found) {</div>
<div class="line"><a name="l01144"></a><span class="lineno"> 1144</span>&#160;        <span class="keywordflow">return</span> <a class="code" href="group__errorhandling.html#ga23fe9e1e8c1e5ade39256106044b6da4">drush_set_error</a>(<span class="stringliteral">&#39;DRUSH_TARGET_NOT_FOUND&#39;</span>, <a class="code" href="group__outputfunctions.html#ga1218abcb1e27dd3bb412113d1e344d96">dt</a>(<span class="stringliteral">&#39;Unable to find any of the following: @files&#39;</span>, array(<span class="stringliteral">&#39;@files&#39;</span> =&gt; implode(<span class="stringliteral">&#39;, &#39;</span>, $all))));</div>
<div class="line"><a name="l01145"></a><span class="lineno"> 1145</span>&#160;      }</div>
<div class="line"><a name="l01146"></a><span class="lineno"> 1146</span>&#160;    }</div>
<div class="line"><a name="l01147"></a><span class="lineno"> 1147</span>&#160;  }</div>
<div class="line"><a name="l01148"></a><span class="lineno"> 1148</span>&#160;</div>
<div class="line"><a name="l01149"></a><span class="lineno"> 1149</span>&#160;  <span class="keywordflow">if</span> ($found) {</div>
<div class="line"><a name="l01150"></a><span class="lineno"> 1150</span>&#160;    <span class="comment">// Set the DRUSH_SHIFT_SKIP to two; this will cause</span></div>
<div class="line"><a name="l01151"></a><span class="lineno"> 1151</span>&#160;    <span class="comment">// drush_shift to skip the next two arguments the next</span></div>
<div class="line"><a name="l01152"></a><span class="lineno"> 1152</span>&#160;    <span class="comment">// time it is called.  This allows scripts to get all</span></div>
<div class="line"><a name="l01153"></a><span class="lineno"> 1153</span>&#160;    <span class="comment">// arguments, including the &#39;php-script&#39; and script</span></div>
<div class="line"><a name="l01154"></a><span class="lineno"> 1154</span>&#160;    <span class="comment">// pathname, via drush_get_arguments(), or it can process</span></div>
<div class="line"><a name="l01155"></a><span class="lineno"> 1155</span>&#160;    <span class="comment">// just the arguments that are relevant using drush_shift().</span></div>
<div class="line"><a name="l01156"></a><span class="lineno"> 1156</span>&#160;    <a class="code" href="context_8inc.html#af983acfe90e7d7bbdbd67c57f93708ba">drush_set_context</a>(<span class="stringliteral">&#39;DRUSH_SHIFT_SKIP&#39;</span>, 2);</div>
<div class="line"><a name="l01157"></a><span class="lineno"> 1157</span>&#160;    <span class="keywordflow">if</span> (<a class="code" href="core_8drush_8inc.html#aa572438a5d0f359ac7f5dfd92ad6bda3">_drush_core_eval_shebang_script</a>($found) === FALSE) {</div>
<div class="line"><a name="l01158"></a><span class="lineno"> 1158</span>&#160;      <span class="keywordflow">return</span> include($found);</div>
<div class="line"><a name="l01159"></a><span class="lineno"> 1159</span>&#160;    }</div>
<div class="line"><a name="l01160"></a><span class="lineno"> 1160</span>&#160;  }</div>
<div class="line"><a name="l01161"></a><span class="lineno"> 1161</span>&#160;}</div>
<div class="line"><a name="l01162"></a><span class="lineno"> 1162</span>&#160;</div>
<div class="line"><a name="l01163"></a><span class="lineno"> 1163</span>&#160;<span class="keyword">function</span> drush_core_php_eval($php) {</div>
<div class="line"><a name="l01164"></a><span class="lineno"> 1164</span>&#160;  <span class="keywordflow">return</span> eval($php . <span class="charliteral">&#39;;&#39;</span>);</div>
<div class="line"><a name="l01165"></a><span class="lineno"> 1165</span>&#160;}</div>
<div class="line"><a name="l01166"></a><span class="lineno"> 1166</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l01167"></a><span class="lineno"> 1167</span>&#160;<span class="comment">/**</span></div>
<div class="line"><a name="l01168"></a><span class="lineno"> 1168</span>&#160;<span class="comment"> * Evaluate a script that begins with #!drush php-script</span></div>
<div class="line"><a name="l01169"></a><span class="lineno"> 1169</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l01170"></a><span class="lineno"><a class="code" href="core_8drush_8inc.html#aa572438a5d0f359ac7f5dfd92ad6bda3"> 1170</a></span>&#160;<span class="keyword">function</span> <a class="code" href="core_8drush_8inc.html#aa572438a5d0f359ac7f5dfd92ad6bda3">_drush_core_eval_shebang_script</a>($script_filename) {</div>
<div class="line"><a name="l01171"></a><span class="lineno"> 1171</span>&#160;  $found = FALSE;</div>
<div class="line"><a name="l01172"></a><span class="lineno"> 1172</span>&#160;  $fp = fopen($script_filename, <span class="stringliteral">&quot;r&quot;</span>);</div>
<div class="line"><a name="l01173"></a><span class="lineno"> 1173</span>&#160;  <span class="keywordflow">if</span> ($fp !== FALSE) {</div>
<div class="line"><a name="l01174"></a><span class="lineno"> 1174</span>&#160;    $line = fgets($fp);</div>
<div class="line"><a name="l01175"></a><span class="lineno"> 1175</span>&#160;    <span class="keywordflow">if</span> (<a class="code" href="drush_8inc.html#a997323f1acad3b9f003118bdcf3540c9">_drush_is_drush_shebang_line</a>($line)) {</div>
<div class="line"><a name="l01176"></a><span class="lineno"> 1176</span>&#160;      $first_script_line = <span class="stringliteral">&#39;&#39;</span>;</div>
<div class="line"><a name="l01177"></a><span class="lineno"> 1177</span>&#160;      <span class="keywordflow">while</span> ($line = fgets($fp)) {</div>
<div class="line"><a name="l01178"></a><span class="lineno"> 1178</span>&#160;        $line = trim($line);</div>
<div class="line"><a name="l01179"></a><span class="lineno"> 1179</span>&#160;        <span class="keywordflow">if</span> ($line == <span class="stringliteral">&#39;&lt;?php&#39;</span>) {</div>
<div class="line"><a name="l01180"></a><span class="lineno"> 1180</span>&#160;          $found = TRUE;</div>
<div class="line"><a name="l01181"></a><span class="lineno"> 1181</span>&#160;          <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l01182"></a><span class="lineno"> 1182</span>&#160;        }</div>
<div class="line"><a name="l01183"></a><span class="lineno"> 1183</span>&#160;        elseif (!empty($line)) {</div>
<div class="line"><a name="l01184"></a><span class="lineno"> 1184</span>&#160;          $first_script_line = $line . <span class="stringliteral">&quot;\n&quot;</span>;</div>
<div class="line"><a name="l01185"></a><span class="lineno"> 1185</span>&#160;          <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l01186"></a><span class="lineno"> 1186</span>&#160;        }</div>
<div class="line"><a name="l01187"></a><span class="lineno"> 1187</span>&#160;      }</div>
<div class="line"><a name="l01188"></a><span class="lineno"> 1188</span>&#160;      $script = stream_get_contents($fp);</div>
<div class="line"><a name="l01189"></a><span class="lineno"> 1189</span>&#160;      <span class="comment">// Pop off the first two arguments, the</span></div>
<div class="line"><a name="l01190"></a><span class="lineno"> 1190</span>&#160;      <span class="comment">// command (php-script) and the path to</span></div>
<div class="line"><a name="l01191"></a><span class="lineno"> 1191</span>&#160;      <span class="comment">// the script to execute, as a service</span></div>
<div class="line"><a name="l01192"></a><span class="lineno"> 1192</span>&#160;      <span class="comment">// to the script.</span></div>
<div class="line"><a name="l01193"></a><span class="lineno"> 1193</span>&#160;      eval($first_script_line . $script);</div>
<div class="line"><a name="l01194"></a><span class="lineno"> 1194</span>&#160;      $found = TRUE;</div>
<div class="line"><a name="l01195"></a><span class="lineno"> 1195</span>&#160;    }</div>
<div class="line"><a name="l01196"></a><span class="lineno"> 1196</span>&#160;    fclose($fp);</div>
<div class="line"><a name="l01197"></a><span class="lineno"> 1197</span>&#160;  }</div>
<div class="line"><a name="l01198"></a><span class="lineno"> 1198</span>&#160;  <span class="keywordflow">return</span> $found;</div>
<div class="line"><a name="l01199"></a><span class="lineno"> 1199</span>&#160;}</div>
<div class="line"><a name="l01200"></a><span class="lineno"> 1200</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l01201"></a><span class="lineno"> 1201</span>&#160;<span class="comment">/**</span></div>
<div class="line"><a name="l01202"></a><span class="lineno"> 1202</span>&#160;<span class="comment"> * Command callback. Process sets from the specified batch.</span></div>
<div class="line"><a name="l01203"></a><span class="lineno"> 1203</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l01204"></a><span class="lineno"> 1204</span>&#160;<span class="comment"> * This is the default batch processor that will be used if the $command parameter</span></div>
<div class="line"><a name="l01205"></a><span class="lineno"> 1205</span>&#160;<span class="comment"> * to drush_backend_batch_process() has not been specified.</span></div>
<div class="line"><a name="l01206"></a><span class="lineno"> 1206</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l01207"></a><span class="lineno"><a class="code" href="core_8drush_8inc.html#abffb38d0c5a78975e70033cb09f57ecb"> 1207</a></span>&#160;<span class="keyword">function</span> <a class="code" href="core_8drush_8inc.html#abffb38d0c5a78975e70033cb09f57ecb">drush_core_batch_process</a>($id) {</div>
<div class="line"><a name="l01208"></a><span class="lineno"> 1208</span>&#160;  <a class="code" href="includes_2batch_8inc.html#af470f96043a86e75e72cb186abf518ce">drush_batch_command</a>($id);</div>
<div class="line"><a name="l01209"></a><span class="lineno"> 1209</span>&#160;}</div>
<div class="line"><a name="l01210"></a><span class="lineno"> 1210</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l01211"></a><span class="lineno"> 1211</span>&#160;<span class="comment">/**</span></div>
<div class="line"><a name="l01212"></a><span class="lineno"> 1212</span>&#160;<span class="comment"> * Command callback. Process outstanding updates during updatedb.</span></div>
<div class="line"><a name="l01213"></a><span class="lineno"> 1213</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l01214"></a><span class="lineno"> 1214</span>&#160;<span class="comment"> * This is a batch processing command that makes use of the drush_backend_invoke</span></div>
<div class="line"><a name="l01215"></a><span class="lineno"> 1215</span>&#160;<span class="comment"> * api.</span></div>
<div class="line"><a name="l01216"></a><span class="lineno"> 1216</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l01217"></a><span class="lineno"> 1217</span>&#160;<span class="comment"> * This command includes the version specific update engine, which correctly</span></div>
<div class="line"><a name="l01218"></a><span class="lineno"> 1218</span>&#160;<span class="comment"> * initialises the environment to be able to successfully handle minor and major</span></div>
<div class="line"><a name="l01219"></a><span class="lineno"> 1219</span>&#160;<span class="comment"> * upgrades.</span></div>
<div class="line"><a name="l01220"></a><span class="lineno"> 1220</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l01221"></a><span class="lineno"><a class="code" href="core_8drush_8inc.html#a29b2ff77f4ca8032f23039c5d835c7ad"> 1221</a></span>&#160;<span class="keyword">function</span> <a class="code" href="core_8drush_8inc.html#a29b2ff77f4ca8032f23039c5d835c7ad">drush_core_updatedb_batch_process</a>($id) {</div>
<div class="line"><a name="l01222"></a><span class="lineno"> 1222</span>&#160;  <a class="code" href="engines_8inc.html#a92390a2dd40c8ed5190be4af058813a8">drush_include_engine</a>(<span class="stringliteral">&#39;drupal&#39;</span>, <span class="stringliteral">&#39;update&#39;</span>);</div>
<div class="line"><a name="l01223"></a><span class="lineno"> 1223</span>&#160;  _update_batch_command($id);</div>
<div class="line"><a name="l01224"></a><span class="lineno"> 1224</span>&#160;}</div>
<div class="line"><a name="l01225"></a><span class="lineno"> 1225</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l01226"></a><span class="lineno"> 1226</span>&#160;<span class="comment">/**</span></div>
<div class="line"><a name="l01227"></a><span class="lineno"> 1227</span>&#160;<span class="comment"> * Given a target (e.g. @site:%modules), return the evaluated directory path.</span></div>
<div class="line"><a name="l01228"></a><span class="lineno"> 1228</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l01229"></a><span class="lineno"> 1229</span>&#160;<span class="comment"> * @param $target</span></div>
<div class="line"><a name="l01230"></a><span class="lineno"> 1230</span>&#160;<span class="comment"> *   The target to evaluate.  Can be @site or /path or @site:path</span></div>
<div class="line"><a name="l01231"></a><span class="lineno"> 1231</span>&#160;<span class="comment"> *   or @site:%pathalias, etc. (just like rsync parameters)</span></div>
<div class="line"><a name="l01232"></a><span class="lineno"> 1232</span>&#160;<span class="comment"> * @param $component</span></div>
<div class="line"><a name="l01233"></a><span class="lineno"> 1233</span>&#160;<span class="comment"> *   The portion of the evaluated path to return.  Possible values:</span></div>
<div class="line"><a name="l01234"></a><span class="lineno"> 1234</span>&#160;<span class="comment"> *   &#39;path&#39; - the full path to the target (default)</span></div>
<div class="line"><a name="l01235"></a><span class="lineno"> 1235</span>&#160;<span class="comment"> *   &#39;name&#39; - the name of the site from the path (e.g. @site1)</span></div>
<div class="line"><a name="l01236"></a><span class="lineno"> 1236</span>&#160;<span class="comment"> *   &#39;user-path&#39; - the part after the &#39;:&#39; (e.g. %modules)</span></div>
<div class="line"><a name="l01237"></a><span class="lineno"> 1237</span>&#160;<span class="comment"> *   &#39;root&#39; &amp; &#39;uri&#39; - the Drupal root and URI of the site from the path</span></div>
<div class="line"><a name="l01238"></a><span class="lineno"> 1238</span>&#160;<span class="comment"> *   &#39;path-component&#39; - The &#39;:&#39; and the path</span></div>
<div class="line"><a name="l01239"></a><span class="lineno"> 1239</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l01240"></a><span class="lineno"><a class="code" href="core_8drush_8inc.html#a9a3c48f1649db4b3c008b11258cdcce5"> 1240</a></span>&#160;<span class="keyword">function</span> <a class="code" href="core_8drush_8inc.html#a9a3c48f1649db4b3c008b11258cdcce5">_drush_core_directory</a>($target = <span class="stringliteral">&#39;root&#39;</span>, $component = <span class="stringliteral">&#39;path&#39;</span>, $local_only = FALSE) {</div>
<div class="line"><a name="l01241"></a><span class="lineno"> 1241</span>&#160;  <span class="comment">// Normalize to a sitealias in the target.</span></div>
<div class="line"><a name="l01242"></a><span class="lineno"> 1242</span>&#160;  $normalized_target = $target;</div>
<div class="line"><a name="l01243"></a><span class="lineno"> 1243</span>&#160;  <span class="keywordflow">if</span> (strpos($target, <span class="charliteral">&#39;:&#39;</span>) === FALSE) {</div>
<div class="line"><a name="l01244"></a><span class="lineno"> 1244</span>&#160;    <span class="keywordflow">if</span> (substr($target, 0, 1) != <span class="charliteral">&#39;@&#39;</span>) {</div>
<div class="line"><a name="l01245"></a><span class="lineno"> 1245</span>&#160;      <span class="comment">// drush_sitealias_evaluate_path() requires bootstrap to database.</span></div>
<div class="line"><a name="l01246"></a><span class="lineno"> 1246</span>&#160;      <span class="keywordflow">if</span> (!drush_bootstrap_to_phase(DRUSH_BOOTSTRAP_DRUPAL_DATABASE)) {</div>
<div class="line"><a name="l01247"></a><span class="lineno"> 1247</span>&#160;        <span class="keywordflow">return</span> <a class="code" href="group__errorhandling.html#ga23fe9e1e8c1e5ade39256106044b6da4">drush_set_error</a>(<span class="stringliteral">&#39;DRUPAL_SITE_NOT_FOUND&#39;</span>, <a class="code" href="group__outputfunctions.html#ga1218abcb1e27dd3bb412113d1e344d96">dt</a>(<span class="stringliteral">&#39;You need to specify an alias or run this command within a drupal site.&#39;</span>));</div>
<div class="line"><a name="l01248"></a><span class="lineno"> 1248</span>&#160;      }</div>
<div class="line"><a name="l01249"></a><span class="lineno"> 1249</span>&#160;      $normalized_target = <span class="stringliteral">&#39;@self:&#39;</span>;</div>
<div class="line"><a name="l01250"></a><span class="lineno"> 1250</span>&#160;      <span class="keywordflow">if</span> (substr($target, 0, 1) != <span class="charliteral">&#39;%&#39;</span>) {</div>
<div class="line"><a name="l01251"></a><span class="lineno"> 1251</span>&#160;        $normalized_target .= <span class="charliteral">&#39;%&#39;</span>;</div>
<div class="line"><a name="l01252"></a><span class="lineno"> 1252</span>&#160;      }</div>
<div class="line"><a name="l01253"></a><span class="lineno"> 1253</span>&#160;      $normalized_target .= $target;</div>
<div class="line"><a name="l01254"></a><span class="lineno"> 1254</span>&#160;    }</div>
<div class="line"><a name="l01255"></a><span class="lineno"> 1255</span>&#160;  }</div>
<div class="line"><a name="l01256"></a><span class="lineno"> 1256</span>&#160;  $additional_options = array();</div>
<div class="line"><a name="l01257"></a><span class="lineno"> 1257</span>&#160;  $values = <a class="code" href="sitealias_8inc.html#ad847d30de6caee61a30ebc2059f9ad5a">drush_sitealias_evaluate_path</a>($normalized_target, $additional_options, $local_only);</div>
<div class="line"><a name="l01258"></a><span class="lineno"> 1258</span>&#160;  <span class="keywordflow">if</span> (isset($values[$component])) {</div>
<div class="line"><a name="l01259"></a><span class="lineno"> 1259</span>&#160;    <span class="comment">// Hurray, we found the destination.</span></div>
<div class="line"><a name="l01260"></a><span class="lineno"> 1260</span>&#160;    <span class="keywordflow">return</span> $values[$component];</div>
<div class="line"><a name="l01261"></a><span class="lineno"> 1261</span>&#160;  }</div>
<div class="line"><a name="l01262"></a><span class="lineno"> 1262</span>&#160;}</div>
<div class="line"><a name="l01263"></a><span class="lineno"> 1263</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l01264"></a><span class="lineno"> 1264</span>&#160;<span class="comment">/**</span></div>
<div class="line"><a name="l01265"></a><span class="lineno"> 1265</span>&#160;<span class="comment"> * Command callback.</span></div>
<div class="line"><a name="l01266"></a><span class="lineno"> 1266</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l01267"></a><span class="lineno"><a class="code" href="core_8drush_8inc.html#af176c288575033228263e7f9fcf406f4"> 1267</a></span>&#160;<span class="keyword">function</span> <a class="code" href="core_8drush_8inc.html#af176c288575033228263e7f9fcf406f4">drush_core_drupal_directory</a>($target = <span class="stringliteral">&#39;root&#39;</span>) {</div>
<div class="line"><a name="l01268"></a><span class="lineno"> 1268</span>&#160;  $path = <a class="code" href="core_8drush_8inc.html#a9a3c48f1649db4b3c008b11258cdcce5">_drush_core_directory</a>($target, <a class="code" href="context_8inc.html#afe91fb3e5219ecb2208c3b036b1f0cb8">drush_get_option</a>(<span class="stringliteral">&#39;component&#39;</span>, <span class="stringliteral">&#39;path&#39;</span>), <a class="code" href="context_8inc.html#afe91fb3e5219ecb2208c3b036b1f0cb8">drush_get_option</a>(<span class="stringliteral">&#39;local-only&#39;</span>, FALSE));</div>
<div class="line"><a name="l01269"></a><span class="lineno"> 1269</span>&#160;</div>
<div class="line"><a name="l01270"></a><span class="lineno"> 1270</span>&#160;  <span class="comment">// If _drush_core_directory is working right, it will turn</span></div>
<div class="line"><a name="l01271"></a><span class="lineno"> 1271</span>&#160;  <span class="comment">// %blah into the path to the item referred to by the key &#39;blah&#39;.</span></div>
<div class="line"><a name="l01272"></a><span class="lineno"> 1272</span>&#160;  <span class="comment">// If there is no such key, then no replacement is done.  In the</span></div>
<div class="line"><a name="l01273"></a><span class="lineno"> 1273</span>&#160;  <span class="comment">// case of the dd command, we will consider it an error if</span></div>
<div class="line"><a name="l01274"></a><span class="lineno"> 1274</span>&#160;  <span class="comment">// any keys are -not- replaced in _drush_core_directory.</span></div>
<div class="line"><a name="l01275"></a><span class="lineno"> 1275</span>&#160;  <span class="keywordflow">if</span> ($path &amp;&amp; (strpos($path, <span class="charliteral">&#39;%&#39;</span>) === FALSE)) {</div>
<div class="line"><a name="l01276"></a><span class="lineno"> 1276</span>&#160;    <span class="keywordflow">return</span> $path;</div>
<div class="line"><a name="l01277"></a><span class="lineno"> 1277</span>&#160;  }</div>
<div class="line"><a name="l01278"></a><span class="lineno"> 1278</span>&#160;  <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l01279"></a><span class="lineno"> 1279</span>&#160;    <span class="keywordflow">return</span> <a class="code" href="group__errorhandling.html#ga23fe9e1e8c1e5ade39256106044b6da4">drush_set_error</a>(<span class="stringliteral">&#39;DRUSH_TARGET_NOT_FOUND&#39;</span>, <a class="code" href="group__outputfunctions.html#ga1218abcb1e27dd3bb412113d1e344d96">dt</a>(<span class="stringliteral">&quot;Target &#39;!target&#39; not found.&quot;</span>, array(<span class="stringliteral">&#39;!target&#39;</span> =&gt; $target)));</div>
<div class="line"><a name="l01280"></a><span class="lineno"> 1280</span>&#160;  }</div>
<div class="line"><a name="l01281"></a><span class="lineno"> 1281</span>&#160;}</div>
<div class="line"><a name="l01282"></a><span class="lineno"> 1282</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l01283"></a><span class="lineno"> 1283</span>&#160;<span class="comment">/**</span></div>
<div class="line"><a name="l01284"></a><span class="lineno"> 1284</span>&#160;<span class="comment"> * Called for `drush version` or `drush --version`</span></div>
<div class="line"><a name="l01285"></a><span class="lineno"> 1285</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l01286"></a><span class="lineno"><a class="code" href="core_8drush_8inc.html#adb0ebb75d18c15a7e3dbdb9ceada9837"> 1286</a></span>&#160;<span class="keyword">function</span> <a class="code" href="core_8drush_8inc.html#adb0ebb75d18c15a7e3dbdb9ceada9837">drush_core_version</a>() {</div>
<div class="line"><a name="l01287"></a><span class="lineno"> 1287</span>&#160;  <span class="keywordflow">return</span> <a class="code" href="classDrush.html#a7fd94bdcfdc97722498b22f8c901d866">Drush::getVersion</a>();</div>
<div class="line"><a name="l01288"></a><span class="lineno"> 1288</span>&#160;}</div>
<div class="line"><a name="l01289"></a><span class="lineno"> 1289</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l01290"></a><span class="lineno"> 1290</span>&#160;<span class="comment">/**</span></div>
<div class="line"><a name="l01291"></a><span class="lineno"> 1291</span>&#160;<span class="comment"> * Command callback. Execute specified shell code. Often used by shell aliases</span></div>
<div class="line"><a name="l01292"></a><span class="lineno"> 1292</span>&#160;<span class="comment"> * that start with !.</span></div>
<div class="line"><a name="l01293"></a><span class="lineno"> 1293</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l01294"></a><span class="lineno"><a class="code" href="core_8drush_8inc.html#a2df55d0bcfe26bcf84f513623345b9d8"> 1294</a></span>&#160;<span class="keyword">function</span> <a class="code" href="core_8drush_8inc.html#a2df55d0bcfe26bcf84f513623345b9d8">drush_core_execute</a>() {</div>
<div class="line"><a name="l01295"></a><span class="lineno"> 1295</span>&#160;  $result = TRUE;</div>
<div class="line"><a name="l01296"></a><span class="lineno"> 1296</span>&#160;  $escape = <a class="code" href="context_8inc.html#afe91fb3e5219ecb2208c3b036b1f0cb8">drush_get_option</a>(<span class="stringliteral">&#39;escape&#39;</span>, TRUE);</div>
<div class="line"><a name="l01297"></a><span class="lineno"> 1297</span>&#160;  <span class="comment">// Get all of the args and options that appear after the command name.</span></div>
<div class="line"><a name="l01298"></a><span class="lineno"> 1298</span>&#160;  $args = <a class="code" href="command_8inc.html#a272d98da256f7ae2988f3aa7cb6b464b">drush_get_original_cli_args_and_options</a>();</div>
<div class="line"><a name="l01299"></a><span class="lineno"> 1299</span>&#160;  <span class="keywordflow">if</span> ($escape) {</div>
<div class="line"><a name="l01300"></a><span class="lineno"> 1300</span>&#160;    <span class="keywordflow">for</span> ($x = 0; $x &lt; count($args); $x++) {</div>
<div class="line"><a name="l01301"></a><span class="lineno"> 1301</span>&#160;      <span class="comment">// escape all args except for command separators.</span></div>
<div class="line"><a name="l01302"></a><span class="lineno"> 1302</span>&#160;      <span class="keywordflow">if</span> (!in_array($args[$x], array(<span class="stringliteral">&#39;&amp;&amp;&#39;</span>, <span class="stringliteral">&#39;||&#39;</span>, <span class="charliteral">&#39;;&#39;</span>))) {</div>
<div class="line"><a name="l01303"></a><span class="lineno"> 1303</span>&#160;        $args[$x] = drush_escapeshellarg($args[$x]);</div>
<div class="line"><a name="l01304"></a><span class="lineno"> 1304</span>&#160;      }</div>
<div class="line"><a name="l01305"></a><span class="lineno"> 1305</span>&#160;    }</div>
<div class="line"><a name="l01306"></a><span class="lineno"> 1306</span>&#160;  }</div>
<div class="line"><a name="l01307"></a><span class="lineno"> 1307</span>&#160;  $cmd = implode(<span class="charliteral">&#39; &#39;</span>, $args);</div>
<div class="line"><a name="l01308"></a><span class="lineno"> 1308</span>&#160;  <span class="comment">// If we selected a Drupal site, then cwd to the site root prior to exec</span></div>
<div class="line"><a name="l01309"></a><span class="lineno"> 1309</span>&#160;  $cwd = FALSE;</div>
<div class="line"><a name="l01310"></a><span class="lineno"> 1310</span>&#160;  <span class="keywordflow">if</span> ($selected_root = \<a class="code" href="classDrush.html#a104f09419bc8a46c4bf205b49268b3a4">Drush::bootstrapManager</a>()-&gt;getRoot()) {</div>
<div class="line"><a name="l01311"></a><span class="lineno"> 1311</span>&#160;    <span class="keywordflow">if</span> (is_dir($selected_root)) {</div>
<div class="line"><a name="l01312"></a><span class="lineno"> 1312</span>&#160;      $cwd = getcwd();</div>
<div class="line"><a name="l01313"></a><span class="lineno"> 1313</span>&#160;      <a class="code" href="drush_8inc.html#acebe9ed4e4825e6d33ab8dff2157b676">drush_op</a>(<span class="stringliteral">&#39;chdir&#39;</span>, $selected_root);</div>
<div class="line"><a name="l01314"></a><span class="lineno"> 1314</span>&#160;    }</div>
<div class="line"><a name="l01315"></a><span class="lineno"> 1315</span>&#160;  }</div>
<div class="line"><a name="l01316"></a><span class="lineno"> 1316</span>&#160;  <span class="keywordflow">if</span> ($alias = <a class="code" href="context_8inc.html#ad25559f8d7d753f636fbeac347c29fc5">drush_get_context</a>(<span class="stringliteral">&#39;DRUSH_TARGET_SITE_ALIAS&#39;</span>)) {</div>
<div class="line"><a name="l01317"></a><span class="lineno"> 1317</span>&#160;    $site = <a class="code" href="sitealias_8inc.html#ac2f57b80441374522c4e4cdc3b7e0c2b">drush_sitealias_get_record</a>($alias);</div>
<div class="line"><a name="l01318"></a><span class="lineno"> 1318</span>&#160;    <span class="keywordflow">if</span> (!empty($site[<span class="stringliteral">&#39;site-list&#39;</span>])) {</div>
<div class="line"><a name="l01319"></a><span class="lineno"> 1319</span>&#160;      $sites = <a class="code" href="sitealias_8inc.html#a79d866a010f76b7d6ec47ab2a72a0c43">drush_sitealias_resolve_sitelist</a>($site);</div>
<div class="line"><a name="l01320"></a><span class="lineno"> 1320</span>&#160;      <span class="keywordflow">foreach</span> ($sites as $site_name =&gt; $site_spec) {</div>
<div class="line"><a name="l01321"></a><span class="lineno"> 1321</span>&#160;        $result = <a class="code" href="core_8drush_8inc.html#a056266865af8fe0a2178f1b6cd36dea1">_drush_core_execute_cmd</a>($site_spec, $cmd);</div>
<div class="line"><a name="l01322"></a><span class="lineno"> 1322</span>&#160;        <span class="keywordflow">if</span> (!$result) {</div>
<div class="line"><a name="l01323"></a><span class="lineno"> 1323</span>&#160;          <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l01324"></a><span class="lineno"> 1324</span>&#160;        }</div>
<div class="line"><a name="l01325"></a><span class="lineno"> 1325</span>&#160;      }</div>
<div class="line"><a name="l01326"></a><span class="lineno"> 1326</span>&#160;    }</div>
<div class="line"><a name="l01327"></a><span class="lineno"> 1327</span>&#160;    <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l01328"></a><span class="lineno"> 1328</span>&#160;      $result = <a class="code" href="core_8drush_8inc.html#a056266865af8fe0a2178f1b6cd36dea1">_drush_core_execute_cmd</a>($site, $cmd);</div>
<div class="line"><a name="l01329"></a><span class="lineno"> 1329</span>&#160;    }</div>
<div class="line"><a name="l01330"></a><span class="lineno"> 1330</span>&#160;  }</div>
<div class="line"><a name="l01331"></a><span class="lineno"> 1331</span>&#160;  <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l01332"></a><span class="lineno"> 1332</span>&#160;    <span class="comment">// Must be a local command.</span></div>
<div class="line"><a name="l01333"></a><span class="lineno"> 1333</span>&#160;    $result = (<a class="code" href="group__commandwrappers.html#ga3a1bb3ae751f14749ce1dbe4ec9c3288">drush_shell_proc_open</a>($cmd) == 0);</div>
<div class="line"><a name="l01334"></a><span class="lineno"> 1334</span>&#160;  }</div>
<div class="line"><a name="l01335"></a><span class="lineno"> 1335</span>&#160;  <span class="comment">// Restore the cwd if we changed it</span></div>
<div class="line"><a name="l01336"></a><span class="lineno"> 1336</span>&#160;  <span class="keywordflow">if</span> ($cwd) {</div>
<div class="line"><a name="l01337"></a><span class="lineno"> 1337</span>&#160;    <a class="code" href="drush_8inc.html#acebe9ed4e4825e6d33ab8dff2157b676">drush_op</a>(<span class="stringliteral">&#39;chdir&#39;</span>, $selected_root);</div>
<div class="line"><a name="l01338"></a><span class="lineno"> 1338</span>&#160;  }</div>
<div class="line"><a name="l01339"></a><span class="lineno"> 1339</span>&#160;  <span class="keywordflow">if</span> (!$result) {</div>
<div class="line"><a name="l01340"></a><span class="lineno"> 1340</span>&#160;    <span class="keywordflow">return</span> <a class="code" href="group__errorhandling.html#ga23fe9e1e8c1e5ade39256106044b6da4">drush_set_error</a>(<span class="stringliteral">&#39;CORE_EXECUTE_FAILED&#39;</span>, <a class="code" href="group__outputfunctions.html#ga1218abcb1e27dd3bb412113d1e344d96">dt</a>(<span class="stringliteral">&quot;Command !command failed.&quot;</span>, array(<span class="stringliteral">&#39;!command&#39;</span> =&gt; $cmd)));</div>
<div class="line"><a name="l01341"></a><span class="lineno"> 1341</span>&#160;  }</div>
<div class="line"><a name="l01342"></a><span class="lineno"> 1342</span>&#160;  <span class="keywordflow">return</span> $result;</div>
<div class="line"><a name="l01343"></a><span class="lineno"> 1343</span>&#160;}</div>
<div class="line"><a name="l01344"></a><span class="lineno"> 1344</span>&#160;</div>
<div class="line"><a name="l01345"></a><span class="lineno"> 1345</span>&#160;<span class="keyword">function</span> drush_core_twig_compile() {</div>
<div class="line"><a name="l01346"></a><span class="lineno"> 1346</span>&#160;  require_once DRUSH_DRUPAL_CORE . <span class="stringliteral">&quot;/themes/engines/twig/twig.engine&quot;</span>;</div>
<div class="line"><a name="l01347"></a><span class="lineno"> 1347</span>&#160;  <span class="comment">// Scan all enabled modules and themes.</span></div>
<div class="line"><a name="l01348"></a><span class="lineno"> 1348</span>&#160;  <span class="comment">// @todo refactor since \Drush\Boot\DrupalBoot::commandfile_searchpaths is similar.</span></div>
<div class="line"><a name="l01349"></a><span class="lineno"> 1349</span>&#160;  $ignored_modules = <a class="code" href="context_8inc.html#ade60e65f76863ed34db22f5e7f83a150">drush_get_option_list</a>(<span class="stringliteral">&#39;ignored-modules&#39;</span>, array());</div>
<div class="line"><a name="l01350"></a><span class="lineno"> 1350</span>&#160;  $cid = <a class="code" href="drupal_8inc.html#a6def9b165115bf72a27e13f4949149da">drush_cid_install_profile</a>();</div>
<div class="line"><a name="l01351"></a><span class="lineno"> 1351</span>&#160;  <span class="keywordflow">if</span> ($cached = <a class="code" href="includes_2cache_8inc.html#adc36ac3b562c67cbf1d7aab89c029694">drush_cache_get</a>($cid)) {</div>
<div class="line"><a name="l01352"></a><span class="lineno"> 1352</span>&#160;    $ignored_modules[] = $cached-&gt;data;</div>
<div class="line"><a name="l01353"></a><span class="lineno"> 1353</span>&#160;  }</div>
<div class="line"><a name="l01354"></a><span class="lineno"> 1354</span>&#160;  <span class="keywordflow">foreach</span> (array_diff(<a class="code" href="commands_2core_2drupal_2environment_8inc.html#aa53b2f8e66f3d43eb5d1dc16c1d97f94">drush_module_list</a>(), $ignored_modules) as $module) {</div>
<div class="line"><a name="l01355"></a><span class="lineno"> 1355</span>&#160;    $searchpaths[] = drupal_get_path(<span class="stringliteral">&#39;module&#39;</span>, $module);</div>
<div class="line"><a name="l01356"></a><span class="lineno"> 1356</span>&#160;  }</div>
<div class="line"><a name="l01357"></a><span class="lineno"> 1357</span>&#160;</div>
<div class="line"><a name="l01358"></a><span class="lineno"> 1358</span>&#160;  $themes = <a class="code" href="commands_2core_2drupal_2environment_8inc.html#a19545e0580af247ff2d6ecc55944a731">drush_theme_list</a>();</div>
<div class="line"><a name="l01359"></a><span class="lineno"> 1359</span>&#160;  <span class="keywordflow">foreach</span> ($themes as $name =&gt; $theme) {</div>
<div class="line"><a name="l01360"></a><span class="lineno"> 1360</span>&#160;    $searchpaths[] = $theme-&gt;getPath();</div>
<div class="line"><a name="l01361"></a><span class="lineno"> 1361</span>&#160;  }</div>
<div class="line"><a name="l01362"></a><span class="lineno"> 1362</span>&#160;  </div>
<div class="line"><a name="l01363"></a><span class="lineno"> 1363</span>&#160;  <span class="keywordflow">foreach</span> ($searchpaths as $searchpath) {</div>
<div class="line"><a name="l01364"></a><span class="lineno"> 1364</span>&#160;    <span class="keywordflow">foreach</span> ($file = <a class="code" href="group__filesystemfunctions.html#ga1c545390a8890f6ea47385f79fbe2e82">drush_scan_directory</a>($searchpath, <span class="stringliteral">&#39;/\.html.twig/&#39;</span>, array(<span class="stringliteral">&#39;tests&#39;</span>)) as $file) {</div>
<div class="line"><a name="l01365"></a><span class="lineno"> 1365</span>&#160;      $relative = str_replace(<a class="code" href="context_8inc.html#ad25559f8d7d753f636fbeac347c29fc5">drush_get_context</a>(<span class="stringliteral">&#39;DRUSH_DRUPAL_ROOT&#39;</span>). <span class="charliteral">&#39;/&#39;</span>, <span class="stringliteral">&#39;&#39;</span>, $file-&gt;filename);</div>
<div class="line"><a name="l01366"></a><span class="lineno"> 1366</span>&#160;      <span class="comment">// @todo Dynamically disable twig debugging since there is no good info there anyway.</span></div>
<div class="line"><a name="l01367"></a><span class="lineno"> 1367</span>&#160;      twig_render_template($relative, array(<span class="stringliteral">&#39;theme_hook_original&#39;</span> =&gt; <span class="stringliteral">&#39;&#39;</span>));</div>
<div class="line"><a name="l01368"></a><span class="lineno"> 1368</span>&#160;      <a class="code" href="group__logging.html#ga47324b65808524558a488916b150dd51">drush_log</a>(<a class="code" href="group__outputfunctions.html#ga1218abcb1e27dd3bb412113d1e344d96">dt</a>(<span class="stringliteral">&#39;Compiled twig template !path&#39;</span>, array(<span class="stringliteral">&#39;!path&#39;</span> =&gt; $relative)), LogLevel::INFO);</div>
<div class="line"><a name="l01369"></a><span class="lineno"> 1369</span>&#160;    }</div>
<div class="line"><a name="l01370"></a><span class="lineno"> 1370</span>&#160;  }</div>
<div class="line"><a name="l01371"></a><span class="lineno"> 1371</span>&#160;}</div>
<div class="line"><a name="l01372"></a><span class="lineno"> 1372</span>&#160;<span class="comment"></span></div>
<div class="line"><a name="l01373"></a><span class="lineno"> 1373</span>&#160;<span class="comment">/**</span></div>
<div class="line"><a name="l01374"></a><span class="lineno"> 1374</span>&#160;<span class="comment"> * Helper function for drush_core_execute: run one shell command</span></div>
<div class="line"><a name="l01375"></a><span class="lineno"> 1375</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l01376"></a><span class="lineno"><a class="code" href="core_8drush_8inc.html#a056266865af8fe0a2178f1b6cd36dea1"> 1376</a></span>&#160;<span class="keyword">function</span> <a class="code" href="core_8drush_8inc.html#a056266865af8fe0a2178f1b6cd36dea1">_drush_core_execute_cmd</a>($site, $cmd) {</div>
<div class="line"><a name="l01377"></a><span class="lineno"> 1377</span>&#160;  <span class="keywordflow">if</span> (!empty($site[<span class="stringliteral">&#39;remote-host&#39;</span>])) {</div>
<div class="line"><a name="l01378"></a><span class="lineno"> 1378</span>&#160;    <span class="comment">// Remote, so execute an ssh command with a bash fragment at the end.</span></div>
<div class="line"><a name="l01379"></a><span class="lineno"> 1379</span>&#160;    $exec = <a class="code" href="group__commandwrappers.html#ga78a7ff5045fa4fc20c8e24dd2ba8d777">drush_shell_proc_build</a>($site, $cmd, TRUE);</div>
<div class="line"><a name="l01380"></a><span class="lineno"> 1380</span>&#160;    <span class="keywordflow">return</span> (<a class="code" href="group__commandwrappers.html#ga3a1bb3ae751f14749ce1dbe4ec9c3288">drush_shell_proc_open</a>($exec) == 0);</div>
<div class="line"><a name="l01381"></a><span class="lineno"> 1381</span>&#160;  }</div>
<div class="line"><a name="l01382"></a><span class="lineno"> 1382</span>&#160;  elseif (!empty($site[<span class="stringliteral">&#39;root&#39;</span>]) &amp;&amp; is_dir($site[<span class="stringliteral">&#39;root&#39;</span>])) {</div>
<div class="line"><a name="l01383"></a><span class="lineno"> 1383</span>&#160;    <span class="keywordflow">return</span> (<a class="code" href="group__commandwrappers.html#ga3a1bb3ae751f14749ce1dbe4ec9c3288">drush_shell_proc_open</a>(<span class="stringliteral">&#39;cd &#39;</span> . drush_escapeshellarg($site[<span class="stringliteral">&#39;root&#39;</span>]) . <span class="stringliteral">&#39; &amp;&amp; &#39;</span> . $cmd) == 0);</div>
<div class="line"><a name="l01384"></a><span class="lineno"> 1384</span>&#160;  }</div>
<div class="line"><a name="l01385"></a><span class="lineno"> 1385</span>&#160;  <span class="keywordflow">return</span> (<a class="code" href="group__commandwrappers.html#ga3a1bb3ae751f14749ce1dbe4ec9c3288">drush_shell_proc_open</a>($cmd) == 0);</div>
<div class="line"><a name="l01386"></a><span class="lineno"> 1386</span>&#160;}</div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Wed Nov 2 2016 07:28:51 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>