summaryrefslogtreecommitdiff
path: root/lib/plugins
diff options
context:
space:
mode:
authorchris <chris@jalakai.co.uk>2006-09-11 04:14:18 +0200
committerchris <chris@jalakai.co.uk>2006-09-11 04:14:18 +0200
commit4b5f4f4ed319790fe7f0729560616b55c4e64715 (patch)
tree6c80db4c05de0fa757005ca9298a106b0521da34 /lib/plugins
parentc6ea345da89cfdb4479d7e472e4dcfab8547ff2c (diff)
downloadrpg-4b5f4f4ed319790fe7f0729560616b55c4e64715.tar.gz
rpg-4b5f4f4ed319790fe7f0729560616b55c4e64715.tar.bz2
parser caching update
This patch primarily updates p_cached_xhtml() and p_cached_instructions() to allow their caching logic to be surrounded by an event trigger. p_cached_xhtml() has been rewritten as the more general p_cached_output() to support other render output formats besides 'xhtml'. All calls to p_cached_xhtml() have been changed to refer to the new function. New event: name: PARSER_CACHE_USE data: cache object (see below) action: determine if cache file can be used preventable: yes result: bool, true to use cache file, false otherwise Cache operations have been generalised in a new class, cache, extended to cache_parser, cache_renderer & cache_instructions. Details can be found in inc/cache.php For handling of above event, key properties 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 Other changes: - cache class counts cache hits against attempts, results are stored in {cache_dir}/cache_stats.txt - adds metadata dependency to renderer page cache - replaces purgefile dependency for renderer cache with metadata 'relation references' (internal link) dependency for wiki pages only darcs-hash:20060911021418-9b6ab-19601ed194b8c8e45236ab72c3e23d78bf777e6c.gz
Diffstat (limited to 'lib/plugins')
-rw-r--r--lib/plugins/base.php2
-rw-r--r--lib/plugins/plugin/admin.php2
-rw-r--r--lib/plugins/syntax.php2
3 files changed, 3 insertions, 3 deletions
diff --git a/lib/plugins/base.php b/lib/plugins/base.php
index f53c75444..a895166e6 100644
--- a/lib/plugins/base.php
+++ b/lib/plugins/base.php
@@ -69,7 +69,7 @@ class DokuWiki_Plugin {
* @return string parsed contents of the wiki page in xhtml format
*/
function locale_xhtml($id) {
- return p_cached_xhtml($this->localFN($id));
+ return p_cached_output($this->localFN($id));
}
/**
diff --git a/lib/plugins/plugin/admin.php b/lib/plugins/plugin/admin.php
index 2c47de665..03efae3bf 100644
--- a/lib/plugins/plugin/admin.php
+++ b/lib/plugins/plugin/admin.php
@@ -275,7 +275,7 @@ class ap_manage {
global $lang;
// check the url
- $matches = array();
+ $matches = array();
if (!preg_match("/[^\/]*$/", $url, $matches) || !$matches[0]) {
$this->manager->error = $this->lang['error_badurl']."\n";
return false;
diff --git a/lib/plugins/syntax.php b/lib/plugins/syntax.php
index 256bf7519..2a4d1e0ff 100644
--- a/lib/plugins/syntax.php
+++ b/lib/plugins/syntax.php
@@ -174,7 +174,7 @@ class DokuWiki_Syntax_Plugin extends Doku_Parser_Mode {
* @return string parsed contents of the wiki page in xhtml format
*/
function locale_xhtml($id) {
- return p_cached_xhtml($this->localFN($id));
+ return p_cached_output($this->localFN($id));
}
/**