comparison core/install.php @ 0:c75dbcec494b

Initial commit from drush-created site
author Chris Cannam
date Thu, 05 Jul 2018 14:24:15 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:c75dbcec494b
1 <?php
2
3 /**
4 * @file
5 * Initiates a browser-based installation of Drupal.
6 */
7
8 use Drupal\Component\Utility\OpCodeCache;
9
10 // Change the directory to the Drupal root.
11 chdir('..');
12 // Store the Drupal root path.
13 $root_path = realpath('');
14
15 /**
16 * Global flag to indicate the site is in installation mode.
17 *
18 * The constant is defined using define() instead of const so that PHP
19 * versions prior to 5.3 can display proper PHP requirements instead of causing
20 * a fatal error.
21 */
22 define('MAINTENANCE_MODE', 'install');
23
24 // Exit early if running an incompatible PHP version to avoid fatal errors.
25 // The minimum version is specified explicitly, as DRUPAL_MINIMUM_PHP is not
26 // yet available. It is defined in bootstrap.inc, but it is not possible to
27 // load that file yet as it would cause a fatal error on older versions of PHP.
28 if (version_compare(PHP_VERSION, '5.5.9') < 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.';
30 exit;
31 }
32
33 // Initialize the autoloader.
34 $class_loader = require_once $root_path . '/autoload.php';
35
36 // If OPCache is in use, ensure opcache.save_comments is enabled.
37 if (OpCodeCache::isEnabled() && !ini_get('opcache.save_comments')) {
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.';
39 exit();
40 }
41
42 // Start the installer.
43 require_once $root_path . '/core/includes/install.core.inc';
44 install_drupal($class_loader);