You are here

public function FileStorage::rename in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/lib/Drupal/Core/Config/FileStorage.php \Drupal\Core\Config\FileStorage::rename()

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 StorageInterface::rename

1 method overrides FileStorage::rename()
InstallStorage::rename in core/lib/Drupal/Core/Config/InstallStorage.php
Overrides Drupal\Core\Config\FileStorage::rename().

File

core/lib/Drupal/Core/Config/FileStorage.php, line 165
Contains \Drupal\Core\Config\FileStorage.

Class

FileStorage
Defines the file storage.

Namespace

Drupal\Core\Config

Code

public function rename($name, $new_name) {
  $status = @rename($this
    ->getFilePath($name), $this
    ->getFilePath($new_name));
  if ($status === FALSE) {
    throw new StorageException('Failed to rename configuration file from: ' . $this
      ->getFilePath($name) . ' to: ' . $this
      ->getFilePath($new_name));
  }
  return TRUE;
}