function DrushBatchContext::offsetSet

8.0.x batch.inc DrushBatchContext::offsetSet($name, $value)
6.x batch.inc DrushBatchContext::offsetSet($name, $value)
7.x batch.inc DrushBatchContext::offsetSet($name, $value)
5.x batch.inc DrushBatchContext::offsetSet($name, $value)
master batch.inc DrushBatchContext::offsetSet($name, $value)

File

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

Class

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

Code

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);
}