function FileStorage::rename

Same name in other branches
  1. 9 core/lib/Drupal/Core/Config/FileStorage.php \Drupal\Core\Config\FileStorage::rename()
  2. 8.9.x core/lib/Drupal/Core/Config/FileStorage.php \Drupal\Core\Config\FileStorage::rename()
  3. 11.x core/lib/Drupal/Core/Config/FileStorage.php \Drupal\Core\Config\FileStorage::rename()

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 179

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) {
        return FALSE;
    }
    $this->fileCache
        ->delete($this->getFilePath($name));
    $this->fileCache
        ->delete($this->getFilePath($new_name));
    return TRUE;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.