Skip to main content
Version: Fegg 5.x (next)

File::copyAll

Copy all the files in a directory to another directory

Description​

public void File::copyAll( string $fromDirectory, string $toDirectory )

Copies every file directly under $fromDirectory to $toDirectory and sets the permission of the copied files to 0666. Both directories must exist; otherwise nothing happens. Subdirectories are not copied, use File::copyDirectory for them.

Arguments​

NameData typeDefaultRemarks
$fromDirectorystringSource directory
$toDirectorystringDestination directory (must exist)

Example​

Controller
use Fegg\Tool\File;

$file = new File();
$file->copyAll('path/to/foo', 'path/to/bar');