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.
Overrides ConfigStorageInterface::encode
File
- core/
includes/ config.inc, line 1764 - 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;
}