Global caching data provided from whatever sources
| package |
jelix |
|---|---|
| subpackage |
cache |
| since | 1.2 |
_checkKey(string $key)
no space.
db, redis: any characters memcache: no space, no control char (\t \n \00) file: any (key is hashed with md5)
| Throws |
|
|---|
stringkey used for storing data
_doFunctionCall(mixed $fn, array $fnargs) : mixed
| Throws |
|
|---|
mixedmethod/function name
arrayarguments used by the method/function
mixed$data method/function result
_functionToString(mixed $fn) : string
mixedmethod/function name
string$fnname method/function name
_loadDriver( $profile)
add(string $key, mixed $value, mixed $ttl = null, string $profile = '') : boolean
| Throws |
|
|---|
stringkey used for storing data in the cache
mixeddata to add
mixeddata time expiration. 0 means no expire, use a timestamp UNIX or a delay in secondes which mustn't exceed 30 days i.e 2592000s or a string in date format US
stringthe cache profile name to use. if empty, use the default profile
booleanfalse if failure
call(mixed $fn, array $fnargs = array(), mixed $ttl = null, string $profile = '') : mixed
| Throws |
|
|---|
mixedmethod/function name ($functionName or array($object, $methodName) or array($className, $staticMethodName))
arrayarguments used by the method/function
mixeddata time expiration. 0 means no expire, use a timestamp UNIX or a delay in secondes which mustn't exceed 30 days i.e 2592000s or a string in date format US
stringthe cache profile name to use. if empty, use the default profile
mixedmethod/function result
decrement(string $key, mixed $decvalue = 1, string $profile = '') : boolean
stringkey used for storing data in the cache
mixedvalue used
stringthe cache profile name to use. if empty, use the default profile
booleanfalse if failure
delete(string $key, string $profile = '') : boolean
stringkey used for storing data in the cache
stringthe cache profil name to use. if empty, use the default profile
booleanfalse if failure
flush(string $profile = '') : boolean
stringthe cache profile name to use. if empty, use the default profile
booleanfalse if failure
garbage(string $profile = '') : boolean
stringthe cache profile name to use. if empty, use the default profile
booleanfalse if failure
get(mixed $key, string $profile = '') : mixed
mixedkey or array of keys used for storing data in the cache
stringthe cache profile name to use. if empty, use the default profile
mixed$data data stored
getDriver(string $profile) : \jICacheDriver
get an instance of driver according the settings in the profile file
stringprofile name
\jICacheDriver
increment(string $key, mixed $incvalue = 1, string $profile = '') : boolean
stringkey used for storing data in the cache
mixedvalue used
stringthe cache profile name to use. if empty, use the default profile
booleanfalse if failure
normalizeKey( $key)
replace(string $key, mixed $value, mixed $ttl = null, string $profile = '') : boolean
| Throws |
|
|---|
stringkey used for storing data in the cache
mixeddata to replace
mixeddata time expiration. 0 means no expire, use a timestamp UNIX or a delay in secondes which mustn't exceed 30 days i.e 2592000s or a string in date format US
stringthe cache profile name to use. if empty, use the default profile
booleanfalse if failure
set(string $key, mixed $value, mixed $ttl = null, string $profile = '') : boolean
| Throws |
|
|---|
stringkey used for storing data
mixeddata to store
mixeddata time expiration. 0 means no expire, use a timestamp UNIX or a delay in secondes which mustn't exceed 30 days i.e 2592000s or a string in date format US
stringthe cache profile name to use. if empty, use the default profile
booleanfalse if failure