1 config.inc | public ConfigFileStorage::rename($name, $new_name) |
Renames a configuration object in the storage.
Parameters
string $name: The name of a configuration object to rename.
string $new_name: The new name of a configuration object.
Return value
bool: TRUE on success, FALSE otherwise.
Overrides ConfigStorageInterface::rename
File
- core/
includes/ config.inc, line 1746 - This is the API for configuration storage.
Class
- ConfigFileStorage
- Defines the file storage controller.
Code
public function rename($name, $new_name) {
$status = @rename($this->getFilePath($name), $this->getFilePath($new_name));
if ($status === FALSE) {
throw new ConfigStorageException('Failed to rename configuration file from: ' . $this->getFilePath($name) . ' to: ' . $this->getFilePath($new_name));
}
return TRUE;
}