function update_main_prepare

8.0.x update_6.inc update_main_prepare()
8.0.x update_7.inc update_main_prepare()
6.x update_6.inc update_main_prepare()
6.x update.inc update_main_prepare()
6.x update_7.inc update_main_prepare()
7.x update_6.inc update_main_prepare()
7.x update_7.inc update_main_prepare()
3.x update_6.inc update_main_prepare()
3.x update_7.inc update_main_prepare()
4.x update_6.inc update_main_prepare()
4.x update.inc update_main_prepare()
5.x update_6.inc update_main_prepare()
5.x update.inc update_main_prepare()
5.x update_7.inc update_main_prepare()
master update_7.inc update_main_prepare()
4 calls to update_main_prepare()
update_main in commands/core/drupal/update_6.inc
update_main in commands/core/drupal/update_7.inc
_update_batch_command in commands/core/drupal/update_6.inc
_update_batch_command in commands/core/drupal/update_7.inc

File

commands/core/drupal/update_7.inc, line 148
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_prepare() {
  // Some unavoidable errors happen because the database is not yet up-to-date.
  // Our custom error handler is not yet installed, so we just suppress them.
  drush_errors_off();

  // We prepare a minimal bootstrap for the update requirements check to avoid
  // reaching the PHP memory limit.
  $core = DRUSH_DRUPAL_CORE;
  require_once $core . '/includes/bootstrap.inc';
  require_once $core . '/includes/common.inc';
  require_once $core . '/includes/file.inc';
  require_once $core . '/includes/entity.inc';
  include_once $core . '/includes/unicode.inc';

  update_prepare_d7_bootstrap();
  drupal_bootstrap(DRUPAL_BOOTSTRAP_SESSION);

  require_once $core . '/includes/install.inc';
  require_once $core . '/modules/system/system.install';

  // Load module basics.
  include_once $core . '/includes/module.inc';
  $module_list['system']['filename'] = 'modules/system/system.module';
  module_list(TRUE, FALSE, FALSE, $module_list);
  drupal_load('module', 'system');

  // Reset the module_implements() cache so that any new hook implementations
  // in updated code are picked up.
  module_implements('', FALSE, TRUE);

  // Set up $language, since the installer components require it.
  drupal_language_initialize();

  // Set up theme system for the maintenance page.
  drupal_maintenance_theme();

  // Check the update requirements for Drupal.
  update_check_requirements();

  // update_fix_d7_requirements() needs to run before bootstrapping beyond path.
  // So bootstrap to DRUPAL_BOOTSTRAP_LANGUAGE then include unicode.inc.
  drupal_bootstrap(DRUPAL_BOOTSTRAP_LANGUAGE);

  update_fix_d7_requirements();

  // Clear the module_implements() cache before the full bootstrap. The calls
  // above to drupal_maintenance_theme() and update_check_requirements() have
  // invoked hooks before all modules have actually been loaded by the full
  // bootstrap. This means that the module_implements() results for any hooks
  // that have been invoked, including hook_module_implements_alter(), is a
  // smaller set of modules than should be returned normally.
  // @see https://github.com/drush-ops/drush/pull/399
  module_implements('', FALSE, TRUE);

  // Now proceed with a full bootstrap.

  drush_bootstrap(DRUSH_BOOTSTRAP_DRUPAL_FULL);
  drupal_maintenance_theme();

  drush_errors_on();

  include_once DRUPAL_ROOT . '/includes/batch.inc';
  drupal_load_updates();

  update_fix_compatibility();

  // Change query-strings on css/js files to enforce reload for all users.
  _drupal_flush_css_js();
  // Flush the cache of all data for the update status module.
  if (db_table_exists('cache_update')) {
    cache_clear_all('*', 'cache_update', TRUE);
  }

  module_list(TRUE, FALSE, TRUE);
}