1 update.php update_info_page()

Provides an overview of the Backdrop database update.

This page provides cautionary suggestions that should happen before proceeding with the update to ensure data integrity.

Return value

Rendered HTML form.:

File

core/update.php, line 294
Administrative page for handling updates from one Backdrop version to another.

Code

function update_info_page() {
  global $databases;

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

  // Flush the theme cache so we can render this page correctly if the theme
  // registry been updated with new preprocess or template variables.
  backdrop_theme_rebuild();

  // Get database name
  $db_name = $databases['default']['default']['database'];

  // Get the config path
  $config_dir = config_get_config_directory('active');

  update_task_list('info');
  backdrop_set_title('Backdrop database update');
  $token = backdrop_get_token('update');
  $output = '<p>Use this utility to update your database whenever you install a new version of Backdrop CMS or one of the site\'s modules.</p>';
  $output .= '<p>For more detailed information, see the <a href="https://backdropcms.org/upgrade">Upgrading Backdrop CMS</a> page. If you are unsure of what these terms mean, contact your hosting provider.</p>';
  $output .= '<p>Before running updates, the following steps are recommended.</p>';
  $output .= "<ol>\n";
  $output .= "<li><strong>Create backups.</strong> This update utility will alter your database and config files. In case of an emergency you may need to revert to a recent backup; make sure you have one.\n";
  $output .= "<ul>\n";
  $output .= "<li><strong>Database:</strong> Create a database dump of the '" . $db_name . "' database.</li>\n";
  $output .= "<li><strong>Config files:</strong> Back up the entire directory at '" . $config_dir . "'.</li>\n";
  $output .= "</ul>\n";
  $output .= '<li>Put your site into <a href="' . base_path() . '?q=admin/config/development/maintenance">maintenance mode</a>.</li>' . "\n";
  $output .= "<li>Install your new files into the appropriate location, as described in <a href=\"https://backdropcms.org/upgrade\">the handbook</a>.</li>\n";
  $output .= "</ol>\n";
  $output .= "<p>After performing the above steps proceed using the continue button.</p>\n";
  $module_status_report = update_upgrade_check_dependencies();
  if (!empty($module_status_report)) {
    $output .= $module_status_report;
  }
  $form_action = check_url(backdrop_current_script_url(array('op' => 'selection', 'token' => $token)));
  $output .= '<form method="post" action="' . $form_action . '">
  <div class="form-actions">
    <input type="submit" value="Continue" class="form-submit button-primary" />
    <a href="' . base_path() . '">Cancel</a>
  </div>
  </form>';
  $output .= "\n";
  return $output;
}