include/SugarCache/SugarCacheAbstract.php

Show: inherited
Table of Contents

\SugarCacheAbstract

Package: SugarCRM

Abstract cache class

Children
\SugarCacheZend
\SugarCacheAPC
\SugarCacheRedis
\SugarCacheMemory
\SugarCachesMash
\SugarCacheMemcache
\SugarCacheFile
\SugarCacheMemcached
\SugarCacheWincache
Api
 

Properties

Propertyprotected\records  $_cacheExternalHits= '0'

the number of hits made against the cache that are resolved using the external cache
Default value0Details
Type
\records
Propertyprotected\records  $_cacheLocalHits= '0'

the number of hits made against the cache that have been resolved without hitting the external cache
Default value0Details
Type
\records
Propertyprotected\records  $_cacheMisses= '0'

the number of get requests that aren't in the cache
Default value0Details
Type
\records
Propertyprotected\records  $_cacheRequests= '0'

the number of get requests made against the cache
Default value0Details
Type
\records
Propertyprotected\timeout  $_expireTimeout= '300'

in seconds used for cache item expiration
Default value300Details
Type
\timeout
Propertyprotected\prefix  $_keyPrefix= ''sugarcrm_''

to use for all cache key entries
Default value'sugarcrm_'Details
Type
\prefix
Propertyprotected\stores  $_localStore= 'array()'

locally any cached items so we don't have to hit the external cache as much
Default valuearray()Details
Type
\stores
Propertyprotected\indicates  $_priority= '899'

the priority level for using this cache; the lower number indicates the highest priority ( 1 would be the highest priority, but we should never ship a backend with this number so we don't bump out custom backends. ) Shipping backends use priorities in the range of 900-999.
Default value899Details
Type
\indicates
Propertypublic\set  $useLocalStore= 'true'

to false if you don't want to use the local store, true by default.
Default valuetrueDetails
Type
\set

Methods

methodpublic__construct( ) : void

Constructor

methodpublic__destruct( ) : void

Destructor

methodpublic__get( string $key ) : mixed

PHP's magic __get() method, used here for getting the current value from the cache.

Parameters
Name Type Description
$key string
Returns
Type Description
mixed
methodpublic__isset( string $key ) : mixed

PHP's magic __isset() method, used here for checking for a key in the cache.

Parameters
Name Type Description
$key string
Returns
Type Description
mixed
methodpublic__set( string $key,  $value ) : mixed

PHP's magic __set() method, used here for setting a value for a key in the cache.

Parameters
Name Type Description
$key string
$value
Returns
Type Description
mixed
methodpublic__toString( ) : string

Returns what backend is used for caching, uses normalized class name for lookup

Returns
Type Description
string
methodpublic__unset( string $key ) : mixed

PHP's magic __unset() method, used here for clearing a key in the cache.

Parameters
Name Type Description
$key string
Returns
Type Description
mixed
methodprotected_clearExternal( string $key ) : void
abstract

Hook for the child implementations of the individual backends to provide thier own logic for clearing a value out of thier cache

Parameters
Name Type Description
$key string
methodprotected_getExternal( string $key ) : mixed
abstract

Hook for the child implementations of the individual backends to provide thier own logic for getting a value from cache

Parameters
Name Type Description
$key string
Returns
Type Description
mixed $value, returns null if the key is not in the cache
methodprotected_resetExternal( ) : void
abstract

Hook for the child implementations of the individual backends to provide thier own logic for clearing thier cache out fully

methodprotected_setExternal( string $key, mixed $value ) : void
abstract

Hook for the child implementations of the individual backends to provide thier own logic for setting a value from cache

Parameters
Name Type Description
$key string
$value mixed
methodpublicflush( ) : void

Flush the contents of the cache

methodpublicgetCacheStats( ) : array

Returns the number of cache hits made

Returns
Type Description
array assocative array with each key have the value
methodpublicgetPriority( ) : int

Returns the priority level for this backend

Returns
Type Description
int
Details
See
\self::$_priority  
methodpublicreset( ) : void

Reset the cache for this request

methodpublicresetFull( ) : void

Reset the cache fully

methodpublicset(  $key,  $value,  $ttl = null ) : void

Set a value for a key in the cache, optionally specify a ttl. A ttl value of zero will indicate that a value should only be stored per the request.

Parameters
Name Type Description
$key
$value
$ttl
methodpublicuseBackend( ) : boolean

Hook for testing if the backend should be used or not. Typically we'll extend this for backend specific checks as well.

Returns
Type Description
boolean true if we can use the backend, false if not
Documentation was generated by DocBlox 0.18.1.