index.php 1.24 KB
Newer Older
Dries's avatar
Dries committed
1
<?php
Dries's avatar
Dries committed
2

Dries's avatar
Dries committed
3 4 5 6 7 8
/**
 * @file
 * The PHP page that serves all page requests on a Drupal installation.
 *
 * The routines here dispatch control to the appropriate handler, which then
 * prints the appropriate page.
9 10
 *
 * All Drupal code is released under the GNU General Public License.
11
 * See COPYRIGHT.txt and LICENSE.txt files in the "core" directory.
Dries's avatar
Dries committed
12 13
 */

14
use Drupal\Core\DrupalKernel;
15 16
use Symfony\Component\HttpFoundation\Request;

17 18 19
/**
 * Root directory of Drupal installation.
 */
20
define('DRUPAL_ROOT', getcwd());
21

22 23 24 25 26
// Bootstrap all of Drupal's subsystems, but do not initialize anything that
// depends on the fully resolved Drupal path, because path resolution happens
// during the REQUEST event of the kernel.
// @see Drupal\Core\EventSubscriber\PathSubscriber;
// @see Drupal\Core\EventSubscriber\LegacyRequestSubscriber;
27
require_once DRUPAL_ROOT . '/core/includes/bootstrap.inc';
28
drupal_bootstrap(DRUPAL_BOOTSTRAP_CODE);
29

katbailey's avatar
katbailey committed
30
// @todo Figure out how best to handle the Kernel constructor parameters.
31
$kernel = new DrupalKernel('prod', FALSE, NULL, cache('bootstrap'));
32

33 34
// Create a request object from the HTTPFoundation.
$request = Request::createFromGlobals();
Crell's avatar
Crell committed
35
$response = $kernel->handle($request)->prepare($request)->send();
36

37
$kernel->terminate($request, $response);