annotate core/install.php @ 19:fa3358dc1485 tip

Add ndrum files
author Chris Cannam
date Wed, 28 Aug 2019 13:14:47 +0100
parents 1fec387a4317
children
rev   line source
Chris@0 1 <?php
Chris@0 2
Chris@0 3 /**
Chris@0 4 * @file
Chris@0 5 * Initiates a browser-based installation of Drupal.
Chris@0 6 */
Chris@0 7
Chris@0 8 use Drupal\Component\Utility\OpCodeCache;
Chris@0 9
Chris@0 10 // Change the directory to the Drupal root.
Chris@0 11 chdir('..');
Chris@0 12 // Store the Drupal root path.
Chris@0 13 $root_path = realpath('');
Chris@0 14
Chris@0 15 /**
Chris@0 16 * Global flag to indicate the site is in installation mode.
Chris@0 17 *
Chris@0 18 * The constant is defined using define() instead of const so that PHP
Chris@0 19 * versions prior to 5.3 can display proper PHP requirements instead of causing
Chris@0 20 * a fatal error.
Chris@0 21 */
Chris@0 22 define('MAINTENANCE_MODE', 'install');
Chris@0 23
Chris@0 24 // Exit early if running an incompatible PHP version to avoid fatal errors.
Chris@0 25 // The minimum version is specified explicitly, as DRUPAL_MINIMUM_PHP is not
Chris@0 26 // yet available. It is defined in bootstrap.inc, but it is not possible to
Chris@0 27 // load that file yet as it would cause a fatal error on older versions of PHP.
Chris@0 28 if (version_compare(PHP_VERSION, '5.5.9') < 0) {
Chris@0 29 print 'Your PHP installation is too old. Drupal requires at least PHP 5.5.9. See the <a href="https://www.drupal.org/requirements">system requirements</a> page for more information.';
Chris@0 30 exit;
Chris@0 31 }
Chris@0 32
Chris@0 33 // Initialize the autoloader.
Chris@0 34 $class_loader = require_once $root_path . '/autoload.php';
Chris@0 35
Chris@0 36 // If OPCache is in use, ensure opcache.save_comments is enabled.
Chris@0 37 if (OpCodeCache::isEnabled() && !ini_get('opcache.save_comments')) {
Chris@14 38 print 'Systems with OPcache installed must have <a href="http://php.net/manual/opcache.configuration.php#ini.opcache.save-comments">opcache.save_comments</a> enabled.';
Chris@0 39 exit();
Chris@0 40 }
Chris@0 41
Chris@0 42 // Start the installer.
Chris@0 43 require_once $root_path . '/core/includes/install.core.inc';
Chris@0 44 install_drupal($class_loader);