summaryrefslogtreecommitdiff
path: root/inc/parser
diff options
context:
space:
mode:
authorAdrian Lang <lang@cosmocode.de>2010-03-29 12:00:30 +0200
committerAdrian Lang <lang@cosmocode.de>2010-03-29 12:37:05 +0200
commitf6ec8df813b28547ca3b04bb39f0ce670a6bb990 (patch)
tree01cfd7c927495421861eef551b94b8653ca65218 /inc/parser
parentea6dfbca91f6afe89ff631ac28eae023bcc52853 (diff)
downloadrpg-f6ec8df813b28547ca3b04bb39f0ce670a6bb990.tar.gz
rpg-f6ec8df813b28547ca3b04bb39f0ce670a6bb990.tar.bz2
Allow plugins to specify that they have to be instantiated
Plugins may return false in isSingleton to let plugin_load return a new instance every time it is called. Renderer plugins are not loaded with $new set to true, but instead specify themself that they are not singletons. This behaviour allows the odt renderer to keep working (see #1598).
Diffstat (limited to 'inc/parser')
-rw-r--r--inc/parser/renderer.php9
1 files changed, 9 insertions, 0 deletions
diff --git a/inc/parser/renderer.php b/inc/parser/renderer.php
index 393099003..4dac75d21 100644
--- a/inc/parser/renderer.php
+++ b/inc/parser/renderer.php
@@ -49,6 +49,15 @@ class Doku_Renderer extends DokuWiki_Plugin {
trigger_error('getFormat() not implemented in '.get_class($this), E_USER_WARNING);
}
+ /**
+ * Allow the plugin to prevent DokuWiki from reusing an instance
+ *
+ * @return bool false if the plugin has to be instantiated
+ */
+ function isSingleton() {
+ return false;
+ }
+
//handle plugin rendering
function plugin($name,$data){