You are here

final public function FileTransfer::copyFile in Drupal 10

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

Copies a file.

Parameters

string $source: The source file.

string $destination: The destination file.

File

core/lib/Drupal/Core/FileTransfer/FileTransfer.php, line 181

Class

FileTransfer
Defines the base FileTransfer class.

Namespace

Drupal\Core\FileTransfer

Code

public final function copyFile($source, $destination) {
  $source = $this
    ->sanitizePath($source);
  $destination = $this
    ->fixRemotePath($destination);
  $this
    ->checkPath($destination);
  $this
    ->copyFileJailed($source, $destination);
}