function update_main

8.0.x update_6.inc update_main()
8.0.x update.inc update_main()
8.0.x update_7.inc update_main()
6.x update_6.inc update_main()
6.x update.inc update_main()
6.x update_7.inc update_main()
7.x update_6.inc update_main()
7.x update.inc update_main()
7.x update_7.inc update_main()
3.x update_6.inc update_main()
3.x update_5.inc update_main()
3.x update_7.inc update_main()
4.x update_6.inc update_main()
4.x update.inc update_main()
4.x update_5.inc update_main()
5.x update_6.inc update_main()
5.x update.inc update_main()
5.x update_7.inc update_main()
master update.inc update_main()
master update_7.inc update_main()
1 call to update_main()
drush_core_updatedb in commands/core/core.drush.inc
Command handler. Execute update.php code from drush.

File

commands/core/drupal/update_7.inc, line 210
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_main() {
  update_main_prepare();

  $pending = update_get_update_list();


  $start = array();

  // Ensure system module's updates run first 
  $start['system'] = array();


  // Print a list of pending updates for this module and get confirmation.
  if (sizeof($pending)) {
    drush_print(dt('The following updates are pending:'));
    drush_print();
    foreach ($pending as $module => $updates) {
      if (isset($updates['start'])) {
        drush_print($module . ' module : ');
        if (isset($updates['start'])) {
          $start[$module] = $updates['start'];
          foreach ($updates['pending'] as $update) {
            drush_print($update, 2);
          }
        }
        drush_print();
      }
    }

    if (!drush_confirm(dt('Do you wish to run all pending updates?'))) {
      drush_die('Aborting.');
    }

    drush_update_batch($start);
  }
  else {
    drush_log(dt("No database updates required"), 'success');
  }

}