Stud.IP  6.0
RedisCache Class Reference
Inheritance diagram for RedisCache:
Cache

Public Member Functions

 __construct ($hostname, $port, string $auth='')
 
 getRedis ()
 
 expire ($arg)
 
 flush ()
 
 __call ($method, $args)
 
 getStats ()
 
 getItem (string $key)
 
 hasItem (string $key)
 
 save (CacheItemInterface $item)
 
- Public Member Functions inherited from Cache
 getStats ()
 
 expire ($arg)
 
 flush ()
 
 getItem (string $key)
 
 hasItem (string $key)
 
 read ($arg)
 
 write ($name, $content, $expires=self::DEFAULT_EXPIRATION)
 
 getExpiration (CacheItemInterface $item)
 
 getItems (array $keys=[])
 
 clear ()
 
 deleteItem ($key)
 
 deleteItems (array $keys)
 
 saveDeferred (CacheItemInterface $item)
 
 commit ()
 

Static Public Member Functions

static getDisplayName ()
 
static getConfig ()
 
- Static Public Member Functions inherited from Cache
static getDisplayName ()
 
static getConfig ()
 

Additional Inherited Members

- Data Fields inherited from Cache
const DEFAULT_EXPIRATION = 12 * 60 * 60
 
- Protected Attributes inherited from Cache
array $deferred_items = []
 

Constructor & Destructor Documentation

◆ __construct()

__construct (   $hostname,
  $port,
string  $auth = '' 
)

Construct a cache instance.

Parameters
string$hostnameHostname of redis server
int$portPort of redis server
string$authOptional auth token/password
Exceptions
RedisException

Member Function Documentation

◆ __call()

__call (   $method,
  $args 
)
Parameters
string$methodMethod to call
array$argsArguments to pass
Returns
false|mixed

◆ expire()

expire (   $arg)

Expire item from the cache.

Example:

expires foo

$cache->expire('foo');

Parameters
string$arga single key.

◆ flush()

flush ( )

Expire all items from the cache.

◆ getConfig()

static getConfig ( )
static

◆ getDisplayName()

static getDisplayName ( )
static
Returns
string A translateable display name for this cache class.

◆ getItem()

getItem ( string  $key)

◆ getRedis()

getRedis ( )

Returns the instance of the redis server connection.

Returns
Redis instance

◆ getStats()

getStats ( )

Return statistics.

::getStats()

Returns
array|array[]

◆ hasItem()

hasItem ( string  $key)

◆ save()

save ( CacheItemInterface  $item)

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