Cache
abstract class Cache implements FlushableInterface (View source)
Base class for the three caching layers present in Concrete5:
- ExpensiveCache
- ObjectCache
- RequestCache
Cache storage is performed using the Stash Library, see http://www.stashphp.com/
This class imports the various caching settings from Config class, sets up the Stash pools and provides a basic caching API for all of Concrete5.
Properties
Pool | $pool | ||
protected bool | $enabled | ||
protected DriverInterface | $driver |
Methods
No description
Initializes the cache by setting up the cache pool and enabling the cache.
Loads the composite driver from constants.
Function used to build a driver from a driverConfig array.
Deletes an item from the cache.
Checks if an item exists in the cache.
Removes all values from the cache.
Gets a value from the cache.
No description
Enables the cache.
Disables the cache.
Returns true if the cache is enabled, false if not.
Disables all cache levels.
Enables all cache levels.
Details
__construct()
No description
abstract protected
init()
Initializes the cache by setting up the cache pool and enabling the cache.
protected DriverInterface
loadConfig($level)
Loads the composite driver from constants.
private null|DriverInterface
buildDriver(array $driverConfig)
Function used to build a driver from a driverConfig array.
bool
delete(string $key)
Deletes an item from the cache.
bool
exists(string $key)
Checks if an item exists in the cache.
flush()
Removes all values from the cache.
ItemInterface
getItem(string $key)
Gets a value from the cache.
save(CacheItemInterface $item)
No description
enable()
Enables the cache.
disable()
Disables the cache.
bool
isEnabled()
Returns true if the cache is enabled, false if not.
static
disableAll()
Disables all cache levels.
static
enableAll()
Enables all cache levels.