You are here

public function FileOperations::fileRename in AT Tools 8.3

Same name and namespace in other branches
  1. 8 at_theme_generator/src/File/FileOperations.php \Drupal\at_theme_generator\File\FileOperations::fileRename()
  2. 8.2 at_theme_generator/src/File/FileOperations.php \Drupal\at_theme_generator\File\FileOperations::fileRename()

Rename old file to new file.

Parameters

string $old_file: Source file to be renamed.

string $new_file: The new file name.

File

at_theme_generator/src/File/FileOperations.php, line 22
Contains \Drupal\at_theme_generator\File\FileOperations

Class

FileOperations

Namespace

Drupal\at_theme_generator\File

Code

public function fileRename($old_file, $new_file) {
  if (file_exists($old_file)) {
    rename($old_file, $new_file);
  }
}