1 config.inc config_get_config_storage($type = 'active')

Get the storage object for the specified configuration type

Parameters

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

Return value

ConfigStorageInterface: A ConfigStorageInterface object managing the specified configuration type.

File

core/includes/config.inc, line 359
This is the API for configuration storage.

Code

function config_get_config_storage($type = 'active') {
  $class = settings_get('config_' . $type . '_class', 'ConfigFileStorage');
  switch ($class) {
    case 'ConfigDatabaseStorage':
      $config_location = 'db://default/config_' . $type;
      break;
    case 'ConfigFileStorage':
    default:
      $config_location = config_get_config_directory($type);
  }
  return new $class($config_location);
}