Skip to content
Permalink
Browse files

by rlmumford: Support batch updates. (#4057)

  • Loading branch information...
rlmumford authored and enzolutions committed May 23, 2019
1 parent 5d6a21a commit db15e4e316b6b7fee2001fa8392245d3ea55c855
Showing with 17 additions and 6 deletions.
  1. +17 −6 src/Command/Update/ExecuteCommand.php
@@ -348,13 +348,24 @@ protected function getUpdateList()
private function executeUpdate($function, &$context)
{
if (!$context || !array_key_exists('sandbox', $context)) {
$context['sandbox'] = [];
}
$context['sandbox'] = [];
do {
if (function_exists($function)) {
$return = $function($context['sandbox']);
if (is_string($return)) {
$this->getIo()->info(
" ".$return
);
}
if (function_exists($function)) {
$function($context['sandbox']);
}
if (isset($context['sandbox']['#finished']) && ($context['sandbox']['#finished'] < 1)) {
$this->getIo()->info(
' Processed '.number_format($context['sandbox']['#finished'] * 100, 2).'%'
);
}
}
} while (isset($context['sandbox']['#finished']) && ($context['sandbox']['#finished'] < 1));
return true;
}

0 comments on commit db15e4e

Please sign in to comment.
You can’t perform that action at this time.