mirror of
https://git.tt-rss.org/git/tt-rss.git
synced 2025-12-13 15:25:59 +00:00
make pluginhost a singleton
This commit is contained in:
@@ -10,6 +10,7 @@ class PluginHost {
|
||||
private $api_methods = array();
|
||||
private $owner_uid;
|
||||
private $debug;
|
||||
private static $instance;
|
||||
|
||||
const HOOK_ARTICLE_BUTTON = 1;
|
||||
const HOOK_ARTICLE_FILTER = 2;
|
||||
@@ -35,13 +36,24 @@ class PluginHost {
|
||||
const KIND_SYSTEM = 2;
|
||||
const KIND_USER = 3;
|
||||
|
||||
function __construct($dbh) {
|
||||
$this->dbh = $dbh;
|
||||
function __construct($ignored = false) {
|
||||
$this->dbh = Db::get();
|
||||
$this->storage = $_SESSION["plugin_storage"];
|
||||
|
||||
if (!$this->storage) $this->storage = array();
|
||||
}
|
||||
|
||||
private function __clone() {
|
||||
//
|
||||
}
|
||||
|
||||
public static function getInstance() {
|
||||
if (self::$instance == null)
|
||||
self::$instance = new self();
|
||||
|
||||
return self::$instance;
|
||||
}
|
||||
|
||||
private function register_plugin($name, $plugin) {
|
||||
//array_push($this->plugins, $plugin);
|
||||
$this->plugins[$name] = $plugin;
|
||||
|
||||
Reference in New Issue
Block a user