Overview

Packages

  • ClipIt
    • clipit
      • api
    • urjc
      • backend
  • Elgg
    • Core
      • Access
      • Authentication
      • Cache
      • Caches
      • Core
      • DataMode
        • Site
      • DataModel
        • Annotations
        • Entities
        • Extender
        • File
        • Importable
        • Loggable
        • Notable
        • Object
        • User
      • DataStorage
      • Exception
      • Exceptions
        • Stub
      • FileStore
        • Disk
      • Groups
      • Helpers
      • HMAC
      • Memcache
      • Metadata
      • Navigation
      • ODD
      • Output
      • Plugins
        • Settings
      • Sessions
      • SocialModel
        • Friendable
        • Locatable
      • WebServicesAPI
      • Widgets
      • XML
      • XMLRPC
    • Exceptions
      • Stub
  • None
  • PHP

Classes

  • ElggCache
  • ElggLRUCache
  • ElggSharedMemoryCache
  • ElggStaticVariableCache
  • ElggVolatileMetadataCache
  • Overview
  • Package
  • Class
  • Tree

Class ElggCache

ElggCache The elgg cache superclass. This defines the interface for a cache (wherever that cache is stored).

ElggCache implements ArrayAccess

Direct known subclasses

ElggFileCache, ElggHMACCache, ElggSharedMemoryCache

Indirect known subclasses

ElggMemcache, ElggStaticVariableCache
Abstract
Package: Elgg\Core\Cache
Located at ElggCache.php
Methods summary
public
# __construct( )

Set the constructor.

Set the constructor.

public
# setVariable( string $variable, string $value )

Set a cache variable.

Set a cache variable.

Parameters

$variable
string
$variable Name
$value
string
$value Value
public mixed
# getVariable( string $variable )

Get variables for this cache.

Get variables for this cache.

Parameters

$variable
string
$variable Name

Returns

mixed
The variable or null;
public mixed
# __get( string $key )

Class member get overloading, returning key using $this->load defaults.

Class member get overloading, returning key using $this->load defaults.

Parameters

$key
string
$key Name

Returns

mixed
public mixed
# __set( string $key, mixed $value )

Class member set overloading, setting a key using $this->save defaults.

Class member set overloading, setting a key using $this->save defaults.

Parameters

$key
string
$key Name
$value
mixed
$value Value

Returns

mixed
public boolean
# __isset( string $key )

Supporting isset, using $this->load() with default values.

Supporting isset, using $this->load() with default values.

Parameters

$key
string
$key The name of the attribute or metadata.

Returns

boolean
public boolean
# __unset( string $key )

Supporting unsetting of magic attributes.

Supporting unsetting of magic attributes.

Parameters

$key
string
$key The name of the attribute or metadata.

Returns

boolean
abstract public boolean
# save( string $key, string $data )

Save data in a cache.

Save data in a cache.

Parameters

$key
string
$key Name
$data
string
$data Value

Returns

boolean
abstract public mixed
# load( string $key, integer $offset = 0, integer $limit = null )

Load data from the cache using a given key.

Load data from the cache using a given key.

Parameters

$key
string
$key Name
$offset
integer
$offset Offset
$limit
integer
$limit Limit

Returns

mixed
The stored data or false.
abstract public boolean
# delete( string $key )

Invalidate a key

Invalidate a key

Parameters

$key
string
$key Name

Returns

boolean
abstract public boolean
# clear( )

Clear out all the contents of the cache.

Clear out all the contents of the cache.

Returns

boolean
public boolean
# add( string $key, string $data )

Add a key only if it doesn't already exist. Implemented simply here, if you extend this class and your caching engine provides a better way then override this accordingly.

Add a key only if it doesn't already exist. Implemented simply here, if you extend this class and your caching engine provides a better way then override this accordingly.

Parameters

$key
string
$key Name
$data
string
$data Value

Returns

boolean
public
# offsetSet( mixed $key, mixed $value )

Assigns a value for the specified key

Assigns a value for the specified key

Parameters

$key
mixed
$key The key (offset) to assign the value to.
$value
mixed
$value The value to set.

See

ArrayAccess::offsetSet()

Implementation of

ArrayAccess::offsetSet()
public mixed
# offsetGet( mixed $key )

Get the value for specified key

Get the value for specified key

Parameters

$key
mixed
$key The key (offset) to retrieve.

Returns

mixed

See

ArrayAccess::offsetGet()

Implementation of

ArrayAccess::offsetGet()
public
# offsetUnset( mixed $key )

Unsets a key.

Unsets a key.

Parameters

$key
mixed
$key The key (offset) to unset.

See

ArrayAccess::offsetUnset()

Implementation of

ArrayAccess::offsetUnset()
public boolean
# offsetExists( mixed $key )

Does key exist

Does key exist

Parameters

$key
mixed
$key A key (offset) to check for.

Returns

boolean

See

ArrayAccess::offsetExists()

Implementation of

ArrayAccess::offsetExists()
API documentation generated by ApiGen 2.8.0