Cache
in package
Cache class.
Tags
Table of Contents
Properties
- $driver : string
- $Cache : CacheInterface
- $Container : Container
- $driver : string
Methods
- __construct() : mixed
- Class constructor.
- __get() : mixed
- Magic get.
- getCacheObject() : CacheInterface
- Get cache object to continue using simple cache.
Properties
$driver read-only
public
string
$driver
Contain current cache driver.
$Cache
protected
CacheInterface
$Cache
The cache object.
$Container
protected
Container
$Container
$driver
protected
string
$driver
Contain current cache driver.
Methods
__construct()
Class constructor.
public
__construct(Container $Container[, array<string|int, mixed> $options = [] ]) : mixed
Example usage:
$Cache = (new \Rdb\Modules\RdbAdmin\Libraries\Cache( $this->Container, [ 'cachePath' => STORAGE_PATH . '/cache/Modules/YOUR_MODULE/YOUR_PATH', ] ))->getCacheObject();
Parameters
- $Container : Container
-
The DI container.
- $options : array<string|int, mixed> = []
-
Additional options or configuration in associative array with keys:
cachePath
(string) The file system cache path or incase of APCu, Memcache, Memcached it will be prefix for the cache key.
umask
(int) The file system cacheumask
option.
__get()
Magic get.
public
__get(string $name) : mixed
Parameters
- $name : string
-
Property name.
Return values
mixed —Return its value depend on property.
getCacheObject()
Get cache object to continue using simple cache.
public
getCacheObject() : CacheInterface