1 config.inc public ConfigFileStorage::encode($data)

Encodes configuration data into the storage-specific format.

Parameters

array $data: The configuration data to encode.

Return value

string: The encoded configuration data.

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

Overrides ConfigStorageInterface::encode

File

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

Class

ConfigFileStorage
Defines the file storage controller.

Code

public function encode($data) {
  $contents = backdrop_json_encode($data, TRUE);
  if ($contents === FALSE) {
    throw new ConfigStorageException(t('The configuration string could not be parsed.'));
  }
  return $contents;
}