Jet\Cache_Redis

A generic (abstract and not used by itself) backend cache using Redis

Method Importance
public static getRedisInstalled(
) : bool
A static method that checks whether the client class \Redis is available for dispatch and therefore can communicate with the Redis server and use this backend.
public __construct(
string $host='127.0.0.1',
int $port=6379
)
The constructor expects TCP connection parameters to Redis on input.
public connect(
) : bool
Connects to the Redis server. Returns false if it fails (or if Redis is simply not available). Does not throw exceptions.
public isActive(
) : bool
Indicates whether this backend is available. That is, whether it can be used and whether the connection to the Redis server succeeded. De facto calls the connect methods.
public set(
string $key,
mixed $data
) : void
Read the record.
public get(
string $key
) : mixed
Read the record. If it does not exist or there is a problem reading it, then it returns null.
public delete(
string $key
) : void
Delete a specific record.
public deleteItems(
string $prefix
) : void
Deletes records whose keys begin with the given prefix.
Previous chapter
Jet\Cache_Files
Next chapter
Jet\BaseObject