diff --git a/core/includes/bootstrap.inc b/core/includes/bootstrap.inc index cf0e3dd..a818c78 100644 --- a/core/includes/bootstrap.inc +++ b/core/includes/bootstrap.inc @@ -1889,8 +1889,7 @@ function drupal_handle_request($test_only = FALSE) { exit; } - // @todo Figure out how best to handle the Kernel constructor parameters. - $kernel = new DrupalKernel('prod', FALSE, drupal_classloader(), !$test_only); + $kernel = new DrupalKernel('prod', drupal_classloader(), !$test_only); // @todo Remove this once everything in the bootstrap has been // converted to services in the DIC. @@ -2026,7 +2025,7 @@ function _drupal_bootstrap_kernel() { // Normally, index.php puts a container in drupal_container() by creating a // kernel. If there is no container yet, create one. if (!drupal_container()) { - $kernel = new DrupalKernel('prod', FALSE, drupal_classloader()); + $kernel = new DrupalKernel('prod', drupal_classloader()); $kernel->boot(); } } diff --git a/core/includes/install.core.inc b/core/includes/install.core.inc index 7d2286a..34936d0 100644 --- a/core/includes/install.core.inc +++ b/core/includes/install.core.inc @@ -354,7 +354,7 @@ function install_begin_request(&$install_state) { // @see drupal_install_config_directories() // @see install_settings_form_submit() if ($install_state['settings_verified']) { - $kernel = new DrupalKernel('install', FALSE, drupal_classloader(), FALSE); + $kernel = new DrupalKernel('install', drupal_classloader(), FALSE); $kernel->boot(); $container = $kernel->getContainer(); // Add the file translation service to the container. diff --git a/core/includes/install.inc b/core/includes/install.inc index b0ca296..e0e86cc 100644 --- a/core/includes/install.inc +++ b/core/includes/install.inc @@ -619,7 +619,7 @@ function drupal_install_system() { if (!drupal_container()->has('kernel')) { // Immediately boot a kernel to have real services ready. - $kernel = new DrupalKernel('install', FALSE, drupal_classloader(), FALSE); + $kernel = new DrupalKernel('install', drupal_classloader(), FALSE); $kernel->boot(); } diff --git a/core/includes/update.inc b/core/includes/update.inc index 881adcd..fe83e31 100644 --- a/core/includes/update.inc +++ b/core/includes/update.inc @@ -116,7 +116,7 @@ function update_prepare_d8_bootstrap() { // Bootstrap the kernel. // Do not attempt to dump and write it. - $kernel = new DrupalKernel('update', FALSE, drupal_classloader(), FALSE); + $kernel = new DrupalKernel('update', drupal_classloader(), FALSE); $kernel->boot(); // If any of the required settings needs to be written, then settings.php @@ -439,7 +439,7 @@ function update_prepare_d8_bootstrap() { $settings = settings()->getAll(); unset($settings['cache']['default']); new Settings($settings); - $kernel = new DrupalKernel('update', FALSE, drupal_classloader(), FALSE); + $kernel = new DrupalKernel('update', drupal_classloader(), FALSE); $kernel->boot(); } diff --git a/core/lib/Drupal/Core/DrupalKernel.php b/core/lib/Drupal/Core/DrupalKernel.php index 090fa69..af1fe52 100644 --- a/core/lib/Drupal/Core/DrupalKernel.php +++ b/core/lib/Drupal/Core/DrupalKernel.php @@ -53,13 +53,6 @@ class DrupalKernel implements DrupalKernelInterface, TerminableInterface { protected $environment; /** - * Whether we are in debug mode. - * - * @var bool - */ - protected $debug; - - /** * Whether the kernel has been booted. * * @var bool @@ -157,10 +150,6 @@ class DrupalKernel implements DrupalKernelInterface, TerminableInterface { * String indicating the environment, e.g. 'prod' or 'dev'. Used by * Symfony\Component\HttpKernel\Kernel::__construct(). Drupal does not use * this value currently. Pass 'prod'. - * @param bool $debug - * Boolean indicating whether we are in debug mode. Used by - * Symfony\Component\HttpKernel\Kernel::__construct(). Drupal does not use - * this value currently. Pass TRUE. * @param \Symfony\Component\ClassLoader\ClassLoader $class_loader * (optional) The classloader is only used if $storage is not given or * the load from storage fails and a container rebuild is required. In @@ -170,9 +159,8 @@ class DrupalKernel implements DrupalKernelInterface, TerminableInterface { * (optional) FALSE to stop the container from being written to or read * from disk. Defaults to TRUE. */ - public function __construct($environment, $debug, ClassLoader $class_loader, $allow_dumping = TRUE) { + public function __construct($environment, ClassLoader $class_loader, $allow_dumping = TRUE) { $this->environment = $environment; - $this->debug = (Boolean) $debug; $this->booted = false; $this->classLoader = $class_loader; $this->allowDumping = $allow_dumping; @@ -182,15 +170,15 @@ public function __construct($environment, $debug, ClassLoader $class_loader, $al * {@inheritdoc} */ public function serialize() { - return serialize(array($this->environment, $this->debug, $this->classLoader, $this->allowDumping)); + return serialize(array($this->environment, $this->classLoader, $this->allowDumping)); } /** * {@inheritdoc} */ public function unserialize($data) { - list($environment, $debug, $class_loader, $allow_dumping) = unserialize($data); - $this->__construct($environment, $debug, $class_loader, $allow_dumping); + list($environment, $class_loader, $allow_dumping) = unserialize($data); + $this->__construct($environment, $class_loader, $allow_dumping); } /** @@ -210,20 +198,18 @@ public function boot() { /** * {@inheritdoc} */ - public function shutdown() - { - if (false === $this->booted) { + public function shutdown() { + if (FALSE === $this->booted) { return; } - $this->booted = false; + $this->booted = FALSE; $this->container = null; } /** * {@inheritdoc} */ - public function getContainer() - { + public function getContainer() { return $this->container; } @@ -289,9 +275,8 @@ public function getServiceProviders() { /** * {@inheritdoc} */ - public function terminate(Request $request, Response $response) - { - if (false === $this->booted) { + public function terminate(Request $request, Response $response) { + if (FALSE === $this->booted) { return; } @@ -303,9 +288,8 @@ public function terminate(Request $request, Response $response) /** * {@inheritdoc} */ - public function handle(Request $request, $type = HttpKernelInterface::MASTER_REQUEST, $catch = true) - { - if (false === $this->booted) { + public function handle(Request $request, $type = HttpKernelInterface::MASTER_REQUEST, $catch = true) { + if (FALSE === $this->booted) { $this->boot(); } @@ -364,13 +348,13 @@ public function updateModules(array $module_list, array $module_filenames = arra } /** - * Returns the classname based on environment, debug and testing prefix. + * Returns the classname based on environment and testing prefix. * * @return string * The class name. */ protected function getClassName() { - $parts = array('service_container', $this->environment, $this->debug); + $parts = array('service_container', $this->environment); // Make sure to use a testing-specific container even in the parent site. if (!empty($GLOBALS['drupal_test_info']['test_run_id'])) { $parts[] = $GLOBALS['drupal_test_info']['test_run_id']; @@ -387,12 +371,10 @@ protected function getClassName() { * * @return array An array of kernel parameters */ - protected function getKernelParameters() - { + protected function getKernelParameters() { return array( - 'kernel.environment' => $this->environment, - 'kernel.debug' => $this->debug, - ); + 'kernel.environment' => $this->environment, + ); } /** @@ -622,8 +604,7 @@ protected function dumpDrupalContainer(ContainerBuilder $container, $baseClass) * * @return HttpKernel */ - protected function getHttpKernel() - { + protected function getHttpKernel() { return $this->container->get('http_kernel'); } diff --git a/core/modules/simpletest/lib/Drupal/simpletest/DrupalUnitTestBase.php b/core/modules/simpletest/lib/Drupal/simpletest/DrupalUnitTestBase.php index 8a79ed2..e54e121 100644 --- a/core/modules/simpletest/lib/Drupal/simpletest/DrupalUnitTestBase.php +++ b/core/modules/simpletest/lib/Drupal/simpletest/DrupalUnitTestBase.php @@ -98,7 +98,7 @@ protected function setUp() { // Bootstrap the kernel. // No need to dump it; this test runs in-memory. - $this->kernel = new DrupalKernel('unit_testing', TRUE, drupal_classloader(), FALSE); + $this->kernel = new DrupalKernel('unit_testing', drupal_classloader(), FALSE); $this->kernel->boot(); // Collect and set a fixed module list. diff --git a/core/modules/simpletest/lib/Drupal/simpletest/TestBase.php b/core/modules/simpletest/lib/Drupal/simpletest/TestBase.php index 74c8d44..818b7b0 100644 --- a/core/modules/simpletest/lib/Drupal/simpletest/TestBase.php +++ b/core/modules/simpletest/lib/Drupal/simpletest/TestBase.php @@ -993,7 +993,7 @@ protected function prepareConfigDirectories() { * @see TestBase::tearDown() */ protected function rebuildContainer() { - $this->kernel = new DrupalKernel('testing', FALSE, drupal_classloader(), FALSE); + $this->kernel = new DrupalKernel('testing', drupal_classloader(), FALSE); $this->kernel->boot(); // DrupalKernel replaces the container in drupal_container() with a // different object, so we need to replace the instance on this test class. diff --git a/core/modules/system/lib/Drupal/system/Tests/DrupalKernel/DrupalKernelTest.php b/core/modules/system/lib/Drupal/system/Tests/DrupalKernel/DrupalKernelTest.php index a73c6db..db60d18 100644 --- a/core/modules/system/lib/Drupal/system/Tests/DrupalKernel/DrupalKernelTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/DrupalKernel/DrupalKernelTest.php @@ -49,12 +49,12 @@ function testCompileDIC() { 'system' => 'system', 'user' => 'user', ); - $kernel = new DrupalKernel('testing', FALSE, $classloader); + $kernel = new DrupalKernel('testing', $classloader); $kernel->updateModules($module_enabled); $kernel->boot(); // Instantiate it a second time and we should get the compiled Container // class. - $kernel = new DrupalKernel('testing', FALSE, $classloader); + $kernel = new DrupalKernel('testing', $classloader); $kernel->updateModules($module_enabled); $kernel->boot(); $container = $kernel->getContainer(); @@ -68,7 +68,7 @@ function testCompileDIC() { // environment. global $conf; $conf['php_storage']['service_container']['class'] = 'Drupal\Component\PhpStorage\FileReadOnlyStorage'; - $kernel = new DrupalKernel('testing', FALSE, $classloader); + $kernel = new DrupalKernel('testing', $classloader); $kernel->updateModules($module_enabled); $kernel->boot(); $container = $kernel->getContainer(); @@ -91,12 +91,12 @@ function testCompileDIC() { // Add another module so that we can test that the new module's bundle is // registered to the new container. $module_enabled['service_provider_test'] = 'service_provider_test'; - $kernel = new DrupalKernel('testing', FALSE, $classloader); + $kernel = new DrupalKernel('testing', $classloader); $kernel->updateModules($module_enabled); $kernel->boot(); // Instantiate it a second time and we should still get a ContainerBuilder // class because we are using the read-only PHP storage. - $kernel = new DrupalKernel('testing', FALSE, $classloader); + $kernel = new DrupalKernel('testing', $classloader); $kernel->updateModules($module_enabled); $kernel->boot(); $container = $kernel->getContainer(); @@ -119,7 +119,7 @@ function testCompileDIC() { */ public function testSerialization() { $classloader = drupal_classloader(); - $kernel = new DrupalKernel('testing', FALSE, $classloader); + $kernel = new DrupalKernel('testing', $classloader); $string = serialize($kernel); $unserialized_kernel = unserialize($string); diff --git a/core/modules/system/lib/Drupal/system/Tests/System/IgnoreSlaveSubscriberTest.php b/core/modules/system/lib/Drupal/system/Tests/System/IgnoreSlaveSubscriberTest.php index bf004f9..da65377 100644 --- a/core/modules/system/lib/Drupal/system/Tests/System/IgnoreSlaveSubscriberTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/System/IgnoreSlaveSubscriberTest.php @@ -38,7 +38,7 @@ function testSystemInitIgnoresSlaves() { Database::addConnectionInfo('default', 'slave', $connection_info['default']); db_ignore_slave(); - $kernel = new DrupalKernel('testing', FALSE, drupal_classloader(), FALSE); + $kernel = new DrupalKernel('testing', drupal_classloader(), FALSE); $event = new GetResponseEvent($kernel, Request::create('http://example.com'), HttpKernelInterface::MASTER_REQUEST); $subscriber = new SlaveDatabaseIgnoreSubscriber(); $subscriber->checkSlaveServer($event);