Elgg  Version 1.9
Public Member Functions | List of all members
ElggFilestore Class Reference
Inheritance diagram for ElggFilestore:
ElggDiskFilestore

Public Member Functions

 open (ElggFile $file, $mode)
 Attempt to open the file $file for storage or writing. More...
 
 write ($f, $data)
 Write data to a given file handle. More...
 
 read ($f, $length, $offset=0)
 Read data from a filestore. More...
 
 seek ($f, $position)
 Seek a given position within a file handle. More...
 
 eof ($f)
 Return a whether the end of a file has been reached. More...
 
 tell ($f)
 Return the current position in an open file. More...
 
 close ($f)
 Close a given file handle. More...
 
 delete (ElggFile $file)
 Delete the file associated with a given file handle. More...
 
 getFileSize (ElggFile $file)
 Return the size in bytes for a given file. More...
 
 getFilenameOnFilestore (ElggFile $file)
 Return the filename of a given file as stored on the filestore. More...
 
 getParameters ()
 Get the filestore's creation parameters as an associative array. More...
 
 setParameters (array $parameters)
 Set the parameters from the associative array produced by $this->getParameters(). More...
 
 grabFile (ElggFile $file)
 Get the contents of the whole file. More...
 
 exists (ElggFile $file)
 Return whether a file physically exists or not. More...
 

Detailed Description

Definition at line 9 of file ElggFilestore.php.

Member Function Documentation

ElggFilestore::close (   $f)
abstract

Close a given file handle.

Parameters
mixed$fThe file handle
Returns
bool
ElggFilestore::delete ( ElggFile  $file)
abstract

Delete the file associated with a given file handle.

Parameters
ElggFile$fileThe file
Returns
bool
ElggFilestore::eof (   $f)
abstract

Return a whether the end of a file has been reached.

Parameters
mixed$fThe file handle.
Returns
boolean
ElggFilestore::exists ( ElggFile  $file)
abstract

Return whether a file physically exists or not.

Parameters
ElggFile$fileThe file
Returns
bool
ElggFilestore::getFilenameOnFilestore ( ElggFile  $file)
abstract

Return the filename of a given file as stored on the filestore.

Parameters
ElggFile$fileThe file
Returns
string
ElggFilestore::getFileSize ( ElggFile  $file)
abstract

Return the size in bytes for a given file.

Parameters
ElggFile$fileThe file
Returns
int
ElggFilestore::getParameters ( )
abstract

Get the filestore's creation parameters as an associative array.

Used for serialisation and for storing the creation details along side a file object.

Returns
array
ElggFilestore::grabFile ( ElggFile  $file)
abstract

Get the contents of the whole file.

Parameters
mixed$fileThe file handle.
Returns
mixed The file contents.
ElggFilestore::open ( ElggFile  $file,
  $mode 
)
abstract

Attempt to open the file $file for storage or writing.

Parameters
ElggFile$fileA file
string$mode"read", "write", "append"
Returns
mixed A handle to the opened file or false on error.
ElggFilestore::read (   $f,
  $length,
  $offset = 0 
)
abstract

Read data from a filestore.

Parameters
mixed$fThe file handle
int$lengthLength in bytes to read.
int$offsetThe optional offset.
Returns
mixed String of data or false on error.
ElggFilestore::seek (   $f,
  $position 
)
abstract

Seek a given position within a file handle.

Parameters
mixed$fThe file handle.
int$positionThe position.
Returns
void
ElggFilestore::setParameters ( array  $parameters)
abstract

Set the parameters from the associative array produced by $this->getParameters().

Parameters
array$parametersA list of parameters
Returns
bool
ElggFilestore::tell (   $f)
abstract

Return the current position in an open file.

Parameters
mixed$fThe file handle.
Returns
int
ElggFilestore::write (   $f,
  $data 
)
abstract

Write data to a given file handle.

Parameters
mixed$fThe file handle - exactly what this is depends on the file system
string$dataThe binary string of data to write
Returns
int Number of bytes written.

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