PHP Class ElggMemcache, Elgg

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

Méthodes publiques

Méthode Description
__construct ( string $namespace = 'default', Pool $pool = null, integer $ttl = null ) Constructor
clear ( ) : boolean Clears all values in the namespace of this cache
delete ( string $key ) : boolean Delete data
load ( string $key, integer $unused1, integer $unused2 = null ) : mixed Retrieves data.
save ( string $key, string $data, integer $ttl = null ) : boolean Saves a name and value to the cache
setDefaultExpiry ( integer $ttl ) : void Set the default TTL.
setNamespace ( string $namespace = "default" ) : void Set the namespace of this cache.

Private Methods

Méthode Description
makeMemcacheKey ( string $key ) : string Combine a key with the namespace.

Method Details

__construct() public méthode

Constructor
See also: _elgg_get_memcache() Core developers should use this instead of direct construction.
public __construct ( string $namespace = 'default', Pool $pool = null, integer $ttl = null )
$namespace string The namespace for this cache to write to
$pool Stash\Pool The cache pool to use. Default is memcache.
$ttl integer The TTL in seconds. Default is from $CONFIG->memcache_expires.

clear() public méthode

Clears all values in the namespace of this cache
public clear ( ) : boolean
Résultat boolean

delete() public méthode

Delete data
public delete ( string $key ) : boolean
$key string Name of data
Résultat boolean

load() public méthode

Retrieves data.
public load ( string $key, integer $unused1, integer $unused2 = null ) : mixed
$key string Name of data to retrieve
$unused1 integer Unused
$unused2 integer Unused
Résultat mixed

save() public méthode

Saves a name and value to the cache
public save ( string $key, string $data, integer $ttl = null ) : boolean
$key string Name
$data string Value
$ttl integer TTL of cache item (seconds), 0 for no expiration, null for default.
Résultat boolean

setDefaultExpiry() public méthode

Set the default TTL.
public setDefaultExpiry ( integer $ttl ) : void
$ttl integer The TTL in seconds from now. Default is no expiration.
Résultat void

setNamespace() public méthode

This will also add the Memcache namespace prefix as defined in settings.php
public setNamespace ( string $namespace = "default" ) : void
$namespace string Namespace for cache
Résultat void