\rex_dir

Class for handling directories.

Summary

Methods
Properties
Constants
create()
isWritable()
copy()
delete()
deleteFiles()
deleteIterator()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

create()

create(string  $dir, bool  $recursive = true) : bool

Creates a directory.

Parameters

string $dir

Path of the new directory

bool $recursive

When FALSE, nested directories won't be created

Returns

bool —

TRUE on success, FALSE on failure

isWritable()

isWritable(string  $dir) : bool

Returns wether the directory is writable.

Parameters

string $dir

Path of the directory

Returns

bool —

copy()

copy(string  $srcdir, string  $dstdir) : bool

Copies a directory.

Parameters

string $srcdir

Path of the source directory

string $dstdir

Path of the destination directory

Returns

bool —

TRUE on success, FALSE on failure

delete()

delete(string  $dir, bool  $deleteSelf = true) : bool

Deletes a directory.

Parameters

string $dir

Path of the directory

bool $deleteSelf

When FALSE, only subdirectories and files will be deleted

Returns

bool —

TRUE on success, FALSE on failure

deleteFiles()

deleteFiles(string  $dir, bool  $recursive = true) : bool

Deletes the files in a directory.

Parameters

string $dir

Path of the directory

bool $recursive

When FALSE, files in subdirectories won't be deleted

Returns

bool —

TRUE on success, FALSE on failure

deleteIterator()

deleteIterator(\Traversable  $iterator) : bool

Deletes files and directories by a rex_dir_iterator.

Parameters

\Traversable $iterator

Iterator, $iterator->current() must return a SplFileInfo-Object

Returns

bool —

TRUE on success, FALSE on failure