PHP Class Webiny\Component\Cache\Cache

The cache component is used to store different information into memory or file system for much faster access. The stored information can only be accessed for a limited time, after which it is invalidated. The Memory library is required by this class.
Inheritance: use trait Webiny\Component\StdLib\ComponentTrait
ファイルを表示 Open project: Webiny/Framework Class Usage Examples

Public Methods

Method Description
APC ( array $options = [] ) : CacheStorage Create a cache instance with APC as cache driver.
BlackHole ( ) : CacheStorage Create a cache instance with BlackHole cache driver.
Couchbase ( string $user, string $password, string $bucket, string $host = '127.0.0.1:8091', array $options = [] ) : CacheStorage Create a cache instance with Couchbase as cache driver.
Memcache ( string $host = '127.0.0.1', integer $port = 11211, array $options = [] ) : CacheStorage Create a cache instance with Memcache as cache driver.
Redis ( string $host = '127.0.0.1', integer $port = 6379, array $options = [] ) : CacheStorage Create a cache instance with Redis as cache driver.
SessionArray ( ) : CacheStorage Create a cache instance with SessionArray cache driver.

Method Details

APC() public static method

Create a cache instance with APC as cache driver.
public static APC ( array $options = [] ) : CacheStorage
$options array Cache options.
return CacheStorage

BlackHole() public static method

NOTE: BlackHole driver turns off the cache.
public static BlackHole ( ) : CacheStorage
return CacheStorage

Couchbase() public static method

Create a cache instance with Couchbase as cache driver.
public static Couchbase ( string $user, string $password, string $bucket, string $host = '127.0.0.1:8091', array $options = [] ) : CacheStorage
$user string Couchbase username.
$password string Couchbase password.
$bucket string Couchbase bucket.
$host string Couchbase host (with port number).
$options array Cache options.
return CacheStorage

Memcache() public static method

Create a cache instance with Memcache as cache driver.
public static Memcache ( string $host = '127.0.0.1', integer $port = 11211, array $options = [] ) : CacheStorage
$host string Host where the memcached is running.
$port integer Port where memcached is running.
$options array Cache options.
return CacheStorage

Redis() public static method

Create a cache instance with Redis as cache driver.
public static Redis ( string $host = '127.0.0.1', integer $port = 6379, array $options = [] ) : CacheStorage
$host string Host where the Redis server is running.
$port integer Port where Redis server is running.
$options array Cache options.
return CacheStorage

SessionArray() public static method

Create a cache instance with SessionArray cache driver.
public static SessionArray ( ) : CacheStorage
return CacheStorage