| Methods |
public
|
__construct(Hm_Config $config, object $session): void
Parameters
| $config |
site config object
|
| $session |
session object
|
|
#
|
protected
|
check_session(Hm_Config $config): void
Parameters
| $config |
site config object
|
|
#
|
protected
|
check_redis(Hm_Config $config): boolean
Parameters
| $config |
site config object
|
|
#
|
protected
|
check_memcache(Hm_Config $config): boolean
Parameters
| $config |
site config object
|
|
#
|
protected
|
log(string $key, string $msg_type): void
Parameters
| $key |
key name
|
| $msg_type |
log message
|
|
#
|
public
|
set(string $key, mixed $val, integer $lifetime = 600, boolean $session = false): boolean
Parameters
| $key |
name of value to cache
|
| $val |
value to cache
|
| $lifetime |
how long to cache (if applicable for the backend)
|
| $session |
store in the session instead of the enabled cache
|
|
#
|
public
|
get(string $key, mixed $default = false, boolean $session = false): mixed
Parameters
| $key |
name of value to fetch
|
| $default |
value to return if not found
|
| $session |
fetch from the session instead of the enabled cache
|
|
#
|
public
|
del(string $key, boolean $session = false): boolean
Parameters
| $key |
name to delete
|
| $session |
fetch from the session instead of the enabled cache
|
|
#
|
protected
|
redis_get(string $key, mixed $default): mixed
Parameters
| $key |
name of value to fetch
|
| $default |
value to return if not found
|
|
#
|
protected
|
memcache_get(string $key, mixed $default): mixed
Parameters
| $key |
name of value to fetch
|
| $default |
value to return if not found
|
|
#
|
protected
|
session_set($key, $val, $lifetime)
|
#
|
protected
|
session_get(string $key, mixed $default): mixed
Parameters
| $key |
name of value to fetch
|
| $default |
value to return if not found
|
|
#
|
protected
|
session_del(string $key): boolean
|
#
|
protected
|
noop_get(string $key, mixed $default): mixed
Parameters
| $key |
name of value to fetch
|
| $default |
value to return if not found
|
|
#
|
protected
|
key_hash($key)
|
#
|
protected
|
generic_del(string $key): boolean
|
#
|
protected
|
generic_set(string $key, mixed $val, integer $lifetime): boolean
Parameters
| $key |
name of value to cache
|
| $val |
value to cache
|
| $lifetime |
how long to cache (if applicable for the backend)
|
|
#
|
public
|
reconnect(): boolean
Manually reconnect to cache service
Manually reconnect to cache service
|
#
|