function _update_do_one

8.0.x update_6.inc _update_do_one($module, $number, &$context)
6.x update_6.inc _update_do_one($module, $number, &$context)
7.x update_6.inc _update_do_one($module, $number, &$context)
3.x update_6.inc _update_do_one($module, $number, &$context)
4.x update_6.inc _update_do_one($module, $number, &$context)
5.x update_6.inc _update_do_one($module, $number, &$context)

A simplified version of the batch_do_one function from update.php

This does not mess with sessions and the like, as it will be used from the command line

1 string reference to '_update_do_one'
update_main in commands/core/drupal/update_6.inc

File

commands/core/drupal/update_6.inc, line 430
Update.php for provisioned sites. This file is a derivative of the standard drupal update.php, which has been modified to allow being run from the command line.

Code

function _update_do_one($module, $number, &$context) {
  // If updates for this module have been aborted
  // in a previous step, go no further.
  if (!empty($context['results'][$module]['#abort'])) {
    return;
  }

  $function = $module . '_update_' . $number;
  drush_log("Executing $function", 'success');

  if (function_exists($function)) {
    $ret = $function($context['sandbox']);
    $context['results'][$module] = $ret;
    _drush_log_update_sql($ret);
  }

  if (isset($ret['#finished'])) {
    $context['finished'] = $ret['#finished'];
    unset($ret['#finished']);
  }

  if ($context['finished'] == 1 && empty($context['results'][$module]['#abort'])) {
    drupal_set_installed_schema_version($module, $number);
  }

}