function config_get_config_directory

Returns the path of a configuration directory.

Parameters

string $type: (optional) The type of config directory to return. Drupal core provides 'active' and 'staging'. Defaults to CONFIG_ACTIVE_DIRECTORY.

Return value

string The configuration directory path.

7 calls to config_get_config_directory()
BootstrapConfigStorageFactory::get in drupal/core/lib/Drupal/Core/Config/BootstrapConfigStorageFactory.php
Returns a configuration storage implementation.
CoreBundle::build in drupal/core/lib/Drupal/Core/CoreBundle.php
Implements \Symfony\Component\HttpKernel\Bundle\BundleInterface::build().
drupal_install_config_directories in drupal/core/includes/install.inc
Creates the config directory and ensures it is operational.
file_ensure_htaccess in drupal/core/includes/file.inc
Creates a .htaccess file in each Drupal files directory if it is missing.
install_ensure_config_directory in drupal/core/includes/install.inc
Ensures that the config directory exists and is writable, or can be made so.

... See full list

File

drupal/core/includes/bootstrap.inc, line 524
Functions that need to be loaded on every Drupal request.

Code

function config_get_config_directory($type = CONFIG_ACTIVE_DIRECTORY) {
  global $config_directories;
  if ($test_prefix = drupal_valid_test_ua()) {

    // @see Drupal\simpletest\WebTestBase::setUp()
    $path = conf_path() . '/files/simpletest/' . substr($test_prefix, 10) . '/config_' . $type;
  }
  elseif (!empty($config_directories[$type])) {

    // Allow a configuration directory path to be outside of webroot.
    if (empty($config_directories[$type]['absolute'])) {
      $path = conf_path() . '/files/' . $config_directories[$type]['path'];
    }
    else {
      $path = $config_directories[$type]['path'];
    }
  }
  else {
    throw new Exception(format_string('The configuration directory type %type does not exist.', array(
      '%type' => $type,
    )));
  }
  return $path;
}