diff --git a/core/includes/bootstrap.inc b/core/includes/bootstrap.inc index 3025b64..6220cdf 100644 --- a/core/includes/bootstrap.inc +++ b/core/includes/bootstrap.inc @@ -101,8 +101,8 @@ * * @see config_get_config_directory() * - * @deprecated Drupal 8.0.0 no longer creates an active directory. This will be - * removed in Drupal 9.0.x + * @deprecated in Drupal 8.0.x and will be removed before 9.0.0. Drupal core no + * longer creates an active directory. */ const CONFIG_ACTIVE_DIRECTORY = 'active'; @@ -164,14 +164,17 @@ function conf_path($require_settings = TRUE, $reset = FALSE, Request $request = /** * Returns the path of a configuration directory. * + * Configuration directories are configured using $config_directories in + * settings.php. + * * @param string $type - * (optional) The type of config directory to return. Drupal core provides - * 'staging'. Defaults to CONFIG_ACTIVE_DIRECTORY. + * The type of config directory to return. Drupal core provides the + * CONFIG_STAGING_DIRECTORY constant to access the staging directory. * * @return string * The configuration directory path. */ -function config_get_config_directory($type = CONFIG_ACTIVE_DIRECTORY) { +function config_get_config_directory($type) { global $config_directories; if (!empty($config_directories[$type])) { diff --git a/core/modules/config/src/Tests/ConfigImporterTest.php b/core/modules/config/src/Tests/ConfigImporterTest.php index c830b45..816fb4f 100644 --- a/core/modules/config/src/Tests/ConfigImporterTest.php +++ b/core/modules/config/src/Tests/ConfigImporterTest.php @@ -648,4 +648,21 @@ public function testMissingCoreExtension() { } } + /** + * Tests config_get_config_directory(). + */ + public function testConfigGetConfigDirectory() { + $directory = config_get_config_directory(CONFIG_STAGING_DIRECTORY); + $this->assertEqual($this->configDirectories[CONFIG_STAGING_DIRECTORY], $directory); + + $message = 'Calling config_get_config_directory() with CONFIG_ACTIVE_DIRECTORY results in an exception.'; + try { + config_get_config_directory(CONFIG_ACTIVE_DIRECTORY); + $this->fail($message); + } + catch (\Exception $e) { + $this->pass($message); + } + } + }