Elgg  Version 1.11
Public Member Functions | List of all members
Elgg\Filesystem\Directory Interface Reference

A simple directory abstraction. More...

Inheritance diagram for Elgg\Filesystem\Directory:
Elgg\Filesystem\GaufretteDirectory

Public Member Functions

 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= '')
 Recursively list the files in the given directory 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...
 

Detailed Description

A simple directory abstraction.

Since
1.10.2

private

Definition at line 11 of file Directory.php.

Member Function Documentation

Elgg\Filesystem\Directory::chroot (   $path)

Returns a subdirectory with access limited to the given directory.

Parameters
string$pathThe path relative to this directory to chroot to.
Returns
Directory A new directory instance.

Implemented in Elgg\Filesystem\GaufretteDirectory.

Elgg\Filesystem\Directory::getContents (   $path)

Read the file off the filesystem.

Parameters
string$pathThe directory-relative path to the target file.
Returns
string Empty string if the file doesn't exist.

Implemented in Elgg\Filesystem\GaufretteDirectory.

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$pathThe path to the file, relative to this directory.
Returns
File

Implemented in Elgg\Filesystem\GaufretteDirectory.

Elgg\Filesystem\Directory::getFiles (   $path = '')

Recursively list the files in the given directory path.

Parameters
string$pathThe subdirectory path within this directory
Returns
Collection<File>

Implemented in Elgg\Filesystem\GaufretteDirectory.

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$pathFilesystem-relative path for the file to include.
Returns
mixed

Implemented in Elgg\Filesystem\GaufretteDirectory.

Elgg\Filesystem\Directory::isFile (   $path)

Whether this directory has an existing file at the given location.

Parameters
string$pathThe relative path within this directory
Returns
boolean

Implemented in Elgg\Filesystem\GaufretteDirectory.

Elgg\Filesystem\Directory::putContents (   $path,
  $content 
)

Write a file, overwriting the contents if necessary.

Parameters
string$pathThe path to the file.
string$contentThe literal text content of the file.
Returns
void

Implemented in Elgg\Filesystem\GaufretteDirectory.


The documentation for this interface was generated from the following file: