|
Moodle
2.2.1
http://www.collinsharper.com
|
Public Member Functions | |
| __construct ($area, $timeout=1800) | |
| __get ($key) | |
| __set ($key, $information) | |
| set ($key, $information) | |
| cached ($key) | |
| compare ($key, $value, $serialise=true) | |
| clear () | |
| volatile ($setting=true) | |
Static Public Member Functions | |
| static | destroy_volatile_caches () |
Data Fields | |
| const | CACHETIME = 0 |
| const | CACHEUSERID = 1 |
| const | CACHEVALUE = 2 |
Static Public Attributes | |
| static | $volatilecaches |
Protected Member Functions | |
| ensure_session_cache_initialised () | |
| garbage_collection () | |
Protected Attributes | |
| $creation | |
| $session | |
| $area | |
| $timeout | |
| $currentcontext | |
Definition at line 4113 of file navigationlib.php.
| __construct | ( | $ | area, |
| $ | timeout = 1800 |
||
| ) |
Contructor for the cache. Requires two arguments
| string | $area | The string to use to segregate this particular cache it can either be unique to start a fresh cache or if you want to share a cache then make it the string used in the original cache |
| int | $timeout | The number of seconds to time the information out after |
Definition at line 4142 of file navigationlib.php.

| __get | ( | $ | key | ) |
Magic Method to retrieve something by simply calling using = cache->key
| mixed | $key | The identifier for the information you want out again |
Definition at line 4176 of file navigationlib.php.
| __set | ( | $ | key, |
| $ | information | ||
| ) |
Magic method that simply uses set(); to store something in the cache
| string | int | $key | |
| mixed | $information |
Definition at line 4190 of file navigationlib.php.
| cached | ( | $ | key | ) |
Check the existence of the identifier in the cache
| string | int | $key |
Definition at line 4212 of file navigationlib.php.
| clear | ( | ) |
Wipes the entire cache, good to force regeneration
Definition at line 4244 of file navigationlib.php.
Compare something to it's equivilant in the cache
| string | $key | |
| mixed | $value | |
| bool | $serialise | Whether to serialise the value before comparison this should only be set to false if the value is already serialised |
Definition at line 4230 of file navigationlib.php.
| static destroy_volatile_caches | ( | ) | [static] |
Destroys all caches marked as volatile
This function is static and works in conjunction with the static volatilecaches property of navigation cache. Because this function is static it manually resets the cached areas back to an empty array.
Definition at line 4293 of file navigationlib.php.

| ensure_session_cache_initialised | ( | ) | [protected] |
Used to set up the cache within the SESSION.
This is called for each access and ensure that we don't put anything into the session before it is required.
Definition at line 4157 of file navigationlib.php.
| garbage_collection | ( | ) | [protected] |
Checks all cache entries and removes any that have expired, good ole cleanup
Definition at line 4252 of file navigationlib.php.

| set | ( | $ | key, |
| $ | information | ||
| ) |
Sets some information against the cache (session) for later retrieval
| string | int | $key | |
| mixed | $information |
Definition at line 4200 of file navigationlib.php.
Marks the cache as being volatile (likely to change)
Any caches marked as volatile will be destroyed at the on shutdown by navigation_node::destroy_volatile_caches() which is registered as a shutdown function if any caches are marked as volatile.
| bool | $setting | True to destroy the cache false not too |
Definition at line 4272 of file navigationlib.php.
$area [protected] |
Definition at line 4119 of file navigationlib.php.
$creation [protected] |
Definition at line 4115 of file navigationlib.php.
$currentcontext [protected] |
Definition at line 4123 of file navigationlib.php.
$session [protected] |
Definition at line 4117 of file navigationlib.php.
$timeout [protected] |
Definition at line 4121 of file navigationlib.php.
$volatilecaches [static] |
Definition at line 4131 of file navigationlib.php.
| const CACHETIME = 0 |
Definition at line 4125 of file navigationlib.php.
| const CACHEUSERID = 1 |
Definition at line 4127 of file navigationlib.php.
| const CACHEVALUE = 2 |
Definition at line 4129 of file navigationlib.php.