Elgg  Version 2.2
 All Classes Namespaces Files Functions Variables Pages
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...
 
 setVariable ($variable, $value)
 Set a cache variable. 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

 createFile ($filename, $rw="rb")
 Create and return a handle to a file. More...
 
 sanitise_filename ($key)
 Create a sanitised filename for the file. More...
 
 sanitizeFilename ($key)
 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 183 of file ElggFileCache.php.

Member Function Documentation

ElggFileCache::clear ( )

Delete all files in the directory of this file cache.

Returns
void

Definition at line 161 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 37 of file ElggFileCache.php.

ElggFileCache::delete (   $key)

Invalidate a given key.

Parameters
string$keyName
Returns
bool

Definition at line 147 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 123 of file ElggFileCache.php.

ElggFileCache::sanitise_filename (   $key)
protected

Create a sanitised filename for the file.

Parameters
string$keyThe filename
Returns
string

Definition at line 68 of file ElggFileCache.php.

ElggFileCache::sanitizeFilename (   $key)
protected

Create a sanitised filename for the file.

Parameters
string$keyThe filename
Returns
string

Definition at line 80 of file ElggFileCache.php.

ElggFileCache::save (   $key,
  $data 
)

Save a key.

Parameters
string$keyName
string$dataValue
Returns
boolean

Definition at line 102 of file ElggFileCache.php.


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