Interface for cache classes
Definition at line 10 of file cache/abstract.class.php.
◆ afterInit()
Call just after the configuration initialisation
Definition at line 40 of file object.class.php.
◆ beforeInit()
Call just before the configuration initialisation
Definition at line 35 of file object.class.php.
◆ delete()
delete |
( |
array |
$prm = array() | ) |
|
|
abstract |
Delete cached value. You can define what you want. If you define nothing, all the cache will be deleted.
- Parameters
-
array | $prm | Parameter for the cached variable to deleted:
- string class: ClassName which created the cache (optionnal)
- string function: function which created the cache (optionnal)
- string type: Cache type, could be 'get' or 'start' (optionnal)
- string id: Cache id (optionnal)
- array tags: Tags for the id (optionnal)
|
- Returns
- int|bool Number of cache deleted or false
- See also
- get, start
◆ end()
Save the output with the setting passed by the last call from start
- Returns
- string The content cached
- See also
- start
◆ exists()
Indicate if a cache exists
- Parameters
-
array | $prm | Parameter for the cached variable:
- string type: Cache type, must be 'get' or 'start' (required)
- string id: Cache id (required)
- array tags: Optionnal tags for the id
- array request: Array for build the request ID (
|
- See also
- cache::idRequest)
- bool serialize: True if need to serialize the content (default: true)
- Returns
- bool True if it exists
- See also
- get, start
◆ get()
get |
( |
& |
$value, |
|
|
array |
$prm |
|
) |
| |
|
abstract |
Try to get a variable cached. If not found, information will be stored and used with the next call from save. The cache id is made with 5 elements :
- the $id passed to the function
- the get, post, session or cookie variable if set
- the class and function name where the cache is call
- the tags if set
- 'get' is added (to differenciate from output caching)
- Parameters
-
mixed | $value | the variable where the content must be placed |
array | $prm | Parameter for the cached variable:
- int ttl: Time to live, in minutes, 0 for eternal
- string id: Cache id (required)
- array tags: Optionnal tags for the id
- array request: Array for build the request ID (
|
- See also
- cache::idRequest)
- bool serialize: True if need to serialize the content
- Returns
- false|int Cache date if found and content in $value or false
- See also
- save
◆ getAttr()
Get an attribute
- Parameters
-
string | $name | Attribute name |
- Returns
- mixed|null The attribute or null if not set
Definition at line 48 of file object.class.php.
◆ getCfg()
Get the configuration object
- Returns
- config
Definition at line 67 of file object.class.php.
◆ isEnabled()
◆ save()
Save the variable with the setting passed by the last call from get.
- Returns
- bool True if success
- See also
- get
◆ setAttr()
setAttr |
( |
|
$name, |
|
|
|
$value |
|
) |
| |
|
inherited |
Set an attribute
- Parameters
-
string | $name | Attribute name |
mixed | $value | Attribute value |
Definition at line 58 of file object.class.php.
◆ setCfg()
◆ start()
Try to get an output cached. If not found, information will be stored and used with the next call from end. The cache id is made with 5 elements :
- the $id passed to the function
- the get, post, session or cookie variable if set
- the class and function name where the cache is call
- the tags if set
- 'cache' is added (to differenciate from variable caching)
- Parameters
-
array | $prm | Parameter for the cached variable:
- int ttl: Time to live, in minutes, 0 for eternal
- string id: Cache id (required)
- array tags: Optionnal tags for the id
- array request: Array for build the request ID (
|
- See also
- cache::idRequest)
- Returns
- bool True if cache found and content printed
- See also
- end
◆ $cfg
The documentation for this class was generated from the following file: