Elgg  Version 1.11
Public Member Functions | Protected Member Functions | List of all members
ElggFileCache Class Reference
Inheritance diagram for ElggFileCache:
ElggCache

Public Member Functions

 __construct ($cache_path, $max_age=0, $max_size=0)
 Set the Elgg cache. More...
 
 save ($key, $data)
 Save a key. More...
 
 load ($key, $offset=0, $limit=null)
 Load a key. More...
 
 delete ($key)
 Invalidate a given key. More...
 
 clear ()
 Delete all files in the directory of this file cache. More...
 
 __destruct ()
 Preform cleanup and invalidates cache upon object destruction. More...
 
- Public Member Functions inherited from ElggCache
 __construct ()
 Set the constructor. More...
 
 set_variable ($variable, $value)
 Set a cache variable. More...
 
 setVariable ($variable, $value)
 Set a cache variable. More...
 
 get_variable ($variable)
 Get variables for this cache. More...
 
 getVariable ($variable)
 Get variables for this cache. More...
 
 __get ($key)
 Class member get overloading, returning key using $this->load defaults. More...
 
 __set ($key, $value)
 Class member set overloading, setting a key using $this->save defaults. More...
 
 __isset ($key)
 Supporting isset, using $this->load() with default values. More...
 
 __unset ($key)
 Supporting unsetting of magic attributes. More...
 
 save ($key, $data)
 Save data in a cache. More...
 
 load ($key, $offset=0, $limit=null)
 Load data from the cache using a given key. More...
 
 delete ($key)
 Invalidate a key. More...
 
 clear ()
 Clear out all the contents of the cache. More...
 
 add ($key, $data)
 Add a key only if it doesn't already exist. More...
 
 offsetSet ($key, $value)
 Assigns a value for the specified key. More...
 
 offsetGet ($key)
 Get the value for specified key. More...
 
 offsetUnset ($key)
 Unsets a key. More...
 
 offsetExists ($key)
 Does key exist. More...
 

Protected Member Functions

 create_file ($filename, $rw="rb")
 Create and return a handle to a file. More...
 
 createFile ($filename, $rw="rb")
 Create and return a handle to a file. More...
 
 sanitise_filename ($filename)
 Create a sanitised filename for the file. More...
 
 sanitizeFilename ($filename)
 Create a sanitised filename for the file. More...
 

Detailed Description

Definition at line 9 of file ElggFileCache.php.

Constructor & Destructor Documentation

ElggFileCache::__construct (   $cache_path,
  $max_age = 0,
  $max_size = 0 
)

Set the Elgg cache.

Parameters
string$cache_pathThe cache path.
int$max_ageMaximum age in seconds, 0 if no limit.
int$max_sizeMaximum size of cache in seconds, 0 if no limit.
Exceptions
ConfigurationException

Definition at line 19 of file ElggFileCache.php.

ElggFileCache::__destruct ( )

Preform cleanup and invalidates cache upon object destruction.

Exceptions
IOException

Definition at line 196 of file ElggFileCache.php.

Member Function Documentation

ElggFileCache::clear ( )

Delete all files in the directory of this file cache.

Returns
void

Definition at line 174 of file ElggFileCache.php.

ElggFileCache::create_file (   $filename,
  $rw = "rb" 
)
protected

Create and return a handle to a file.

Parameters
string$filenameFilename to save as
string$rwWrite mode
Returns
mixed

Definition at line 40 of file ElggFileCache.php.

ElggFileCache::createFile (   $filename,
  $rw = "rb" 
)
protected

Create and return a handle to a file.

Parameters
string$filenameFilename to save as
string$rwWrite mode
Returns
mixed

Definition at line 55 of file ElggFileCache.php.

ElggFileCache::delete (   $key)

Invalidate a given key.

Parameters
string$keyName
Returns
bool

Definition at line 160 of file ElggFileCache.php.

ElggFileCache::load (   $key,
  $offset = 0,
  $limit = null 
)

Load a key.

Parameters
string$keyName
int$offsetOffset
int$limitLimit
Returns
string

Definition at line 136 of file ElggFileCache.php.

ElggFileCache::sanitise_filename (   $filename)
protected

Create a sanitised filename for the file.

Parameters
string$filenameThe filename
Returns
string

Definition at line 87 of file ElggFileCache.php.

ElggFileCache::sanitizeFilename (   $filename)
protected

Create a sanitised filename for the file.

Parameters
string$filenameThe filename
Returns
string

Definition at line 101 of file ElggFileCache.php.

ElggFileCache::save (   $key,
  $data 
)

Save a key.

Parameters
string$keyName
string$dataValue
Returns
boolean

Definition at line 115 of file ElggFileCache.php.


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