File::copyAll
Copy all the files in a directory to another directory
Description
public bool File::copyAll( string $fromDirectory, string $toDirectory )
Copies every file directly under $fromDirectory to $toDirectory with File::copyFile (permission 0644). Subdirectories and symbolic links are not copied, use File::copyDirectory for subdirectories.
Returns false when one of the directories does not exist or a file could not be copied.
Arguments
| Name | Data type | Default | Remarks |
|---|---|---|---|
| $fromDirectory | string | Source directory | |
| $toDirectory | string | Destination directory (must exist) |
Example
Controller
use Fegg\Tool\File;
$file = new File();
$file->copyAll('path/to/foo', 'path/to/bar');