summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--inc/parser/renderer.php9
-rw-r--r--inc/parserutils.php2
-rw-r--r--inc/plugin.php6
-rw-r--r--inc/plugincontroller.class.php2
-rw-r--r--lib/plugins/syntax.php8
5 files changed, 14 insertions, 13 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){
diff --git a/inc/parserutils.php b/inc/parserutils.php
index 4bec3ab1d..35ccdc1d6 100644
--- a/inc/parserutils.php
+++ b/inc/parserutils.php
@@ -585,7 +585,7 @@ function & p_get_renderer($mode) {
// Maybe a plugin/component is available?
list($plugin, $component) = $plugin_controller->_splitName($rname);
if (!$plugin_controller->isdisabled($plugin)){
- $Renderer =& $plugin_controller->load('renderer',$rname, true);
+ $Renderer =& $plugin_controller->load('renderer',$rname);
}
if(is_null($Renderer)){
diff --git a/inc/plugin.php b/inc/plugin.php
index 364534739..aff07c1e5 100644
--- a/inc/plugin.php
+++ b/inc/plugin.php
@@ -231,12 +231,12 @@ class DokuWiki_Plugin {
}
/**
- * Allow the plugin to prevent DokuWiki creating a second instance of itself
+ * Allow the plugin to prevent DokuWiki from reusing an instance
*
- * @return bool true if the plugin can not be instantiated more than once
+ * @return bool false if the plugin has to be instantiated
*/
function isSingleton() {
- return false;
+ return true;
}
// deprecated functions
diff --git a/inc/plugincontroller.class.php b/inc/plugincontroller.class.php
index 043687270..61f460414 100644
--- a/inc/plugincontroller.class.php
+++ b/inc/plugincontroller.class.php
@@ -66,7 +66,7 @@ class Doku_Plugin_Controller {
//plugin already loaded?
if(!empty($DOKU_PLUGINS[$type][$name])){
- if ($new && !$DOKU_PLUGINS[$type][$name]->isSingleton()) {
+ if ($new || !$DOKU_PLUGINS[$type][$name]->isSingleton()) {
$class = $type.'_plugin_'.$name;
return class_exists($class) ? new $class : null;
} else {
diff --git a/lib/plugins/syntax.php b/lib/plugins/syntax.php
index 601b5591e..f7b64d8c0 100644
--- a/lib/plugins/syntax.php
+++ b/lib/plugins/syntax.php
@@ -266,13 +266,5 @@ 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 :