PHP Class ElggDiskFilestore, Elgg

Inheritance: extends ElggFilestore
Afficher le fichier Open project: elgg/elgg Class Usage Examples

Méthodes publiques

Méthode Description
__construct ( string $directory_root = "" ) Construct a disk filestore using the given directory root.
close ( resource $f ) : boolean Close a file pointer
delete ( ElggFile $file, boolean $follow_symlinks = true ) : boolean Delete an \ElggFile file.
eof ( resource $f ) : boolean Tests for end of file on a file pointer
exists ( ElggFile $file ) : boolean Tests if an \ElggFile file exists.
getFileSize ( ElggFile $file ) : integer Returns the file size of an \ElggFile file.
getFilenameOnFilestore ( ElggFile $file ) : string Get the filename as saved on disk for an \ElggFile object
getParameters ( ) : array Returns a list of attributes to save to the database when saving the \ElggFile object using this file store.
getSize ( string $prefix, string $container_guid ) : integer | false Returns the size of all data stored under a directory in the disk store.
grabFile ( ElggFile $file ) : string Returns the contents of the \ElggFile file.
open ( ElggFile $file, string $mode ) : resource Open a file for reading, writing, or both.
read ( resource $f, integer $length, integer $offset ) : mixed Read data from a file.
seek ( resource $f, integer $position ) : integer Seek to the specified position.
setParameters ( array $parameters ) : boolean Sets parameters that should be saved to database.
tell ( resource $f ) : integer | false Return the current location of the internal pointer
write ( resource $f, mixed $data ) : boolean Write data to a file.

Méthodes protégées

Méthode Description
makeDirectoryRoot ( string $dirroot ) : true Create a directory $dirroot

Method Details

__construct() public méthode

Construct a disk filestore using the given directory root.
public __construct ( string $directory_root = "" )
$directory_root string Root directory, must end in "/"

close() public méthode

Close a file pointer
public close ( resource $f ) : boolean
$f resource A file pointer resource
Résultat boolean

delete() public méthode

Delete an \ElggFile file.
public delete ( ElggFile $file, boolean $follow_symlinks = true ) : boolean
$file ElggFile File to delete
$follow_symlinks boolean If true, will also delete the target file if the current file is a symlink
Résultat boolean

eof() public méthode

Tests for end of file on a file pointer
public eof ( resource $f ) : boolean
$f resource File pointer resource
Résultat boolean

exists() public méthode

Tests if an \ElggFile file exists.
public exists ( ElggFile $file ) : boolean
$file ElggFile File object
Résultat boolean

getFileSize() public méthode

Returns the file size of an \ElggFile file.
public getFileSize ( ElggFile $file ) : integer
$file ElggFile File object
Résultat integer The file size

getFilenameOnFilestore() public méthode

Returns an empty string if no filename set
public getFilenameOnFilestore ( ElggFile $file ) : string
$file ElggFile File object
Résultat string The full path of where the file is stored

getParameters() public méthode

Returns a list of attributes to save to the database when saving the \ElggFile object using this file store.
public getParameters ( ) : array
Résultat array

getSize() public méthode

Returns the size of all data stored under a directory in the disk store.
public getSize ( string $prefix, string $container_guid ) : integer | false
$prefix string The prefix to check under.
$container_guid string The guid of the entity whose data you want to check.
Résultat integer | false

grabFile() public méthode

Returns the contents of the \ElggFile file.
public grabFile ( ElggFile $file ) : string
$file ElggFile File object
Résultat string

makeDirectoryRoot() protected méthode

Create a directory $dirroot
protected makeDirectoryRoot ( string $dirroot ) : true
$dirroot string The full path of the directory to create
Résultat true

open() public méthode

Open a file for reading, writing, or both.
public open ( ElggFile $file, string $mode ) : resource
$file ElggFile The file to open
$mode string read, write, or append.
Résultat resource File pointer resource

read() public méthode

Read data from a file.
public read ( resource $f, integer $length, integer $offset ) : mixed
$f resource File pointer resource
$length integer The number of bytes to read
$offset integer The number of bytes to start after
Résultat mixed Contents of file or false on fail.

seek() public méthode

Seek to the specified position.
public seek ( resource $f, integer $position ) : integer
$f resource File resource
$position integer Position in bytes
Résultat integer 0 for success, or -1

setParameters() public méthode

Sets parameters that should be saved to database.
public setParameters ( array $parameters ) : boolean
$parameters array Set parameters to save to DB for this filestore.
Résultat boolean

tell() public méthode

Return the current location of the internal pointer
public tell ( resource $f ) : integer | false
$f resource File pointer resource
Résultat integer | false

write() public méthode

Write data to a file.
public write ( resource $f, mixed $data ) : boolean
$f resource File pointer resource
$data mixed The data to write.
Résultat boolean