class DrushBatchContext

  1. 8.0.x includes/ DrushBatchContext
  2. 6.x includes/ DrushBatchContext
  3. 7.x includes/ DrushBatchContext
  4. 5.x includes/ DrushBatchContext
  5. master includes/ 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



Expanded class hierarchy of DrushBatchContext


Contains filters are case sensitive


includes/, line 36
Drush batch API.

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