File::copyFile
Copy a file
Description
public bool File::copyFile( string $source, string $dest )
Copies $source to $dest and sets the permission of the copy to 0644 (readable by everyone). Returns false when $source is not a file or the copy fails.
Arguments
| Name | Data type | Default | Remarks |
|---|---|---|---|
| $source | string | Source file | |
| $dest | string | Destination file |
Example
Controller
use Fegg\Tool\File;
$file = new File();
$file->copyFile('path/to/foo.txt', 'path/to/bar.txt');