diff --git a/core/includes/bootstrap.inc b/core/includes/bootstrap.inc index 288956b..ac76982 100644 --- a/core/includes/bootstrap.inc +++ b/core/includes/bootstrap.inc @@ -537,7 +537,7 @@ function drupal_settings_initialize() { global $base_url, $base_path, $base_root, $script_path; // Export these settings.php variables to the global namespace. - global $databases, $conf, $cookie_domain, $db_prefix, $drupal_hash_salt, $base_secure_url, $base_insecure_url, $config_directories; + global $databases, $cookie_domain, $conf, $db_prefix, $drupal_hash_salt, $base_secure_url, $base_insecure_url, $config_directories; $conf = array(); // Make conf_path() available as local variable in settings.php. @@ -2085,14 +2085,14 @@ function drupal_valid_test_ua($new_prefix = NULL) { * Very strictly for internal use only. * * Loads settings.php from the simpletest public files directory. These files - * can change the global $config_directories, the return value of conf_path(), - * and settings(). + * can change the global $conf, the global $config_directories, the return + * value of conf_path(), and settings(). * * @param string $test_prefix * The simpletest prefix. */ function _drupal_load_test_overrides($test_prefix) { - global $config_directories; + global $conf, $config_directories; // Do not use the parent site's config directories. Use only the child site's. // @see \Drupal\simpletest\TestBase::prepareConfigDirectories() @@ -2107,7 +2107,7 @@ function _drupal_load_test_overrides($test_prefix) { if (file_exists($filename)) { $settings = settings()->getAll(); $conf_path = &drupal_static('conf_path'); - // This can override $conf_path, $settings, and $config_directories. + // This can override $conf, $conf_path, $settings, and $config_directories. include $filename; // Keep the overriden $conf_path alive across drupal_static_reset() calls. // @see conf_path() diff --git a/core/includes/install.core.inc b/core/includes/install.core.inc index 1508448..cc2fb5b 100644 --- a/core/includes/install.core.inc +++ b/core/includes/install.core.inc @@ -1485,7 +1485,6 @@ function install_file_translation_service() { * The path to the installation directory. */ function install_translations_directory() { - // @todo global $config, https://drupal.org/node/1881582 if (isset($GLOBALS['conf']['locale.settings']['translation.path'])) { $directory = $GLOBALS['conf']['locale.settings']['translation.path']; } diff --git a/core/includes/update.inc b/core/includes/update.inc index 8482a7f..9383a07 100644 --- a/core/includes/update.inc +++ b/core/includes/update.inc @@ -107,7 +107,6 @@ function update_prepare_d8_bootstrap() { // Enable UpdateServiceProvider service overrides. // @see update_flush_all_caches() - // @todo global $config, https://drupal.org/node/1881582 $GLOBALS['conf']['container_service_providers']['UpdateServiceProvider'] = 'Drupal\Core\DependencyInjection\UpdateServiceProvider'; $GLOBALS['conf']['update_service_provider_overrides'] = TRUE; @@ -1330,7 +1329,7 @@ function update_retrieve_dependencies() { /** * Gets the value of a variable from the database during 7.x-8.x upgrades. * - * Use this during the 7.x-8.x upgrade path. + * Use this during the 7.x-8.x upgrade path instead of variable_get(). * * @param string $name * The name of the variable. @@ -1355,7 +1354,7 @@ function update_variable_get($name, $default = NULL) { /** * Sets a persistent variable during the 7.x-8.x upgrade path. * - * Use this during the 7.x-8.x upgrade path. + * Use this during the 7.x-8.x upgrade path instead of variable_set(). * * @param string $name * The name of the variable to set. @@ -1381,7 +1380,7 @@ function update_variable_set($name, $value) { /** * Delete a variable from the database during the 7.x-8.x upgrade path. * - * Use this during the 7.x-8.x upgrade path. + * Use this during the 7.x-8.x upgrade path instead of variable_del(). * * @param string $name * The name of the variable to delete. @@ -1446,8 +1445,8 @@ function update_variables_to_config($config_name, array $variable_map) { foreach ($variable_map as $variable_name => $config_key) { // This function migrates variables regardless of their value, including // NULL values. Any possibly required customizations need to be performed - // manually, either via update_variable_set() before calling this function - // or via \Drupal::config() after calling this function. + // manually, either via variable_set() before calling this function or via + // \Drupal::config() after calling this function. if (isset($variables[$variable_name])) { $value = unserialize($variables[$variable_name]); $config->set($config_key, $value); diff --git a/core/lib/Drupal/Core/Config/ConfigFactory.php b/core/lib/Drupal/Core/Config/ConfigFactory.php index 7fae9a5..1fca065 100644 --- a/core/lib/Drupal/Core/Config/ConfigFactory.php +++ b/core/lib/Drupal/Core/Config/ConfigFactory.php @@ -159,7 +159,6 @@ public function get($name) { $this->cache[$cache_key]->setModuleOverride($module_overrides[$name]); } // Apply any settings.php overrides. - // @todo global $config, https://drupal.org/node/1881582 if (isset($conf[$name])) { $this->cache[$cache_key]->setSettingsOverride($conf[$name]); } @@ -235,7 +234,6 @@ public function loadMultiple(array $names) { if (isset($module_overrides[$name])) { $this->cache[$cache_key]->setModuleOverride($module_overrides[$name]); } - // @todo global $config, https://drupal.org/node/1881582 if (isset($conf[$name])) { $this->cache[$cache_key]->setSettingsOverride($conf[$name]); } diff --git a/core/lib/Drupal/Core/DrupalKernel.php b/core/lib/Drupal/Core/DrupalKernel.php index a4ad00b..e2a03a7 100644 --- a/core/lib/Drupal/Core/DrupalKernel.php +++ b/core/lib/Drupal/Core/DrupalKernel.php @@ -238,7 +238,6 @@ public function discoverServiceProviders() { } // Add site specific or test service providers. - // @todo Move to $settings? https://drupal.org/node/1881582 if (!empty($GLOBALS['conf']['container_service_providers'])) { foreach ($GLOBALS['conf']['container_service_providers'] as $name => $class) { $serviceProviders[$name] = new $class(); @@ -246,7 +245,6 @@ public function discoverServiceProviders() { } } // Add site specific or test YAMLs. - // @todo Move to $settings? https://drupal.org/node/1881582 if (!empty($GLOBALS['conf']['container_yamls'])) { $this->serviceYamls = array_merge($this->serviceYamls, $GLOBALS['conf']['container_yamls']); } diff --git a/core/modules/config/lib/Drupal/config/Tests/ConfigOverrideTest.php b/core/modules/config/lib/Drupal/config/Tests/ConfigOverrideTest.php index 0eac097..a535651 100644 --- a/core/modules/config/lib/Drupal/config/Tests/ConfigOverrideTest.php +++ b/core/modules/config/lib/Drupal/config/Tests/ConfigOverrideTest.php @@ -38,7 +38,6 @@ public function setUp() { * Tests configuration override. */ function testConfOverride() { - // @todo global $config, https://drupal.org/node/1881582 global $conf; $expected_original_data = array( 'foo' => 'bar', diff --git a/core/modules/simpletest/lib/Drupal/simpletest/DrupalUnitTestBase.php b/core/modules/simpletest/lib/Drupal/simpletest/DrupalUnitTestBase.php index b25efb3..cdf835b 100644 --- a/core/modules/simpletest/lib/Drupal/simpletest/DrupalUnitTestBase.php +++ b/core/modules/simpletest/lib/Drupal/simpletest/DrupalUnitTestBase.php @@ -94,7 +94,6 @@ protected function setUp() { // Build a minimal, partially mocked environment for unit tests. $this->containerBuild(\Drupal::getContainer()); // Make sure it survives kernel rebuilds. - // @todo Move into $settings? https://drupal.org/node/1881582 $GLOBALS['conf']['container_service_providers']['TestServiceProvider'] = 'Drupal\simpletest\TestServiceProvider'; \Drupal::state()->set('system.module.files', $this->moduleFiles); 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 a4a698b..ae61ae5 100644 --- a/core/modules/system/lib/Drupal/system/Tests/DrupalKernel/DrupalKernelTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/DrupalKernel/DrupalKernelTest.php @@ -27,6 +27,12 @@ public static function getInfo() { function setUp() { parent::setUp(); + $this->settingsSet('php_storage', array('service_container' => array( + 'bin' => 'service_container', + 'class' => 'Drupal\Component\PhpStorage\MTimeProtectedFileStorage', + 'directory' => DRUPAL_ROOT . '/' . $this->public_files_directory . '/php', + 'secret' => drupal_get_hash_salt(), + ))); // Use a non-persistent cache to avoid queries to non-existing tables. $this->settingsSet('cache', array('default' => 'cache.backend.memory')); } @@ -58,8 +64,9 @@ function testCompileDIC() { // Now use the read-only storage implementation, simulating a "production" // environment. - global $conf; - $conf['php_storage']['service_container']['class'] = 'Drupal\Component\PhpStorage\FileReadOnlyStorage'; + $php_storage = settings()->get('php_storage'); + $php_storage['service_container']['class'] = 'Drupal\Component\PhpStorage\FileReadOnlyStorage'; + $this->settingsSet('php_storage', $php_storage); $kernel = new DrupalKernel('testing', $classloader); $kernel->updateModules($module_enabled); $kernel->boot(); diff --git a/core/modules/system/lib/Drupal/system/Tests/Installer/InstallerLanguageTest.php b/core/modules/system/lib/Drupal/system/Tests/Installer/InstallerLanguageTest.php index 2be120f..c3308f7 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Installer/InstallerLanguageTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Installer/InstallerLanguageTest.php @@ -27,7 +27,6 @@ function setUp() { parent::setUp(); // The database is not available during this part of install. Use global // $conf to override the installation translations directory path. - // @todo global $config, https://drupal.org/node/1881582 global $conf; $conf['locale.settings']['translation.path'] = drupal_get_path('module', 'simpletest') . '/files/translations'; } diff --git a/core/modules/system/lib/Drupal/system/Tests/KeyValueStore/DatabaseStorageTest.php b/core/modules/system/lib/Drupal/system/Tests/KeyValueStore/DatabaseStorageTest.php index c24c833..711d7c9 100644 --- a/core/modules/system/lib/Drupal/system/Tests/KeyValueStore/DatabaseStorageTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/KeyValueStore/DatabaseStorageTest.php @@ -35,6 +35,7 @@ protected function setUp() { $this->container ->register('keyvalue.database', 'Drupal\Core\KeyValueStore\KeyValueDatabaseFactory') ->addArgument(new Reference('database')); + $this->settingsSet('keyvalue_default', 'keyvalue.memory'); } protected function tearDown() { diff --git a/core/modules/system/system.install b/core/modules/system/system.install index f1743a7..25f75c7 100644 --- a/core/modules/system/system.install +++ b/core/modules/system/system.install @@ -320,7 +320,6 @@ function system_requirements($phase) { // During an install we need to make assumptions about the file system // unless overrides are provided in settings.php. if ($phase == 'install') { - // @todo global $config, https://drupal.org/node/1881582 global $conf; $directories = array(); if ($file_public_path = settings()->get('file_public_path')) { @@ -332,7 +331,6 @@ function system_requirements($phase) { // conf_path() cache must also be reset in this case. $directories[] = conf_path(FALSE, TRUE) . '/files'; } - // @todo Move into $settings for consistency. if (!empty($conf['system.file']['path.private'])) { $directories[] = $conf['system.file']['path.private']; } diff --git a/core/modules/toolbar/toolbar.module b/core/modules/toolbar/toolbar.module index 706d072..f35d4ae 100644 --- a/core/modules/toolbar/toolbar.module +++ b/core/modules/toolbar/toolbar.module @@ -113,7 +113,6 @@ function toolbar_element_info() { * once Drupal's page caching itself is properly integrated. */ function _toolbar_initialize_page_cache() { - // @todo global $config, https://drupal.org/node/1881582 $GLOBALS['conf']['system.performance']['cache']['page']['enabled'] = TRUE; drupal_page_is_cacheable(TRUE); diff --git a/core/update.php b/core/update.php index 5173912..db6b9d2 100644 --- a/core/update.php +++ b/core/update.php @@ -86,7 +86,6 @@ function update_helpful_links() { * while updates are running. */ function update_flush_all_caches() { - // @todo global $config, https://drupal.org/node/1881582 $GLOBALS['conf']['update_service_provider_overrides'] = FALSE; \Drupal::service('kernel')->updateModules(\Drupal::moduleHandler()->getModuleList());