You are here

private function Update::batchProcess in DRD Agent 8.3

Same name and namespace in other branches
  1. 4.0.x src/Agent/Action/Update.php \Drupal\drd_agent\Agent\Action\Update::batchProcess()

Main loop to run operations until they've finished.

Parameters

$operations:

$context:

1 call to Update::batchProcess()
Update::batch in src/Agent/Action/Update.php
Callback to determine and execute all required operations.

File

src/Agent/Action/Update.php, line 117

Class

Update
Provides a 'Update' code.

Namespace

Drupal\drd_agent\Agent\Action

Code

private function batchProcess($operations, &$context) {
  foreach ($operations as $operation) {
    $context['finished'] = FALSE;
    $context['sandbox']['#finished'] = TRUE;
    $operation[1][] =& $context;
    $finished = FALSE;
    while (!$finished) {
      call_user_func_array($operation[0], $operation[1]);
      $finished = !empty($context['finished']) || !empty($context['sandbox']['#finished']);
    }
  }
}