X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=vendor%2Fdrush%2Fdrush%2Flib%2FDrush%2FBoot%2FBaseBoot.php;fp=vendor%2Fdrush%2Fdrush%2Flib%2FDrush%2FBoot%2FBaseBoot.php;h=c816988c45406b1e338d65dcd3fa5fbe401ef35b;hp=0000000000000000000000000000000000000000;hb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;hpb=57c063afa3f66b07c4bbddc2d6129a96d90f0aad diff --git a/vendor/drush/drush/lib/Drush/Boot/BaseBoot.php b/vendor/drush/drush/lib/Drush/Boot/BaseBoot.php new file mode 100644 index 000000000..c816988c4 --- /dev/null +++ b/vendor/drush/drush/lib/Drush/Boot/BaseBoot.php @@ -0,0 +1,100 @@ + $error) { + drush_set_error($key, $error); + } + drush_set_error('DRUSH_COMMAND_NOT_EXECUTABLE', dt("The drush command '!args' could not be executed.", array('!args' => $args))); + } + elseif (!empty($args)) { + drush_set_error('DRUSH_COMMAND_NOT_FOUND', dt("The drush command '!args' could not be found. Run `drush cache-clear drush` to clear the commandfile cache if you have installed new extensions.", array('!args' => $args))); + } + // Set errors that occurred in the bootstrap phases. + $errors = drush_get_context('DRUSH_BOOTSTRAP_ERRORS', array()); + foreach ($errors as $code => $message) { + drush_set_error($code, $message); + } + } + + function bootstrap_and_dispatch() { + $phases = $this->bootstrap_init_phases(); + + $return = ''; + $command_found = FALSE; + _drush_bootstrap_output_prepare(); + foreach ($phases as $phase) { + if (drush_bootstrap_to_phase($phase)) { + $command = drush_parse_command(); + if (is_array($command)) { + $command += $this->command_defaults(); + // Insure that we have bootstrapped to a high enough + // phase for the command prior to enforcing requirements. + $bootstrap_result = drush_bootstrap_to_phase($command['bootstrap']); + $this->enforce_requirement($command); + + if ($bootstrap_result && empty($command['bootstrap_errors'])) { + drush_log(dt("Found command: !command (commandfile=!commandfile)", array('!command' => $command['command'], '!commandfile' => $command['commandfile'])), LogLevel::BOOTSTRAP); + + $command_found = TRUE; + // Dispatch the command(s). + $return = drush_dispatch($command); + + // Prevent a '1' at the end of the output. + if ($return === TRUE) { + $return = ''; + } + + if (drush_get_context('DRUSH_DEBUG') && !drush_get_context('DRUSH_QUIET')) { + // @todo Create version independant wrapper around Drupal timers. Use it. + drush_print_timers(); + } + break; + } + } + } + else { + break; + } + } + + if (!$command_found) { + // If we reach this point, command doesn't fit requirements or we have not + // found either a valid or matching command. + $this->report_command_error($command); + } + return $return; + } + + /** + * {@inheritdoc} + */ + public function terminate() { + } +}