include/SugarCache/SugarCacheFile.php

Show: inherited
Table of Contents

\SugarCacheFile

Package:

Abstract cache class

Parent(s)
\SugarCacheAbstract

Properties

Propertyprotectedbool  $_cacheChanged= 'false'

true if the cache has changed and needs written to disk
Default valuefalseDetails
Type
bool
Propertyprotected\records  $_cacheExternalHits= '0'
inherited

the number of hits made against the cache that are resolved using the external cacheInherited from: \SugarCacheAbstract::$$_cacheExternalHits
Default value0Details
Type
\records
Inherited_from
\SugarCacheAbstract::$$_cacheExternalHits  
Propertyprotected\path  $_cacheFileName= ''externalCache.php''

and file which will store the cache used for this backend
Default value'externalCache.php'Details
Type
\path
Propertyprotected\records  $_cacheLocalHits= '0'
inherited

the number of hits made against the cache that have been resolved without hitting the external cacheInherited from: \SugarCacheAbstract::$$_cacheLocalHits
Default value0Details
Type
\records
Inherited_from
\SugarCacheAbstract::$$_cacheLocalHits  
Propertyprotected\records  $_cacheMisses= '0'
inherited

the number of get requests that aren't in the cacheInherited from: \SugarCacheAbstract::$$_cacheMisses
Default value0Details
Type
\records
Inherited_from
\SugarCacheAbstract::$$_cacheMisses  
Propertyprotected\records  $_cacheRequests= '0'
inherited

the number of get requests made against the cacheInherited from: \SugarCacheAbstract::$$_cacheRequests
Default value0Details
Type
\records
Inherited_from
\SugarCacheAbstract::$$_cacheRequests  
Propertyprotected\timeout  $_expireTimeout= '300'
inherited

in seconds used for cache item expirationInherited from: \SugarCacheAbstract::$$_expireTimeout
Default value300Details
Type
\timeout
Inherited_from
\SugarCacheAbstract::$$_expireTimeout  
Propertyprotected\prefix  $_keyPrefix= ''sugarcrm_''
inherited

to use for all cache key entriesInherited from: \SugarCacheAbstract::$$_keyPrefix
Default value'sugarcrm_'Details
Type
\prefix
Inherited_from
\SugarCacheAbstract::$$_keyPrefix  
Propertyprotected\stores  $_localStore= 'array()'
inherited

locally any cached items so we don't have to hit the external cache as muchInherited from: \SugarCacheAbstract::$$_localStore
Default valuearray()Details
Type
\stores
Inherited_from
\SugarCacheAbstract::$$_localStore  
Propertyprotected\indicates  $_priority= '990'

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 value990Details
Type
\indicates
See
\SugarCacheAbstract::$_priority  
Propertypublic\set  $useLocalStore= 'true'
inherited

to false if you don't want to use the local store, true by default.Inherited from: \SugarCacheAbstract::$$useLocalStore
Default valuetrueDetails
Type
\set
Inherited_from
\SugarCacheAbstract::$$useLocalStore  

Methods

methodpublic__construct( ) : void

Constructor

methodpublic__destruct( ) : void

Destructor

methodpublic__get( string $key ) : mixed
inherited

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

Inherited from: \SugarCacheAbstract::__get()
Parameters
Name Type Description
$key string
Returns
Type Description
mixed
methodpublic__isset( string $key ) : mixed
inherited

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

Inherited from: \SugarCacheAbstract::__isset()
Parameters
Name Type Description
$key string
Returns
Type Description
mixed
methodpublic__set( string $key,  $value ) : mixed
inherited

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

Inherited from: \SugarCacheAbstract::__set()
Parameters
Name Type Description
$key string
$value
Returns
Type Description
mixed
methodpublic__toString( ) : string
inherited

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

Inherited from: \SugarCacheAbstract::__toString()
Returns
Type Description
string
methodpublic__unset( string $key ) : mixed
inherited

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

Inherited from: \SugarCacheAbstract::__unset()
Parameters
Name Type Description
$key string
Returns
Type Description
mixed
methodpublic__wakeup( ) : void

This is needed to prevent unserialize vulnerability

methodprotected_clearExternal( string $key ) : void

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
Details
See
\SugarCacheAbstract::_clearExternal()  
methodprotected_getExternal( string $key ) : mixed

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
Details
See
\SugarCacheAbstract::_getExternal()  
methodprotected_resetExternal( ) : void

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

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
Details
See
\SugarCacheAbstract::_setExternal()  
methodpublicflush( ) : void
inherited

Flush the contents of the cache

Inherited from: \SugarCacheAbstract::flush()
methodpublicgetCacheStats( ) : array
inherited

Returns the number of cache hits made

Inherited from: \SugarCacheAbstract::getCacheStats()
Returns
Type Description
array assocative array with each key have the value
methodpublicgetPriority( ) : int
inherited

Returns the priority level for this backend

Inherited from: \SugarCacheAbstract::getPriority()
Returns
Type Description
int
Details
See
\self::$_priority  
methodpublicreset( ) : void
inherited

Reset the cache for this request

Inherited from: \SugarCacheAbstract::reset()
methodpublicresetFull( ) : void
inherited

Reset the cache fully

Inherited from: \SugarCacheAbstract::resetFull()
methodpublicset(  $key,  $value,  $ttl = null ) : void
inherited

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.

Inherited from: \SugarCacheAbstract::set()
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
Details
See
\SugarCacheAbstract::useBackend()  
Documentation was generated by DocBlox 0.18.1.