config_get_config_directory($type)
Returns the path of a configuration directory.
Configuration directories are configured using $config_directories in settings.php.
Parameters
string $type: The type of config directory to return. Drupal core provides the CONFIG_SYNC_DIRECTORY constant to access the sync directory.
Return value
string The configuration directory path.
Throws
\Exception
File
- core/includes/bootstrap.inc, line 147
- Functions that need to be loaded on every Drupal request.
Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | function config_get_config_directory( $type ) { global $config_directories ; // @todo Remove fallback in Drupal 9. https://www.drupal.org/node/2574943 if ( $type == CONFIG_SYNC_DIRECTORY && !isset( $config_directories [CONFIG_SYNC_DIRECTORY]) && isset( $config_directories [CONFIG_STAGING_DIRECTORY])) { $type = CONFIG_STAGING_DIRECTORY; } if (! empty ( $config_directories [ $type ])) { return $config_directories [ $type ]; } // @todo https://www.drupal.org/node/2696103 Throw a more specific exception. throw new \Exception( "The configuration directory type '$type' does not exist" ); } |
Please login to continue.