Cache using files
Definition at line 10 of file cache/file.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() | ) |
|
Delete cached value. You cand 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 callFrom: Representing CLASS-FUNCTION name of the original calling cache
- 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
Definition at line 181 of file cache/file.class.php.
◆ end()
Save the output with the setting passed by the last call from start, and show it
- Returns
- bool True if store cache success
- See also
- start
Definition at line 152 of file cache/file.class.php.
◆ 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
Definition at line 218 of file cache/file.class.php.
◆ file()
Return the cache file path The cache id is made with 5 kinds :
- 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' or 'get' is added (to differenciate output and variable caching)
- Parameters
-
array | $prm | Parameter for the cached file:
- string callFrom: where the cached isrequested (format: className-Function) (required)
- 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)
- Returns
- string The cache file path
Definition at line 240 of file cache/file.class.php.
◆ get()
get |
( |
& |
$value, |
|
|
array |
$prm |
|
) |
| |
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 kinds :
- 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 (default: 60)
- 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
- false|int Cache date if found and content in $value or false
- See also
- save
Definition at line 53 of file cache/file.class.php.
◆ 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 a variable with the setting passed by the last call from get
- Parameters
-
mixed | $value | The variable to cache |
- Returns
- bool True if success
- See also
- get
Definition at line 87 of file cache/file.class.php.
◆ 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 kinds :
- 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 (default: 60)
- 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
Definition at line 116 of file cache/file.class.php.
◆ $cfg
◆ $obSave
◆ $prmOut
◆ $prmVar
The documentation for this class was generated from the following file: