function install_ensure_config_directory

Ensures that the config directory exists and is writable, or can be made so.

Parameters

string $type: Type of config directory to return. Drupal core provides 'active' and 'staging'.

Return value

bool TRUE if the config directory exists and is writable.

2 calls to install_ensure_config_directory()
drupal_install_config_directories in drupal/core/includes/install.inc
Creates the config directory and ensures it is operational.
TestBase::prepareEnvironment in drupal/core/modules/simpletest/lib/Drupal/simpletest/TestBase.php
Prepares the current environment for running the test.

File

drupal/core/includes/install.inc, line 351
API functions for installing modules and themes.

Code

function install_ensure_config_directory($type) {

  // The config directory must be defined in settings.php.
  global $config_directories;
  if (!isset($config_directories[$type])) {
    return FALSE;
  }
  else {
    $config_directory = config_get_config_directory($type);
    return file_prepare_directory($config_directory, FILE_CREATE_DIRECTORY | FILE_MODIFY_PERMISSIONS);
  }
}