Elgg  Version 2.2
 All Classes Namespaces Files Functions Variables Pages
Public Member Functions | List of all members
Elgg\Filesystem\File Class Reference

Represents a file that may or may not actually exist. More...

Public Member Functions

 __construct (Directory $directory, $path)
 Constructor. More...
 
 exists ()
 
 getBasename ()
 
 getContents ()
 Get the text content of this file. More...
 
 putContents ($content)
 Put content into this file. More...
 
 getExtension ()
 
 getPath ()
 
 includeFile ()
 Do a PHP include of the file and return the result. More...
 
 __toString ()
 

Detailed Description

Represents a file that may or may not actually exist.

Since
1.10.0

private

Definition at line 11 of file File.php.

Constructor & Destructor Documentation

Elgg\Filesystem\File::__construct ( Directory  $directory,
  $path 
)

Constructor.

Parameters
Directory$directoryThe directory where this file resides
string$pathThe path to this file relative to the directory

Definition at line 25 of file File.php.

Member Function Documentation

Elgg\Filesystem\File::__toString ( )

Definition at line 89 of file File.php.

Elgg\Filesystem\File::exists ( )
Returns
boolean Whether this file exists.

Definition at line 33 of file File.php.

Elgg\Filesystem\File::getBasename ( )
Returns
string The file's basename.

Definition at line 40 of file File.php.

Elgg\Filesystem\File::getContents ( )

Get the text content of this file.

Empty string if it doesn't exist.

Returns
string

Definition at line 49 of file File.php.

Elgg\Filesystem\File::getExtension ( )
Returns
string The file's extension.

Definition at line 66 of file File.php.

Elgg\Filesystem\File::getPath ( )
Returns
string The full path to this file.

Definition at line 73 of file File.php.

Elgg\Filesystem\File::includeFile ( )

Do a PHP include of the file and return the result.

TODO(ewinslow): This may only work for local filesystems?

Returns
mixed

Definition at line 84 of file File.php.

Elgg\Filesystem\File::putContents (   $content)

Put content into this file.

Parameters
string$contentFile content
Returns
void

Definition at line 59 of file File.php.


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