Skip to content
Snippets Groups Projects
Select Git revision
  • f047851a7a5ade6be7ae87e899963594675cf5be
  • 11.x default protected
  • 11.2.x protected
  • 10.5.x protected
  • 10.6.x protected
  • 11.1.x protected
  • 10.4.x protected
  • 11.0.x protected
  • 10.3.x protected
  • 7.x protected
  • 10.2.x protected
  • 10.1.x protected
  • 9.5.x protected
  • 10.0.x protected
  • 9.4.x protected
  • 9.3.x protected
  • 9.2.x protected
  • 9.1.x protected
  • 8.9.x protected
  • 9.0.x protected
  • 8.8.x protected
  • 10.5.1 protected
  • 11.2.2 protected
  • 11.2.1 protected
  • 11.2.0 protected
  • 10.5.0 protected
  • 11.2.0-rc2 protected
  • 10.5.0-rc1 protected
  • 11.2.0-rc1 protected
  • 10.4.8 protected
  • 11.1.8 protected
  • 10.5.0-beta1 protected
  • 11.2.0-beta1 protected
  • 11.2.0-alpha1 protected
  • 10.4.7 protected
  • 11.1.7 protected
  • 10.4.6 protected
  • 11.1.6 protected
  • 10.3.14 protected
  • 10.4.5 protected
  • 11.0.13 protected
41 results

update.php

Blame
  • webchick's avatar
    Issue #229825 by nod_, Rob Loach, sun, yched: Fixed ['has_js()'] must die.
    Angie Byron authored
    f047851a
    History
    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();