rex_dir
in package
Class for handling directories.
Tags
Table of Contents
Methods
- copy() : bool
- Copies a directory.
- create() : bool
- Creates a directory.
- delete() : bool
- Deletes a directory.
- deleteFiles() : bool
- Deletes the files in a directory.
- deleteIterator() : bool
- Deletes files and directories by a rex_dir_iterator.
- isWritable() : bool
- Returns wether the directory is writable.
Methods
copy()
Copies a directory.
public
static copy(string $srcdir, string $dstdir) : bool
Parameters
- $srcdir : string
-
Path of the source directory
- $dstdir : string
-
Path of the destination directory
Tags
Return values
bool —TRUE on success, FALSE on failure
create()
Creates a directory.
public
static create(string $dir[, bool $recursive = true ]) : bool
Parameters
- $dir : string
-
Path of the new directory
- $recursive : bool = true
-
When FALSE, nested directories won't be created
Tags
Return values
bool —TRUE on success, FALSE on failure
delete()
Deletes a directory.
public
static delete(string $dir[, bool $deleteSelf = true ]) : bool
Parameters
- $dir : string
-
Path of the directory
- $deleteSelf : bool = true
-
When FALSE, only subdirectories and files will be deleted
Return values
bool —TRUE on success, FALSE on failure
deleteFiles()
Deletes the files in a directory.
public
static deleteFiles(string $dir[, bool $recursive = true ]) : bool
Parameters
- $dir : string
-
Path of the directory
- $recursive : bool = true
-
When FALSE, files in subdirectories won't be deleted
Return values
bool —TRUE on success, FALSE on failure
deleteIterator()
Deletes files and directories by a rex_dir_iterator.
public
static deleteIterator(Traversable<string|int, SplFileInfo> $iterator) : bool
Parameters
- $iterator : Traversable<string|int, SplFileInfo>
-
Iterator, $iterator->current() must return a SplFileInfo-Object
Return values
bool —TRUE on success, FALSE on failure
isWritable()
Returns wether the directory is writable.
public
static isWritable(string $dir) : bool
Parameters
- $dir : string
-
Path of the directory