diff --git a/inc/parser/renderer.php b/inc/parser/renderer.php index 39309900349b104600cee167acbc72a02d111db7..4dac75d213f65ee447cb009fe38706a43d5831e4 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 4bec3ab1d3df5934c2435a3f6b4062738a0badb2..35ccdc1d6922ef267380f9984b4307e009e9933d 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 3645347399904d6f04bee7351ffc0193dda91791..aff07c1e562c4aa877eac35c92367142616d62fe 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 04368727093927bcbcd85a26eed80a6302645981..61f460414eab05949a795ef8f32228be87ec7881 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 601b5591e5a0bfe357714243c873aa98b67ada79..f7b64d8c0d8428811296310738185a8c7c03f576 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 :