CacheManager
in package
implements
Factory
Tags
Interfaces, Classes and Traits
Table of Contents
- $app : Application
- The application instance.
- $customCreators : array<string|int, mixed>
- The registered custom driver creators.
- $stores : array<string|int, mixed>
- The array of resolved cache stores.
- __call() : mixed
- Dynamically call the default driver instance.
- __construct() : void
- Create a new Cache manager instance.
- driver() : mixed
- Get a cache driver instance.
- extend() : $this
- Register a custom driver creator Closure.
- getDefaultDriver() : string
- Get the default cache driver name.
- repository() : Repository
- Create a new cache repository with the given implementation.
- setDefaultDriver() : void
- Set the default cache driver name.
- store() : Repository
- Get a cache store instance by name.
- callCustomCreator() : mixed
- Call a custom driver creator.
- createApcDriver() : ApcStore
- Create an instance of the APC cache driver.
- createArrayDriver() : ArrayStore
- Create an instance of the array cache driver.
- createDatabaseDriver() : DatabaseStore
- Create an instance of the database cache driver.
- createFileDriver() : FileStore
- Create an instance of the file cache driver.
- createMemcachedDriver() : MemcachedStore
- Create an instance of the Memcached cache driver.
- createNullDriver() : NullStore
- Create an instance of the Null cache driver.
- createRedisDriver() : RedisStore
- Create an instance of the Redis cache driver.
- get() : Repository
- Attempt to get the store from the local cache.
- getConfig() : array<string|int, mixed>
- Get the cache connection configuration.
- getPrefix() : string
- Get the cache prefix.
- resolve() : Repository
- Resolve the given store.
Properties
$app
The application instance.
protected
Application
$app
$customCreators
The registered custom driver creators.
protected
array<string|int, mixed>
$customCreators
= []
$stores
The array of resolved cache stores.
protected
array<string|int, mixed>
$stores
= []
Methods
__call()
Dynamically call the default driver instance.
public
__call(string $method, array<string|int, mixed> $parameters) : mixed
Parameters
- $method : string
- $parameters : array<string|int, mixed>
Return values
mixed —__construct()
Create a new Cache manager instance.
public
__construct(Application $app) : void
Parameters
- $app : Application
Return values
void —driver()
Get a cache driver instance.
public
driver([string $driver = null ]) : mixed
Parameters
- $driver : string = null
Return values
mixed —extend()
Register a custom driver creator Closure.
public
extend(string $driver, Closure $callback) : $this
Parameters
- $driver : string
- $callback : Closure
Return values
$this —getDefaultDriver()
Get the default cache driver name.
public
getDefaultDriver() : string
Return values
string —repository()
Create a new cache repository with the given implementation.
public
repository(Store $store) : Repository
Parameters
- $store : Store
Return values
Repository —setDefaultDriver()
Set the default cache driver name.
public
setDefaultDriver(string $name) : void
Parameters
- $name : string
Return values
void —store()
Get a cache store instance by name.
public
store([string|null $name = null ]) : Repository
Parameters
- $name : string|null = null
Return values
Repository —callCustomCreator()
Call a custom driver creator.
protected
callCustomCreator(array<string|int, mixed> $config) : mixed
Parameters
- $config : array<string|int, mixed>
Return values
mixed —createApcDriver()
Create an instance of the APC cache driver.
protected
createApcDriver(array<string|int, mixed> $config) : ApcStore
Parameters
- $config : array<string|int, mixed>
Return values
ApcStore —createArrayDriver()
Create an instance of the array cache driver.
protected
createArrayDriver() : ArrayStore
Return values
ArrayStore —createDatabaseDriver()
Create an instance of the database cache driver.
protected
createDatabaseDriver(array<string|int, mixed> $config) : DatabaseStore
Parameters
- $config : array<string|int, mixed>
Return values
DatabaseStore —createFileDriver()
Create an instance of the file cache driver.
protected
createFileDriver(array<string|int, mixed> $config) : FileStore
Parameters
- $config : array<string|int, mixed>
Return values
FileStore —createMemcachedDriver()
Create an instance of the Memcached cache driver.
protected
createMemcachedDriver(array<string|int, mixed> $config) : MemcachedStore
Parameters
- $config : array<string|int, mixed>
Return values
MemcachedStore —createNullDriver()
Create an instance of the Null cache driver.
protected
createNullDriver() : NullStore
Return values
NullStore —createRedisDriver()
Create an instance of the Redis cache driver.
protected
createRedisDriver(array<string|int, mixed> $config) : RedisStore
Parameters
- $config : array<string|int, mixed>
Return values
RedisStore —get()
Attempt to get the store from the local cache.
protected
get(string $name) : Repository
Parameters
- $name : string
Return values
Repository —getConfig()
Get the cache connection configuration.
protected
getConfig(string $name) : array<string|int, mixed>
Parameters
- $name : string
Return values
array<string|int, mixed> —getPrefix()
Get the cache prefix.
protected
getPrefix(array<string|int, mixed> $config) : string
Parameters
- $config : array<string|int, mixed>
Return values
string —resolve()
Resolve the given store.
protected
resolve(string $name) : Repository
Parameters
- $name : string