2001-03-10 11:07:52 +00:00
|
|
|
<?php
|
2000-05-18 19:51:59 +00:00
|
|
|
|
2004-08-21 06:42:38 +00:00
|
|
|
/**
|
|
|
|
* @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.
|
2007-12-26 08:46:48 +00:00
|
|
|
*
|
|
|
|
* All Drupal code is released under the GNU General Public License.
|
2011-10-31 04:05:57 +00:00
|
|
|
* See COPYRIGHT.txt and LICENSE.txt files in the "core" directory.
|
2004-08-21 06:42:38 +00:00
|
|
|
*/
|
|
|
|
|
2012-04-01 00:04:49 +00:00
|
|
|
use Drupal\Core\DrupalKernel;
|
|
|
|
use Symfony\Component\HttpFoundation\Request;
|
|
|
|
use Symfony\Component\EventDispatcher\EventDispatcher;
|
|
|
|
use Symfony\Component\HttpKernel\Controller\ControllerResolver;
|
|
|
|
|
2008-09-20 20:22:25 +00:00
|
|
|
/**
|
|
|
|
* Root directory of Drupal installation.
|
|
|
|
*/
|
2009-02-08 20:27:51 +00:00
|
|
|
define('DRUPAL_ROOT', getcwd());
|
2012-02-12 21:50:03 +00:00
|
|
|
// Bootstrap the lowest level of what we need.
|
2011-10-31 04:05:57 +00:00
|
|
|
require_once DRUPAL_ROOT . '/core/includes/bootstrap.inc';
|
2012-04-01 00:04:49 +00:00
|
|
|
drupal_bootstrap(DRUPAL_BOOTSTRAP_CONFIGURATION);
|
2012-02-12 21:50:03 +00:00
|
|
|
|
|
|
|
// A request object from the HTTPFoundation to tell us about the request.
|
|
|
|
$request = Request::createFromGlobals();
|
2012-02-23 06:33:14 +00:00
|
|
|
|
2012-04-01 00:04:49 +00:00
|
|
|
// Set the global $request object. This is a temporary measure to
|
|
|
|
// keep legacy utility functions working. It should be moved to a dependency
|
|
|
|
// injection container at some point.
|
|
|
|
request($request);
|
|
|
|
|
|
|
|
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
|
2012-03-23 17:49:37 +00:00
|
|
|
|
|
|
|
$dispatcher = new EventDispatcher();
|
|
|
|
$resolver = new ControllerResolver();
|
|
|
|
|
|
|
|
$kernel = new DrupalKernel($dispatcher, $resolver);
|
2012-04-15 23:23:15 +00:00
|
|
|
$response = $kernel->handle($request);
|
2012-04-15 23:35:34 +00:00
|
|
|
$response->prepare($request);
|
2012-04-15 23:23:15 +00:00
|
|
|
$response->send();
|
|
|
|
$kernel->terminate($request, $response);
|