You are here

public function FileStorage::rename in Drupal 10

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

File

core/lib/Drupal/Core/Config/FileStorage.php, line 182

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;
}