diff --git a/core/includes/install.inc b/core/includes/install.inc index 8c2e9fe..b14ba11 100644 --- a/core/includes/install.inc +++ b/core/includes/install.inc @@ -651,16 +651,6 @@ function drupal_install_system($install_state) { $kernel->getContainer()->get('module_handler')->install(array('system'), FALSE); \Drupal::service('router.builder')->rebuild(); - // DrupalKernel::prepareLegacyRequest() above calls into - // DrupalKernel::bootCode(), which primes file_get_stream_wrappers()'s static - // list of custom stream wrappers that are based on the currently enabled - // list of modules (none). - // @todo Custom stream wrappers of a new module have to be registered as soon - // as the module is installed/enabled. Fix either ModuleHandler::install() - // and/or DrupalKernel::updateModules(). - // @see https://drupal.org/node/2028109 - drupal_static_reset('file_get_stream_wrappers'); - // Ensure default language is saved. if (isset($install_state['parameters']['langcode'])) { \Drupal::config('system.site') diff --git a/core/lib/Drupal/Core/DrupalKernel.php b/core/lib/Drupal/Core/DrupalKernel.php index d1848af..c014e4a 100644 --- a/core/lib/Drupal/Core/DrupalKernel.php +++ b/core/lib/Drupal/Core/DrupalKernel.php @@ -432,9 +432,6 @@ public function preHandle(Request $request) { // Put the request on the stack. $this->container->get('request_stack')->push($request); - // Make sure all stream wrappers are registered. - \Drupal::service('stream_wrapper_manager')->register(); - // Set the allowed protocols once we have the config available. $allowed_protocols = $this->container->get('config.factory')->get('system.filter')->get('protocols'); if (!isset($allowed_protocols)) { diff --git a/core/lib/Drupal/Core/Extension/ModuleHandler.php b/core/lib/Drupal/Core/Extension/ModuleHandler.php index 8d968c6..78ec3cd 100644 --- a/core/lib/Drupal/Core/Extension/ModuleHandler.php +++ b/core/lib/Drupal/Core/Extension/ModuleHandler.php @@ -865,7 +865,6 @@ public function install(array $module_list, $enable_dependencies = TRUE) { // via Drush, as the 'translations' stream wrapper is provided by // Interface Translation module and is later used to import // translations. - drupal_static_reset('file_get_stream_wrappers'); \Drupal::service('stream_wrapper_manager')->register(); // Update the theme registry to include it. diff --git a/core/lib/Drupal/Core/Test/TestRunnerKernel.php b/core/lib/Drupal/Core/Test/TestRunnerKernel.php index 47e3d33..8829113 100644 --- a/core/lib/Drupal/Core/Test/TestRunnerKernel.php +++ b/core/lib/Drupal/Core/Test/TestRunnerKernel.php @@ -75,9 +75,7 @@ public function boot() { simpletest_classloader_register(); - // Register System module stream wrappers and create the build/artifacts - // directory if necessary. - \Drupal::service('stream_wrapper_manager')->register(); + // Create the build/artifacts directory if necessary. if (!is_dir('public://simpletest')) { mkdir('public://simpletest', 0777, TRUE); } diff --git a/core/modules/simpletest/src/TestBase.php b/core/modules/simpletest/src/TestBase.php index d66f511..d4018a7 100644 --- a/core/modules/simpletest/src/TestBase.php +++ b/core/modules/simpletest/src/TestBase.php @@ -1200,7 +1200,7 @@ private function restoreEnvironment() { conf_path(TRUE, TRUE); // Restore stream wrappers of the test runner. - \Drupal::service('stream_wrapper_manager')->register(); + $this->container->get('stream_wrapper_manager')->register(); // Restore original shutdown callbacks. $callbacks = &drupal_register_shutdown_function(); diff --git a/core/modules/simpletest/src/WebTestBase.php b/core/modules/simpletest/src/WebTestBase.php index 2ce546b..6acca33 100644 --- a/core/modules/simpletest/src/WebTestBase.php +++ b/core/modules/simpletest/src/WebTestBase.php @@ -909,18 +909,12 @@ protected function setUp() { // Reset/rebuild all data structures after enabling the modules, primarily // to synchronize all data structures and caches between the test runner and // the child site. - // Affects e.g. file_get_stream_wrappers(). // @see \Drupal\Core\DrupalKernel::bootCode() // @todo Test-specific setUp() methods may set up further fixtures; find a // way to execute this after setUp() is done, or to eliminate it entirely. $this->resetAll(); $this->kernel->prepareLegacyRequest($request); - // Explicitly call register() again on the container registered in \Drupal. - // @todo This should already be called through - // DrupalKernel::prepareLegacyRequest() -> DrupalKernel::boot() but that - // appears to be calling a different container. - \Drupal::service('stream_wrapper_manager')->register(); // Temporary fix so that when running from run-tests.sh we don't get an // empty current path which would indicate we're on the home page. $path = current_path();