Class Directory
Contains helper methods concerned with directory manipulation.
Methods summary
public static
boolean
|
#
create( string $path )
Creates a directory and subdirectories, if not present.
Creates a directory and subdirectories, if not present.
Parameters
- $path
- Full or relative path to directory.
Returns
boolean If the directory was successfully created.
Throws
DomainException If directory already exists.
Uses
File::getFullPath To format path to file.
|
public static
boolean
|
#
delete( string $path )
Deletes a directory and all its subdirectories and files.
Deletes a directory and all its subdirectories and files.
Parameters
- $path
- Full or relative path to directory.
Returns
boolean Result of the operation.
Throws
InvalidArgumentException If path is empty or is not a directory.
Uses
File::getFullPath To format path to file.
self::delete To recursively delete subdirectories.
File::delete To delete files in directories.
|
public static
boolean
|
#
copy( string $from, string $to )
Copies a directory to another destination, recursively.
Copies a directory to another destination, recursively.
Parameters
- $from
- Full or relative path to directory.
- $to
- Full or relative path to destination directory.
Returns
boolean If the directory and its contents were copied successfully.
Uses
File::getFullPath To format path to file.
self::create To create a directory.
self::copy To recursively copy subdirectories.
File::copy To copy files to the destination.
|