You are here

function acquia_lift_drush_batch_finished in Acquia Lift Connector 7.2

Same name and namespace in other branches
  1. 7 acquia_lift.drush.inc \acquia_lift_drush_batch_finished()

Batch API callback for when processing of all items is complete.

Parameters

$success: Whether or not the batch completed successfully.

$results: An array holding the results of each operation.

$operations: An array of unprocessed operations.

1 string reference to 'acquia_lift_drush_batch_finished'
drush_acquia_lift_campaign_sync in ./acquia_lift.drush.inc
Syncs the Acquia Lift Campaigns.

File

./acquia_lift.drush.inc, line 134
acquia_lift.drush.inc Provides Acquia Lift drush commands.

Code

function acquia_lift_drush_batch_finished($success, $results, $operations) {

  // See if an error occurred.
  if (!$success) {

    // $operations contains the operations that remained unprocessed.
    $error_operation = reset($operations);
    $message = '- ' . dt('An error occurred while processing %error_operation with arguments: @arguments', array(
      '%error_operation' => $error_operation[0],
      '@arguments' => print_r($error_operation[1], TRUE),
    ));
    drush_log($message, 'error');
    return;
  }
  foreach ($results as $result) {
    $message = '- ' . dt($result);
    $message_type = 'ok';
    if (strpos($result, ACQUIA_LIFT_OPERATION_ERROR_PREFIX) === 0) {
      $message_type = 'error';
    }
    drush_log($message, $message_type);
  }
}