try { $encoded_data =
$this->
encode($data);
} catch (InvalidDataTypeException
$e) { throw new StorageException("Invalid data type in config
$name: {
$e->
getMessage()}"
);
} $target =
$this->
getFilePath($name);
$status = @
file_put_contents($target,
$encoded_data);
if ($status === FALSE
) { // Try to make sure the directory exists and try writing again.
$this->
ensureStorage();
$status = @
file_put_contents($target,
$encoded_data);
} if ($status === FALSE
) { throw new StorageException('Failed to write configuration file: ' .
$target);
} $this->fileCache->
set($target,
$data);
return TRUE;
}