ICache
in
Interface 'ICache' for caching data and pages
Tags
Table of Contents
- clear() : void
- clear Method
- clearArea() : void
- clearArea
- delete() : void
- Delete a certain key if it exists
- exists() : bool
- exists method
- existsGlobal() : bool
- existsGlobal method
- get() : mixed
- Get the value of an stored element
- getCacheNames() : array<string|int, string>|bool
- Provides the list of cached file names
- getCachePath() : string
- Returns the path where it writes the cache files
- getGlobal() : mixed
- getGlobal Method
- getName() : string
- Given the name of a key determines the actual internal key to be used
- set() : void
- set Method
- setArea() : void
- setArea
- setGlobal() : void
- setGlobal Method
- setUid() : void
- Set the name of current area
- writeDebug() : void
- Writes a message to a cache-specific log file
Methods
clear()
clear Method
public
clear([ $needle = '*' ]) : void
Reset all cache
Parameters
- $needle : = '*'
-
Removes all keys containing the key name, if $needle is empty string than remove all
Tags
Return values
void —clearArea()
clearArea
public
clearArea(string $area_name) : void
remove all items of an area
Parameters
- $area_name : string
-
name of area
Tags
Return values
void —delete()
Delete a certain key if it exists
public
delete(string $name) : void
Parameters
- $name : string
-
name of the key to be deleted
Tags
Return values
void —exists()
exists method
public
exists(string $name[, string|null $area_name = null ]) : bool
Check if a key exists and is in the cache
Parameters
- $name : string
-
key of the item to be stored
- $area_name : string|null = null
-
name of area (null or not declared is the implicit "current area")
Tags
Return values
bool —true if the key $name exists
existsGlobal()
existsGlobal method
public
existsGlobal(string $name[, string|null $area_name = null ]) : bool
Check if a key exists for all user and is in the cache
Parameters
- $name : string
-
key of the item to be stored
- $area_name : string|null = null
-
name of area (null or not declared is the implicit "current area")
Tags
Return values
bool —true if the key $name exists
get()
Get the value of an stored element
public
get(string $name[, string|null $area_name = null ]) : mixed
Parameters
- $name : string
-
key of the item to be stored
- $area_name : string|null = null
-
name of area (null or not declared is the implicit "current area")
Tags
Return values
mixed —The cached element value: it can be a scalar value, an object or an array
getCacheNames()
Provides the list of cached file names
public
getCacheNames() : array<string|int, string>|bool
Tags
Return values
array<string|int, string>|bool —an array with a list of cached file name or false if there are none
getCachePath()
Returns the path where it writes the cache files
public
getCachePath() : string
Tags
Return values
string —the cache path of the application
getGlobal()
getGlobal Method
public
getGlobal(string $name[, string|null $area_name = null ]) : mixed
Get the value of an stored element valid for all users
Parameters
- $name : string
-
key of the item to be stored
- $area_name : string|null = null
-
name of area (null or not declared is the implicit "current area")
Tags
Return values
mixed —The cached element value: it can be a scalar value, an object or an array
getName()
Given the name of a key determines the actual internal key to be used
public
getName(string $name) : string
Parameters
- $name : string
-
key of the item to be stored
Tags
Return values
string —the internal key
set()
set Method
public
set(string $name, mixed $value[, string|null $area_name = null ]) : void
Sets the value of an element to be stored
Parameters
- $name : string
-
key of the item to be stored
- $value : mixed
-
value to be stored
- $area_name : string|null = null
-
name of area (null or not declared is the implicit "current area")
Tags
Return values
void —setArea()
setArea
public
setArea(string $area_name) : void
Set the name of current area
Parameters
- $area_name : string
-
name of area
Tags
Return values
void —setGlobal()
setGlobal Method
public
setGlobal(string $name, mixed $value[, string|null $area_name = null ]) : void
Sets the value of an item to be stored valid for all user
Parameters
- $name : string
-
key of the item to be stored
- $value : mixed
-
value to be stored
- $area_name : string|null = null
-
name of area (null or not declared is the implicit "current area")
Tags
Return values
void —setUid()
Set the name of current area
public
setUid(int $uid) : void
Parameters
- $uid : int
-
the id of current user in table _user (optional)
Tags
Return values
void —writeDebug()
Writes a message to a cache-specific log file
public
writeDebug(string $msg) : void
Parameters
- $msg : string
-
message to write on file log