1 config.inc public ConfigFileStorage::decode($raw)

Decodes configuration data from the storage-specific format.

Parameters

string $raw: The raw configuration data string to decode.

Return value

array: The decoded configuration data as an associative array.

This is a publicly accessible static method to allow for alternative usages in data conversion scripts and also tests.

Overrides ConfigStorageInterface::decode

File

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

Class

ConfigFileStorage
Defines the file storage controller.

Code

public function decode($raw) {
  // Use json_decode() directly for efficiency.
  $contents = json_decode($raw, TRUE);
  if (is_null($contents)) {
    throw new ConfigStorageException('The configuration string could not be parsed.');
  }
  return $contents;
}