class CacheManager implements Factory mixin Repository

Properties

protected Application $app

The application instance.

protected array $stores

The array of resolved cache stores.

protected array $customCreators

The registered custom driver creators.

Methods

void
__construct(Application $app)

Create a new Cache manager instance.

mixed
store(string|null $name = null)

Get a cache store instance by name.

mixed
driver(string $driver = null)

Get a cache driver instance.

get(string $name)

Attempt to get the store from the local cache.

resolve(string $name)

Resolve the given store.

mixed
callCustomCreator(array $config)

Call a custom driver creator.

createApcDriver(array $config)

Create an instance of the APC cache driver.

createArrayDriver()

Create an instance of the array cache driver.

createFileDriver(array $config)

Create an instance of the file cache driver.

createMemcachedDriver(array $config)

Create an instance of the Memcached cache driver.

createNullDriver()

Create an instance of the Null cache driver.

createRedisDriver(array $config)

Create an instance of the Redis cache driver.

createDatabaseDriver(array $config)

Create an instance of the database cache driver.

repository(Store $store)

Create a new cache repository with the given implementation.

string
getPrefix(array $config)

Get the cache prefix.

array
getConfig(string $name)

Get the cache connection configuration.

string
getDefaultDriver()

Get the default cache driver name.

void
setDefaultDriver(string $name)

Set the default cache driver name.

$this
extend(string $driver, Closure $callback)

Register a custom driver creator Closure.

mixed
__call(string $method, array $parameters)

Dynamically call the default driver instance.

Details

at line 44
void __construct(Application $app)

Create a new Cache manager instance.

Parameters

Application $app

Return Value

void

at line 55
mixed store(string|null $name = null)

Get a cache store instance by name.

Parameters

string|null $name

Return Value

mixed

at line 68
mixed driver(string $driver = null)

Get a cache driver instance.

Parameters

string $driver

Return Value

mixed

at line 79
protected Repository get(string $name)

Attempt to get the store from the local cache.

Parameters

string $name

Return Value

Repository

at line 92
protected Repository resolve(string $name)

Resolve the given store.

Parameters

string $name

Return Value

Repository

Exceptions

InvalidArgumentException

at line 119
protected mixed callCustomCreator(array $config)

Call a custom driver creator.

Parameters

array $config

Return Value

mixed

at line 130
protected ApcStore createApcDriver(array $config)

Create an instance of the APC cache driver.

Parameters

array $config

Return Value

ApcStore

at line 142
protected ArrayStore createArrayDriver()

Create an instance of the array cache driver.

Return Value

ArrayStore

at line 153
protected FileStore createFileDriver(array $config)

Create an instance of the file cache driver.

Parameters

array $config

Return Value

FileStore

at line 164
protected MemcachedStore createMemcachedDriver(array $config)

Create an instance of the Memcached cache driver.

Parameters

array $config

Return Value

MemcachedStore

at line 183
protected NullStore createNullDriver()

Create an instance of the Null cache driver.

Return Value

NullStore

at line 194
protected RedisStore createRedisDriver(array $config)

Create an instance of the Redis cache driver.

Parameters

array $config

Return Value

RedisStore

at line 209
protected DatabaseStore createDatabaseDriver(array $config)

Create an instance of the database cache driver.

Parameters

array $config

Return Value

DatabaseStore

at line 226
Repository repository(Store $store)

Create a new cache repository with the given implementation.

Parameters

Store $store

Return Value

Repository

at line 245
protected string getPrefix(array $config)

Get the cache prefix.

Parameters

array $config

Return Value

string

at line 256
protected array getConfig(string $name)

Get the cache connection configuration.

Parameters

string $name

Return Value

array

at line 266
string getDefaultDriver()

Get the default cache driver name.

Return Value

string

at line 277
void setDefaultDriver(string $name)

Set the default cache driver name.

Parameters

string $name

Return Value

void

at line 289
$this extend(string $driver, Closure $callback)

Register a custom driver creator Closure.

Parameters

string $driver
Closure $callback

Return Value

$this

at line 303
mixed __call(string $method, array $parameters)

Dynamically call the default driver instance.

Parameters

string $method
array $parameters

Return Value

mixed