From bd25206962a5740900551e2cbad0ab1f9f19f2a3 Mon Sep 17 00:00:00 2001 From: Moshe Weitzman Date: Thu, 8 Dec 2016 10:39:52 -0500 Subject: [PATCH] Port batch commands to annotated. (#2491) * Port batch commands to annotated. * Try to fix batch error. * Forgot to add the annotated file. --- commands/core/core.drush.inc | 47 ----------------------- lib/Drush/Commands/core/BatchCommands.php | 35 +++++++++++++++++ tests/batchTest.php | 2 +- 3 files changed, 36 insertions(+), 48 deletions(-) create mode 100644 lib/Drush/Commands/core/BatchCommands.php diff --git a/commands/core/core.drush.inc b/commands/core/core.drush.inc index e1049b5da1..bda17d8c71 100644 --- a/commands/core/core.drush.inc +++ b/commands/core/core.drush.inc @@ -122,28 +122,6 @@ function core_drush_command() { 'aliases' => array('rsync'), 'topics' => array('docs-aliases'), ); - - $items['batch-process'] = array( - 'description' => 'Process operations in the specified batch set', - 'hidden' => TRUE, - 'arguments' => array( - 'batch-id' => 'The batch id that will be processed.', - ), - 'required-arguments' => TRUE, - 'bootstrap' => DRUSH_BOOTSTRAP_DRUPAL_LOGIN, - ); - - $items['updatedb-batch-process'] = array( - 'description' => 'Perform update functions', - 'hidden' => TRUE, - 'arguments' => array( - 'batch-id' => 'The batch id that will be processed', - ), - 'required-arguments' => TRUE, - // Drupal 7 needs DRUSH_BOOTSTRAP_DRUPAL_CONFIGURATION, while Drupal 8 needs _FULL. - // Therefore we bootstrap to _FULL in commands/core/drupal/update.inc. - 'bootstrap' => DRUSH_BOOTSTRAP_DRUPAL_CONFIGURATION, - ); $items['core-quick-drupal'] = array( 'description' => 'Download, install, serve and login to Drupal with minimal configuration and dependencies.', 'bootstrap' => DRUSH_BOOTSTRAP_NONE, @@ -623,31 +601,6 @@ function drush_core_quick_drupal_options(&$items) { $items['core-quick-drupal']['engines'] = $pm['pm-download']['engines']; } -/** - * Command callback. Process sets from the specified batch. - * - * This is the default batch processor that will be used if the $command parameter - * to drush_backend_batch_process() has not been specified. - */ -function drush_core_batch_process($id) { - drush_batch_command($id); -} - -/** - * Command callback. Process outstanding updates during updatedb. - * - * This is a batch processing command that makes use of the drush_backend_invoke - * api. - * - * This command includes the version specific update engine, which correctly - * initialises the environment to be able to successfully handle minor and major - * upgrades. - */ -function drush_core_updatedb_batch_process($id) { - drush_include_engine('drupal', 'update'); - _update_batch_command($id); -} - /** * Called for `drush version` or `drush --version` */ diff --git a/lib/Drush/Commands/core/BatchCommands.php b/lib/Drush/Commands/core/BatchCommands.php new file mode 100644 index 0000000000..3f5c5482a6 --- /dev/null +++ b/lib/Drush/Commands/core/BatchCommands.php @@ -0,0 +1,35 @@ + $this->webroot(), 'uri' => key($sites), 'yes' => NULL, - 'include' => dirname(__FILE__), + 'include' => __DIR__, ); $this->drush('unit-batch', array(), $options); // Collect log messages that begin with "!!!" (@see: _drush_unit_batch_operation())