Dir [directory]
exists
checks if a given directory exists.
Dir::exists(string $sDirectory = '') : bool
Example
$bExists = Dir::exists(
'/tmp/foo'
);
// type: boolean
true
isEmpty
checks if a directory is empty.
Dir::isEmpty(string $sDirectory = '') : bool
Example
$bEmpty = Dir::isEmpty(
'/tmp/foo'
);
// type: boolean
false
make
creates a directory.
Dir::make(string $sDirectory = '', int $iPermission = 0755, bool $bRecursive = true) : bool
Example
$bEmpty = Dir::make(
'/tmp/foo/bar'
);
// type: boolean
true
recursiveCopy
copies a directory recursively.
Dir::recursiveCopy(string $sSource = '', string $sDestination = '') : void
Example
Dir::recursiveCopy(
'/tmp/foo/',
'/tmp/bar'
);
remove
deletes a directory.
⚠ be aware: Dir::remove('/tmp/foo/')
would delete folder foo
as well; as a trailing slash has no meaning.
⚠ parameter $bForce
: if set to true: ignores if directory is not empty; removes given directory no matter what (default=false).
Dir::remove(string $sDirectory = '', bool $bForce = false) : bool
Example
$bRemove = Dir::remove(
'/tmp/foo/bar'
);
// type: boolean
true