From: Andrew Dolgov Date: Tue, 26 Feb 2013 15:30:19 +0000 (+0400) Subject: pluginhost: add get_debug()/set_debug() for plugins to detect if debugging is allowed X-Git-Tag: 1.7.1~31 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=be17885789fdf35b40e040d80c50077652069dc1;p=tt-rss.git pluginhost: add get_debug()/set_debug() for plugins to detect if debugging is allowed --- diff --git a/classes/pluginhost.php b/classes/pluginhost.php index 1748a067..59262988 100644 --- a/classes/pluginhost.php +++ b/classes/pluginhost.php @@ -7,6 +7,7 @@ class PluginHost { private $commands = array(); private $storage = array(); private $owner_uid; + private $debug; const HOOK_ARTICLE_BUTTON = 1; const HOOK_ARTICLE_FILTER = 2; @@ -290,5 +291,13 @@ class PluginHost { $_SESSION["plugin_storage"] = $this->storage; } } + + function set_debug($debug) { + $this->debug = $debug; + } + + function get_debug() { + return $this->debug; + } } ?> diff --git a/include/rssfuncs.php b/include/rssfuncs.php index ba9e30b0..77dd3aae 100644 --- a/include/rssfuncs.php +++ b/include/rssfuncs.php @@ -274,6 +274,7 @@ } $pluginhost = new PluginHost($link); + $pluginhost->set_debug($debug_enabled); $user_plugins = get_pref($link, "_ENABLED_PLUGINS", $owner_uid); $pluginhost->load(PLUGINS, $pluginhost::KIND_ALL);