Class RedisWrapper
A wrapper for PHP's Redis extension.
- Alo\Cache\AbstractCacheimplementsCountable,ArrayAccess,IteratorAggregate
Alo\Cache\RedisWrapper
Methods summary
public | #__construct(boolean$initDefaultServer=true) Instantiates the class Parameters- $initDefaultServer
boolean $initDefaultServer Whether to add a server on construct
AuthorOverrides |
public boolean | #addServer(string$ip= ALO_REDIS_IP,integer$port= ALO_REDIS_PORT,integer$weight=1) Adds a server to the pool Adds a server to the pool Parameters- $ip
string $ip The server IP- $port
integer $port The server port- $weight
integer $weight The server's weight, ie how likely it is to be used. Currently unused by Redis.
Returnsboolean
Author |
public boolean | #delete(string$key) Deletes a memcache key Parameters- $key
string $key The key. Can supply multiple keys as arguments to delete them all.
Returnsboolean
Author |
public staticAlo\Cache\RedisWrapper | #redisWrapper(boolean$initDefaultServer=true) Instantiates the class Parameters- $initDefaultServer
boolean $initDefaultServer Whether to add a server on construct
ReturnsAuthor |
public mixed | #get(string$id) Gets a cached value Parameters- $id
string $id The value's key
Returnsmixed
Author |
public static boolean | #isAvailable( ) Checks if Redis is available Checks if Redis is available Returnsboolean
AuthorOverrides |
public array | #getAll( ) Return all cached keys and values Return all cached keys and values Returnsarray
Author |
public boolean | #purge( ) Clears all items from cache Clears all items from cache Returnsboolean
Author |
public boolean | #set(string$key,mixed$var,integer$expire=3600) Sets a cached key/value pair Sets a cached key/value pair Parameters- $key
string $key The key identifier- $var
mixed $var The value to set- $expire
integer $expire When to expire the set data. Defaults to 3600s.
Returnsboolean
Author |
__call()
,__get()
,__isset()
,__set()
,__unset()
,count()
,deleteWithPrefix()
,deleteWithSuffix()
,getIterator()
,offsetExists()
,offsetGet()
,offsetSet()
,offsetUnset()
Magic methods summary
Properties summary
$this