[ Index ]

PHP Cross Reference of DokuWiki

title

Body

[close]

/inc/ -> cache.php (summary)

Generic class to handle caching

Author: Chris Smith
License: GPL 2 (http://www.gnu.org/licenses/gpl.html)
File Size: 289 lines (9 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 4 classes

cache:: (8 methods):
  cache()
  useCache()
  _useCache()
  _addDependencies()
  retrieveCache()
  storeCache()
  removeCache()
  _stats()

cache_parser:: (3 methods):
  cache_parser()
  _useCache()
  _addDependencies()

cache_renderer:: (3 methods):
  useCache()
  _useCache()
  _addDependencies()

cache_instructions:: (3 methods):
  cache_instructions()
  retrieveCache()
  storeCache()


Class: cache  - X-Ref

cache($key,$ext)   X-Ref
No 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: bool           true on success, false otherwise

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

Class: cache_parser  - X-Ref

cache_parser($id, $file, $mode)   X-Ref
No description

_useCache()   X-Ref
No description

_addDependencies()   X-Ref
No description

Class: cache_renderer  - X-Ref

useCache($depends=array()   X-Ref
No description

_useCache()   X-Ref
No description

_addDependencies()   X-Ref
No description

Class: cache_instructions  - X-Ref

cache_instructions($id, $file)   X-Ref
No description

retrieveCache($clean=true)   X-Ref
No description

storeCache($instructions)   X-Ref
No description



Generated: Thu Sep 9 03:01:01 2010 Cross-referenced by PHPXref 0.7
WikiForumIRCBugsGitXRefTranslate