A simple directory abstraction.
More...
|
| chroot ($path) |
| Returns a subdirectory with access limited to the given directory. More...
|
|
| getContents ($path) |
| Read the file off the filesystem. More...
|
|
| getFile ($path) |
| A reference to the file at the given path, even if it doesn't exist yet. More...
|
|
| getFiles ($path= '', $recursive=true) |
| List the files in the given directory path. More...
|
|
| getDirectories ($path= '', $recursive=true) |
| List the directories in the given directory path. More...
|
|
| getPath ($path= '') |
| Get the absolute path to the given directory-relative path. More...
|
|
| includeFile ($path) |
| Do a PHP include of the file and return the result. More...
|
|
| isFile ($path) |
| Whether this directory has an existing file at the given location. More...
|
|
| putContents ($path, $content) |
| Write a file, overwriting the contents if necessary. More...
|
|
A simple directory abstraction.
- Since
- 1.10.2
Definition at line 14 of file Directory.php.
Elgg\Filesystem\Directory::chroot |
( |
|
$path | ) |
|
Returns a subdirectory with access limited to the given directory.
- Parameters
-
string | $path | The path relative to this directory to chroot to. |
- Returns
- Directory A new directory instance.
- Exceptions
-
Implemented in Elgg\Filesystem\Directory\Fly.
Elgg\Filesystem\Directory::getContents |
( |
|
$path | ) |
|
Read the file off the filesystem.
- Parameters
-
string | $path | The directory-relative path to the target file. |
- Returns
- string Empty string if the file doesn't exist.
- Exceptions
-
Implemented in Elgg\Filesystem\Directory\Fly.
Elgg\Filesystem\Directory::getDirectories |
( |
|
$path = '' , |
|
|
|
$recursive = true |
|
) |
| |
List the directories in the given directory path.
- Parameters
-
string | $path | The subdirectory path within this directory |
bool | $recursive | Find directories recursively |
- Returns
- <Directory>
- Exceptions
-
Implemented in Elgg\Filesystem\Directory\Fly.
Elgg\Filesystem\Directory::getFile |
( |
|
$path | ) |
|
A reference to the file at the given path, even if it doesn't exist yet.
However, will throw an exception if the file is already a directory.
- Parameters
-
string | $path | The path to the file, relative to this directory. |
- Returns
- File
- Exceptions
-
Implemented in Elgg\Filesystem\Directory\Fly.
Elgg\Filesystem\Directory::getFiles |
( |
|
$path = '' , |
|
|
|
$recursive = true |
|
) |
| |
List the files in the given directory path.
- Parameters
-
string | $path | The subdirectory path within this directory |
bool | $recursive | Find files recursively |
- Returns
- <File>
- Exceptions
-
Implemented in Elgg\Filesystem\Directory\Fly.
Elgg\Filesystem\Directory::getPath |
( |
|
$path = '' | ) |
|
Get the absolute path to the given directory-relative path.
- Parameters
-
string | $path | A file/directory path within this directory. |
- Returns
- string
- Exceptions
-
Implemented in Elgg\Filesystem\Directory\Fly.
Elgg\Filesystem\Directory::includeFile |
( |
|
$path | ) |
|
Do a PHP include of the file and return the result.
NB: This only really works with local filesystems amirite?
- Parameters
-
string | $path | Filesystem-relative path for the file to include. |
- Returns
- mixed
- Exceptions
-
Implemented in Elgg\Filesystem\Directory\Fly.
Elgg\Filesystem\Directory::isFile |
( |
|
$path | ) |
|
Whether this directory has an existing file at the given location.
- Parameters
-
string | $path | The relative path within this directory |
- Returns
- boolean
- Exceptions
-
Implemented in Elgg\Filesystem\Directory\Fly.
Elgg\Filesystem\Directory::putContents |
( |
|
$path, |
|
|
|
$content |
|
) |
| |
Write a file, overwriting the contents if necessary.
- Parameters
-
string | $path | The path to the file. |
string | $content | The literal text content of the file. |
- Returns
- void
- Exceptions
-
Implemented in Elgg\Filesystem\Directory\Fly.
The documentation for this interface was generated from the following file: