Select Git revision

#229825 by nod_, Rob Loach, sun, yched: Fixed ['has_js()'] must die.
Angie Byron authored
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
update.php 19.83 KiB
<?php
/**
* @file
* Administrative page for handling updates from one Drupal version to another.
*
* Point your browser to "http://www.example.com/core/update.php" and follow the
* instructions.
*
* If you are not logged in using either the site maintenance account or an
* account with the "Administer software updates" permission, you will need to
* modify the access check statement inside your settings.php file. After
* finishing the upgrade, be sure to open settings.php again, and change it
* back to its original state!
*/
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
// Change the directory to the Drupal root.
chdir('..');
/**
* Root directory of Drupal installation.
*/
define('DRUPAL_ROOT', getcwd());
// Exit early if running an incompatible PHP version to avoid fatal errors.
// The minimum version is specified explicitly, as DRUPAL_MINIMUM_PHP is not
// yet available. It is defined in bootstrap.inc, but it is not possible to
// load that file yet as it would cause a fatal error on older versions of PHP.
if (version_compare(PHP_VERSION, '5.3.3') < 0) {
print 'Your PHP installation is too old. Drupal requires at least PHP 5.3.3. See the <a href="http://drupal.org/requirements">system requirements</a> page for more information.';
exit;
}
/**
* Global flag indicating that update.php is being run.
*
* When this flag is set, various operations do not take place, such as invoking
* hook_init() and hook_exit(), css/js preprocessing, and translation.
*
* This constant is defined using define() instead of const so that PHP
* versions older than 5.3 can display the proper PHP requirements instead of
* causing a fatal error.
*/
define('MAINTENANCE_MODE', 'update');
function update_selection_page() {
drupal_set_title('Drupal database update');
$elements = drupal_get_form('update_script_selection_form');
$output = drupal_render($elements);
update_task_list('select');
return $output;
}
function update_script_selection_form($form, &$form_state) {
$count = 0;
$incompatible_count = 0;
$form['start'] = array(
'#tree' => TRUE,
'#type' => 'fieldset',
'#collapsed' => TRUE,
'#collapsible' => TRUE,
);
// Ensure system.module's updates appear first.
$form['start']['system'] = array();