| [ Index ] |
|
Code source de DokuWiki 2006-11-06 |
[Code source] [Imprimer] [Statistiques]
Generic class to handle caching
| Author: | Chris Smith <chris@jalakai.co.uk> |
| License: | GPL 2 (http://www.gnu.org/licenses/gpl.html) |
| Poids: | 291 lignes (9 kb) |
| Inclus ou requis: | 1 fois |
| Référencé: | 0 fois |
| Nécessite: | 3 fichiers inc/pageutils.php inc/parserutils.php inc/io.php |
cache:: (8 méthodes):
cache()
useCache()
_useCache()
_addDependencies()
retrieveCache()
storeCache()
removeCache()
_stats()
cache_parser:: (3 méthodes):
cache_parser()
_useCache()
_addDependencies()
cache_renderer:: (3 méthodes):
useCache()
_useCache()
_addDependencies()
cache_instructions:: (3 méthodes):
cache_instructions()
retrieveCache()
storeCache()
| cache($key,$ext) X-Ref |
| Pas de description |
| useCache($depends=array() X-Ref |
| public method to determine whether the cache can be used to assist in cetralisation of event triggering and calculation of cache statistics, don't override this function override _useCache() param: array $depends array of cache dependencies, support dependecies: return: bool true if cache can be used, false otherwise |
| _useCache() X-Ref |
| private method containing cache use decision logic this function processes the following keys in the depends array purge - force a purge on any non empty value age - expire cache if older than age (seconds) files - expire cache if any file in this array was updated more recently than the cache can be overridden return: bool see useCache() |
| _addDependencies() X-Ref |
| add dependencies to the depends array this method should only add dependencies, it should not remove any existing dependencies and it should only overwrite a dependency when the new value is more stringent than the old |
| retrieveCache($clean=true) X-Ref |
| retrieve the cached data param: bool $clean true to clean line endings, false to leave line endings alone return: string cache contents |
| storeCache($data) X-Ref |
| cache $data param: string $data the data to be cached return: none |
| removeCache() X-Ref |
| remove any cached data associated with this cache instance |
| _stats($success) X-Ref |
| Record cache hits statistics. (Only when debugging allowed, to reduce overhead.) param: bool $success result of this cache use attempt return: bool pass-thru $success value |
Classe: cache_parser - X-Ref
| cache_parser($id, $file, $mode) X-Ref |
| Pas de description |
| _useCache() X-Ref |
| Pas de description |
| _addDependencies() X-Ref |
| Pas de description |
Classe: cache_renderer - X-Ref
Classe: cache_instructions - X-Ref
| cache_instructions($id, $file) X-Ref |
| Pas de description |
| retrieveCache() X-Ref |
| Pas de description |
| storeCache($instructions) X-Ref |
| Pas de description |
| Généré le : Tue Apr 3 20:47:31 2007 | par Balluche grâce à PHPXref 0.7 |