]> git.wh0rd.org - tt-rss.git/commitdiff
pluginhost: add get_debug()/set_debug() for plugins to detect if debugging is allowed
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Tue, 26 Feb 2013 15:30:19 +0000 (19:30 +0400)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Tue, 26 Feb 2013 15:30:19 +0000 (19:30 +0400)
classes/pluginhost.php
include/rssfuncs.php

index 1748a067d0ccb2e51a3b1019296ac8fbe7bdd632..592629881e98dbbccab8bd306ca5c205c4f66baf 100644 (file)
@@ -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;
+       }
 }
 ?>
index ba9e30b051b7138b09531c12e52f0e6cc651f07a..77dd3aae2310ae6f3eb2dcd2506660045734b3f8 100644 (file)
                }
 
                $pluginhost = new PluginHost($link);
+               $pluginhost->set_debug($debug_enabled);
                $user_plugins = get_pref($link, "_ENABLED_PLUGINS", $owner_uid);
 
                $pluginhost->load(PLUGINS, $pluginhost::KIND_ALL);