ZurmoCache Class Reference

Inheritance diagram for ZurmoCache:
AllPermissionsOptimizationCache GeneralCache PermissionsCache RedBeanModelsCache BeanModelCache PoliciesCache RightsCache

Static Public Member Functions

static getCachePrefix ($identifier)
static setAdditionalStringForCachePrefix ($prefix= '')
static getAdditionalStringForCachePrefix ()
static supportsAndAllowsMemcache ()
static supportsAndAllowsPhpCaching ()
static supportsAndAllowsDatabaseCaching ()

Data Fields

const ALLOW_PHP_CACHING = true
const ALLOW_DB_CACHING = true
const CACHE_VALUE_KEY = 'value'
const CACHE_CHECKSUM_KEY = 'checksum'

Static Public Attributes

static $cacheType = 'Z:'

Static Protected Member Functions

static getCacheIncrementValue ($cacheType)
static setCacheIncrementValue ($cacheType, $value)
static incrementCacheIncrementValue ($cacheType)
static isIdentifierCacheIncrementValueName ($identifier)
static clearMemcacheCache ()
static cacheValueAndChecksum ($key, $value)
static getCachedValueAndValidateChecksum ($key)

Static Protected Attributes

static $cacheIncrementValueVariableName = 'CacheIncrementValue'
static $additionalStringForCachePrefix = ''

Detailed Description

This is a base caching class, that contains code related to caching. Memcache doesn't have option to remove data related just to one application or host, and that is why we had to implement methods that would simulate this feature. Please check this link for more details about this idea: http://stackoverflow.com/questions/1202174/memcache-invalidate-entries-according-to-a-pattern

Definition at line 44 of file ZurmoCache.php.

Member Function Documentation

static getCachePrefix ( identifier  )  [static]

Get cache prefix, based on ZURMO_TOKEN, $cacheIncrementValue and cache type. In case that we want to get just cache increment value, prefix will not contain increment value.

string $identifier

Definition at line 68 of file ZurmoCache.php.

static getCacheIncrementValue ( cacheType  )  [static, protected]

Get curent increment value, based on $cacheType. Cache types can be: "G:" - for GlobalCache "M:" - for RedBeanModelsCache "P:" - for PermissionCache We need to distinct those cache types, because we should be able to forget only GlobalCache(increment cache increment value), while other two cache types will contain valid data.

string $cacheType

Definition at line 98 of file ZurmoCache.php.

static setCacheIncrementValue ( cacheType,
) [static, protected]
string $cacheType
mixed $value

Definition at line 116 of file ZurmoCache.php.

static incrementCacheIncrementValue ( cacheType  )  [static, protected]

Increment CacheIncrementValue

string $cacheType

Definition at line 125 of file ZurmoCache.php.

static isIdentifierCacheIncrementValueName ( identifier  )  [static, protected]

Check if identifier is same as static::$cacheIncrementValueVariableName.


Definition at line 137 of file ZurmoCache.php.

static setAdditionalStringForCachePrefix ( prefix = ''  )  [static]

Set additional prefix This is used to distinct memcache value for tests and for website, because test application and website application use same ZURMO_TOKEN. This prefix is empty for web application, and for tests it is set to "Test"

string $prefix

Definition at line 156 of file ZurmoCache.php.

static getAdditionalStringForCachePrefix (  )  [static]

Get additional prefix


Definition at line 165 of file ZurmoCache.php.

static supportsAndAllowsMemcache (  )  [static]

Check if Memcache caching is allowed and supported

Definition at line 173 of file ZurmoCache.php.

static supportsAndAllowsPhpCaching (  )  [static]

Check if PHP caching is allowed and supported

Definition at line 181 of file ZurmoCache.php.

static supportsAndAllowsDatabaseCaching (  )  [static]

Check if DB caching is allowed and supported

Definition at line 189 of file ZurmoCache.php.

static clearMemcacheCache (  )  [static, protected]

Clear memcache cache if we support and allow memcache

Definition at line 197 of file ZurmoCache.php.

The documentation for this class was generated from the following file:
 All Data Structures Functions Variables
Generated on Thu Jul 18 07:11:12 2019