class DrushBatchContext

  1. 8.0.x includes/batch.inc DrushBatchContext
  2. 6.x includes/batch.inc DrushBatchContext
  3. 7.x includes/batch.inc DrushBatchContext
  4. 5.x includes/batch.inc DrushBatchContext
  5. master includes/batch.inc DrushBatchContext

Class extending ArrayObject to allow the batch API to perform logging when some keys of the array change.

It is used to wrap batch's $context array and set log messages when values are assigned to keys 'message' or 'error_message'.

See also

_drush_batch_worker().

Hierarchy

Expanded class hierarchy of DrushBatchContext

Members

Contains filters are case sensitive

File

includes/batch.inc, line 38
Drush batch API.

View source
class DrushBatchContext extends ArrayObject {
  function offsetSet($name, $value) {
    if ($name == 'message') {
      drush_log(strip_tags($value), LogLevel::OK);
    }
    elseif ($name == 'error_message') {
      drush_set_error('DRUSH_BATCH_ERROR', strip_tags($value));
    }
    parent::offsetSet($name, $value);
  }
}