diff options
author | Andrew Dolgov <[email protected]> | 2012-08-21 14:37:43 +0400 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2012-08-21 14:37:43 +0400 |
commit | 9aceda3afc70eba20fa236c46c050b1e63ca07ca (patch) | |
tree | 74f3e8db16db3b9eb4aef5389be6ed4e00f0347f /classes/plugins.php | |
parent | 23d2471c925ed31228e68210e7a55c836234645e (diff) |
remove hook-based plugins
Diffstat (limited to 'classes/plugins.php')
-rw-r--r-- | classes/plugins.php | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/classes/plugins.php b/classes/plugins.php deleted file mode 100644 index 6f3720ca9..000000000 --- a/classes/plugins.php +++ /dev/null @@ -1,44 +0,0 @@ -<?php -class Plugins { - protected $link; - protected $plugins; - protected $listeners; - - function __construct($link) { - $this->link = $link; - $this->listeners = array(); - $this->load_plugins(); - } - - function load_plugins() { - if (defined('_ENABLE_PLUGINS')) { - $plugins = explode(",", _ENABLE_PLUGINS); - - foreach ($plugins as $p) { - $plugin_class = "plugin_$p"; - if (class_exists($plugin_class)) { - $plugin = new $plugin_class($this->link, $this); - } - } - } - } - - function add_listener($hook_name, $plugin) { - if (!is_array($this->listeners[$hook_name])) - $this->listeners[$hook_name] = array(); - - array_push($this->listeners[$hook_name], $plugin); - } - - function hook($hook_name, &$params) { - if (is_array($this->listeners[$hook_name])) { - foreach ($this->listeners[$hook_name] as $p) { - if (method_exists($p, $hook_name)) { - $p->$hook_name($params); - } - } - } - } - -} -?> |