Methods summary
public static
boolean
|
#
remove_folder( string $folder, boolean $protect_folder = false, string $first_folder_name = '', string $parent_folder = '' )
Remove a folder and its content. The folder can be kept and only emptied.
Remove a folder and its content. The folder can be kept and only emptied.
Parameters
- $folder
- The name of the folder to delete.
- $protect_folder
- True if the original folder has to be kept. False per default.
- $first_folder_name
- The name of the first folder if it has to be kept. No need to fill it, used for recursive matter.
- $parent_folder
- The name of the parent folder. No need to fill it, used for recursive matter.
Returns
boolean True if the folder is successfully removed, otherwise false.
|
public static
|
#
copy_folder( string $source_path, string $destination_path )
Copy a folder from a source path to a destination.
Copy a folder from a source path to a destination.
Parameters
- $source_path
- Source path of the folder.
- $destination_path
- Destination path of the folder.
|
public static
boolean
|
#
download_remote_file( string $url, string $destination_path, string $extract_archive = true, string $retry = false )
Download a file from a remote url with md5 sum check and extract it if needed in case of a zip file. Curl library needed.
Download a file from a remote url with md5 sum check and extract it if needed in case of a zip file. Curl library needed.
Parameters
- $url
- Url of the remote file.
- $destination_path
- Destination path of the file.
- $extract_archive
- Extract the content of the zip file and delete the zip file if true.
- $retry
- Second try if the archive is corrupted. No need to use this parameter, it is used automatically by the function.
Returns
boolean True if the file is successfully downloaded, otherwise false.
|