DokuWiki

It's better when it's simple

User Tools

Site Tools


Sidebar

Translations of this page?:

Learn about DokuWiki

Advanced Use

Corporate Use

Our Community


Follow us on Facebook, Twitter and other social networks.

Our Privacy Policy

devel:event:parser_cache_use

PARSER_CACHE_USE

Description:
manipulate the cache validity
DefaultAction:
determine whether or not cached data should be used
Preventable:
yes
Added:
2006-09-16

Signalled by cache versions of parser wrapper functions inc/parserutils.php. Syntax plugins can use this event to provide their own assistance to DokuWiki's cache validity logic when the syntax extension adds other dependencies to the rendered page.

Passed Data and Result in event handler

The passed Doku_Event has the fields $data and $result.

$data is a cache object (cache_parser or extended on that object) – refer inc/cache.php.

For handling the event, key properties of the cache object are:

  • $page, if present the wiki page id, may not always be present, e.g. when called for locale XHTML files
  • $file, source file
  • $mode, renderer mode (e.g. 'xhtml') or 'i' for instructions
  • $depends, array of dependencies used to determine cache validity

In the BEFORE event handler the cache object can be modified. Some examples are: extending the $depends field, using more cachefiles for variants of the same source file (see also Indexmenu plugin) or preventing and replacing the default _useCache cache check.

In the AFTER event handler the $result field is set with the result of the _useCache() method. The AFTER event handler can modify this field.

Plugins handling this event

The following plugins are known to handle this event and their source code may be a good start for understanding and implementing a handler yourself.

See also

devel/event/parser_cache_use.txt · Last modified: 2018-05-29 17:23 by andi