summaryrefslogtreecommitdiff
path: root/lib/plugins
diff options
context:
space:
mode:
authorChris Smith <chris.eureka@jalakai.co.uk>2009-02-11 15:35:20 +0100
committerChris Smith <chris.eureka@jalakai.co.uk>2009-02-11 15:35:20 +0100
commite842bd07d5bcb07c236b970d1c91c8b101753b0e (patch)
tree6ffc968fdc606f5a00f7e288e65ed4e93febf9d8 /lib/plugins
parent0e115661192c6534b69888fbf70096f5ec6d7fa9 (diff)
downloadrpg-e842bd07d5bcb07c236b970d1c91c8b101753b0e.tar.gz
rpg-e842bd07d5bcb07c236b970d1c91c8b101753b0e.tar.bz2
Fix for FS#1598 - allow a plugin to be a singleton if it so desires
DokuWiki typically instantiates a plugin once and reuses that instance whenever the plugin is required. However on some occasions DokuWiki will request a new instantiation of a plugin. This particularly applies to render plugins. This patch allows a plugin to force DokuWiki to reuse the existing instance. If a plugin wishes to only be instantiated once then it should implement an "isSingleton()" method and that method should return boolean true. darcs-hash:20090211143520-f07c6-5c1a33dbed55f0b196a204745fe3139f3c7c0aa9.gz
Diffstat (limited to 'lib/plugins')
-rw-r--r--lib/plugins/syntax.php8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/plugins/syntax.php b/lib/plugins/syntax.php
index 7ded173cd..126e01952 100644
--- a/lib/plugins/syntax.php
+++ b/lib/plugins/syntax.php
@@ -266,5 +266,13 @@ class DokuWiki_Syntax_Plugin extends Doku_Parser_Mode {
return $conf;
}
+ /**
+ * Allow the plugin to prevent DokuWiki creating a second instance of itself
+ *
+ * @return bool true if the plugin can not be instantiated more than once
+ */
+ function isSingleton() {
+ return false;
+ }
}
//Setup VIM: ex: et ts=4 enc=utf-8 :