summaryrefslogtreecommitdiff
path: root/classes/api.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2013-04-18 12:27:34 +0400
committerAndrew Dolgov <[email protected]>2013-04-18 12:27:34 +0400
commit1ffe3391f902c4baa984982f19e61a0e45de21ff (patch)
tree4b0b7554c42a6df823db9cf90b925151c796f696 /classes/api.php
parent52d88392dad52ec4d5607fef7479d74dee8b8be4 (diff)
make pluginhost a singleton
Diffstat (limited to 'classes/api.php')
-rw-r--r--classes/api.php10
1 files changed, 3 insertions, 7 deletions
diff --git a/classes/api.php b/classes/api.php
index 945496bcf..9e99ed007 100644
--- a/classes/api.php
+++ b/classes/api.php
@@ -341,8 +341,7 @@ class API extends Handler {
"score" => (int)$line["score"]
);
- global $pluginhost;
- foreach ($pluginhost->get_hooks($pluginhost::HOOK_RENDER_ARTICLE_API) as $p) {
+ foreach (PluginHost::getInstance()->get_hooks(PluginHost::HOOK_RENDER_ARTICLE_API) as $p) {
$article = $p->hook_render_article_api(array("article" => $article));
}
@@ -466,9 +465,7 @@ class API extends Handler {
}
function index($method) {
- global $pluginhost;
-
- $plugin = $pluginhost->get_api_method(strtolower($method));
+ $plugin = PluginHost::getInstance()->get_api_method(strtolower($method));
if ($plugin && method_exists($plugin, $method)) {
$reply = $plugin->$method();
@@ -697,8 +694,7 @@ class API extends Handler {
$headline_row["author"] = $line["author"];
$headline_row["score"] = (int)$line["score"];
- global $pluginhost;
- foreach ($pluginhost->get_hooks($pluginhost::HOOK_RENDER_ARTICLE_API) as $p) {
+ foreach (PluginHost::getInstance()->get_hooks(PluginHost::HOOK_RENDER_ARTICLE_API) as $p) {
$headline_row = $p->hook_render_article_api(array("headline" => $headline_row));
}