CRM_Core_BAO_Cache_Psr16
class CRM_Core_BAO_Cache_Psr16
Class CRM_Core_BAO_Cache_Psr16
This optional adapter to help phase-out CRM_Core_BAO_Cache.
In effect, it changes the default behavior of legacy cache-consumers (CRM_Core_BAO_Cache) so that they store in the best-available tier (Reds/Memcache or SQL or array) rather than being hard-coded to SQL.
It basically just calls "CRM_Utils_Cache::create()" for each $group and maps the getItem/setItem to get()/set().
Constants
TTL |
Original BAO behavior did not do expiration. PSR-16 providers have diverse defaults. To provide some consistency, we'll pick a long(ish) TTL for everything that goes through the adapter. |
Methods
No description
Retrieve an item from the DB cache.
Retrieve all items in a group.
Store an item in the DB cache.
Delete all the cache elements that belong to a group OR delete the entire cache if group is not specified.
Cleanup any caches that we've mapped.
Get a list of known cache-groups
Details
at line 54
static protected CRM_Utils_Cache_Interface
getGroup(string $group)
at line 89
static object
getItem(string $group, string $path, int $componentID = NULL)
Retrieve an item from the DB cache.
at line 111
static
getItems(string $group, int $componentID = NULL)
Retrieve all items in a group.
at line 130
static
setItem(object $data, string $group, string $path, int $componentID = NULL)
Store an item in the DB cache.
at line 152
static
deleteGroup(string $group = NULL, string $path = NULL)
Delete all the cache elements that belong to a group OR delete the entire cache if group is not specified.
at line 170
static
clearDBCache()
Cleanup any caches that we've mapped.
Traditional SQL-backed caches are cleared as a matter of course during a system flush (by way of "TRUNCATE TABLE civicrm_cache"). This provides a spot where the adapter can
at line 182
static array
getLegacyGroups()
Get a list of known cache-groups