ZurmoCache Class Reference

Inheritance diagram for ZurmoCache:
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_MEMCACHE_CACHING = true
const ALLOW_DB_CACHING = true

Static Protected Member Functions

static getCacheIncrementValue ($cacheType)
static setCacheIncrementValue ($cacheType, $value)
static incrementCacheIncrementValue ($cacheType)
static isIdentifierCacheIncrementValueName ($identifier)

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.

Parameters:
string $identifier
Returns:
string

Definition at line 62 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.

Parameters:
string $cacheType
Returns:
int|mixed

Definition at line 92 of file ZurmoCache.php.

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

Definition at line 110 of file ZurmoCache.php.

static incrementCacheIncrementValue ( cacheType  )  [static, protected]

Increment CacheIncrementValue

Parameters:
string $cacheType

Definition at line 119 of file ZurmoCache.php.

static isIdentifierCacheIncrementValueName ( identifier  )  [static, protected]

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

Parameters:
$identifier 
Returns:
bool

Definition at line 131 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"

Parameters:
string $prefix

Definition at line 150 of file ZurmoCache.php.

static getAdditionalStringForCachePrefix (  )  [static]

Get additional prefix

Returns:
string

Definition at line 159 of file ZurmoCache.php.

static supportsAndAllowsMemcache (  )  [static]

Check if Memcache caching is allowed and supported

Definition at line 167 of file ZurmoCache.php.

static supportsAndAllowsPhpCaching (  )  [static]

Check if PHP caching is allowed and supported

Definition at line 175 of file ZurmoCache.php.

static supportsAndAllowsDatabaseCaching (  )  [static]

Check if DB caching is allowed and supported

Definition at line 183 of file ZurmoCache.php.


The documentation for this class was generated from the following file:
 All Data Structures Functions Variables
Generated on Wed Jul 26 07:10:31 2017