Summary
- File
- Package hierarchy IO\Filesystem
- Class hierarchy \FileSystemElement \Folder
This class allows you to handle very easily a folder on the server.
This class allows you to handle very easily a folder on the server.
__construct(string $path)
Builds a Folder object.
string | $path | Path of the folder. |
None found |
exists() : boolean
Allows you to know if the file system element exists.
True if the file exists, else, false.
None found |
get_path() : string
Returns the element full path.
The element full path.
None found |
get_path_from_root() : string
Returns the element path from the phpboost root.
The element from the phpboost root.
None found |
get_name() : string
Returns the element name.
The element name.
None found |
is_writable(boolean $force_chmod = false) : true
Returns true if the file or the folder is writable.
boolean | $force_chmod | If true, then, chmod will be forced to 777 if not writable. |
if the file or the folder is writable.
None found |
change_chmod(integer $chmod) : true
Changes the chmod of the element.
integer | $chmod | The new chmod of the file. Put a 0 at the begening of the number to indicate to the PHP parser that it's an octal value. |
if the chmod has been successfully changed.
None found |
delete() : True
Deletes the folder and all what it contains.
if deleted successfully.
None found |
create() : boolean
Returns true if the folder exists after this call, else, false
true if the folder exists after this call, else, false
None found |
get_files(string $regex = '', boolean $regex_exclude_files = false) : array<mixed,\File>
Lists the files contained in this folder.
string | $regex | PREG which describes the pattern the files you want to list must match. If you want all of them, don't use this parameter. |
boolean | $regex_exclude_files | true if the regex to exclude files |
The files list.
None found |
get_folders(string $regex = '') : array<mixed,\Folder>
Lists the folders contained in this folder.
string | $regex | PREG which describes the pattern the folders you want to list must match. If you want all of them, don't use this parameter. |
The folders list.
None found |
get_first_folder() : \Folder
Returns the first folder present in this folder
The first folder of this folder or null if it doesn't contain any folder.
None found |
get_all_content() : array<mixed,\FileSystemElement>
Returns all the file system elements contained by the folder.
The list of the file system element contained in this folder.
None found |
get_last_modification_date() : integer
Returns the date of the last modification of the folder.
The UNIX timestamp corresponding to the last modification date.
None found |
open()
Opens the folder.
None found |
$path : string
None found |
$opened :
None found |
$files : array<mixed,\File>
None found |
$folders : array<mixed,\Folder>
None found |