PHP Class Elgg\Filesystem\File

Since: 1.10.0
Afficher le fichier Open project: elgg/elgg Class Usage Examples

Méthodes publiques

Méthode Description
__construct ( Elgg\Filesystem\Directory $directory, string $path ) Constructor
__toString ( )
exists ( ) : boolean
getBasename ( ) : string
getContents ( ) : string Get the text content of this file. Empty string if it doesn't exist.
getExtension ( ) : string
getPath ( ) : string
includeFile ( ) : mixed Do a PHP include of the file and return the result.
putContents ( string $content ) : void Put content into this file.

Method Details

__construct() public méthode

Constructor
public __construct ( Elgg\Filesystem\Directory $directory, string $path )
$directory Elgg\Filesystem\Directory The directory where this file resides
$path string The path to this file relative to the directory

__toString() public méthode

public __toString ( )

exists() public méthode

public exists ( ) : boolean
Résultat boolean Whether this file exists.

getBasename() public méthode

public getBasename ( ) : string
Résultat string The file's basename.

getContents() public méthode

Get the text content of this file. Empty string if it doesn't exist.
public getContents ( ) : string
Résultat string

getExtension() public méthode

public getExtension ( ) : string
Résultat string The file's extension.

getPath() public méthode

public getPath ( ) : string
Résultat string The full path to this file.

includeFile() public méthode

TODO(ewinslow): This may only work for local filesystems?
public includeFile ( ) : mixed
Résultat mixed

putContents() public méthode

Put content into this file.
public putContents ( string $content ) : void
$content string File content
Résultat void