Account Suspended
Account Suspended
This Account has been suspended.
Contact your hosting provider for more information.
 All Data Structures Functions Variables Pages
Static Public Member Functions | Data Fields | Static Public Attributes | Static Protected Member Functions | Static Protected Attributes
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_MEMCACHE_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.

Parameters
string$identifier
Returns
string

Definition at line 68 of file ZurmoCache.php.

static getCacheIncrementValue (   $cacheType)
staticprotected

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 98 of file ZurmoCache.php.

static setCacheIncrementValue (   $cacheType,
  $value 
)
staticprotected
Parameters
string$cacheType
mixed$value

Definition at line 116 of file ZurmoCache.php.

static incrementCacheIncrementValue (   $cacheType)
staticprotected

Increment CacheIncrementValue

Parameters
string$cacheType

Definition at line 125 of file ZurmoCache.php.

static isIdentifierCacheIncrementValueName (   $identifier)
staticprotected

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

Parameters
$identifier
Returns
bool

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"

Parameters
string$prefix

Definition at line 156 of file ZurmoCache.php.

static getAdditionalStringForCachePrefix ( )
static

Get additional prefix

Returns
string

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 ( )
staticprotected

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:
Generated on Tue Sep 22 2020 07:11:09
Account Suspended
Account Suspended
This Account has been suspended.
Contact your hosting provider for more information.