From: Andrew Dolgov Date: Fri, 19 Apr 2013 13:31:56 +0000 (+0400) Subject: plugins: bump API version X-Git-Tag: 1.7.9~25^2~120 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=106a3de91c7c8c6c275323152de414253f01127a;p=tt-rss.git plugins: bump API version --- diff --git a/classes/pluginhost.php b/classes/pluginhost.php index dc75e31f..9ebabeb8 100644 --- a/classes/pluginhost.php +++ b/classes/pluginhost.php @@ -13,7 +13,7 @@ class PluginHost { private $last_registered; private static $instance; - const API_VERSION = 1; + const API_VERSION = 2; const HOOK_ARTICLE_BUTTON = 1; const HOOK_ARTICLE_FILTER = 2; @@ -62,15 +62,9 @@ class PluginHost { $this->plugins[$name] = $plugin; } + // needed for compatibility with API 1 function get_link() { - header("Content-type: text/plain"); - - print "One of the plugins called obsolete host method get_link(). This plugin needs to be updated or removed.\n\n"; - - print "List of plugins loaded: " . join(" ,", array_keys($this->plugins)) . "\n\n"; - - print "Last plugin initialized (possible culprit): " . $this->last_registered . "\n"; - die; + return false; } function get_dbh() { diff --git a/plugins/af_buttersafe/init.php b/plugins/af_buttersafe/init.php index e1a01b3d..05e684aa 100644 --- a/plugins/af_buttersafe/init.php +++ b/plugins/af_buttersafe/init.php @@ -53,5 +53,10 @@ class Af_Buttersafe extends Plugin { return $article; } + + function api_version() { + return 2; + } + } ?> diff --git a/plugins/af_explosm/init.php b/plugins/af_explosm/init.php index b5e34657..dd106653 100644 --- a/plugins/af_explosm/init.php +++ b/plugins/af_explosm/init.php @@ -53,5 +53,9 @@ class Af_Explosm extends Plugin { return $article; } + + function api_version() { + return 2; + } } ?> diff --git a/plugins/af_gocomics/init.php b/plugins/af_gocomics/init.php index 39dd0c85..e95de9f1 100644 --- a/plugins/af_gocomics/init.php +++ b/plugins/af_gocomics/init.php @@ -52,5 +52,10 @@ class Af_GoComics extends Plugin { return $article; } + + function api_version() { + return 2; + } + } ?> diff --git a/plugins/af_pennyarcade/init.php b/plugins/af_pennyarcade/init.php index d897d85c..8ad02e14 100644 --- a/plugins/af_pennyarcade/init.php +++ b/plugins/af_pennyarcade/init.php @@ -83,5 +83,10 @@ class Af_PennyArcade extends Plugin { return $article; } + + function api_version() { + return 2; + } + } ?> diff --git a/plugins/af_redditimgur/init.php b/plugins/af_redditimgur/init.php index d5b3e5c2..39a20784 100644 --- a/plugins/af_redditimgur/init.php +++ b/plugins/af_redditimgur/init.php @@ -133,5 +133,10 @@ class Af_RedditImgur extends Plugin { return $article; } + + function api_version() { + return 2; + } + } ?> diff --git a/plugins/af_unburn/init.php b/plugins/af_unburn/init.php index 67939f80..62b3b4dc 100644 --- a/plugins/af_unburn/init.php +++ b/plugins/af_unburn/init.php @@ -125,5 +125,10 @@ class Af_Unburn extends Plugin { } return $url; } + + function api_version() { + return 2; + } + } ?> diff --git a/plugins/auth_internal/init.php b/plugins/auth_internal/init.php index 33f90d4b..79a8e8cb 100644 --- a/plugins/auth_internal/init.php +++ b/plugins/auth_internal/init.php @@ -187,5 +187,10 @@ class Auth_Internal extends Plugin implements IAuthModule { return "ERROR: ".__('Old password is incorrect.'); } } + + function api_version() { + return 2; + } + } ?> diff --git a/plugins/auth_remote/init.php b/plugins/auth_remote/init.php index a551c6bd..2bf090d5 100644 --- a/plugins/auth_remote/init.php +++ b/plugins/auth_remote/init.php @@ -77,6 +77,11 @@ class Auth_Remote extends Plugin implements IAuthModule { return false; } + + function api_version() { + return 2; + } + } ?> diff --git a/plugins/bookmarklets/init.php b/plugins/bookmarklets/init.php index be0da83c..e4560555 100644 --- a/plugins/bookmarklets/init.php +++ b/plugins/bookmarklets/init.php @@ -38,8 +38,11 @@ class Bookmarklets extends Plugin { print ""; #pane } - } + function api_version() { + return 2; + } + } ?> diff --git a/plugins/close_button/init.php b/plugins/close_button/init.php index 78f2edd2..7911642c 100644 --- a/plugins/close_button/init.php +++ b/plugins/close_button/init.php @@ -24,5 +24,10 @@ class Close_Button extends Plugin { return $rv; } + + function api_version() { + return 2; + } + } ?> diff --git a/plugins/digest/init.php b/plugins/digest/init.php index b0609717..aee351cd 100644 --- a/plugins/digest/init.php +++ b/plugins/digest/init.php @@ -11,6 +11,7 @@ class Digest extends Plugin implements IHandler { } function init($host) { + $this->link = $host->get_link(); $this->host = $host; $host->add_handler("digest", "*", $this); @@ -100,5 +101,9 @@ class Digest extends Plugin implements IHandler { print json_encode($params); } + function api_version() { + return 2; + } + } ?> diff --git a/plugins/embed_original/init.php b/plugins/embed_original/init.php index c65793e1..df803d38 100644 --- a/plugins/embed_original/init.php +++ b/plugins/embed_original/init.php @@ -50,5 +50,9 @@ class Embed_Original extends Plugin { print json_encode(array("url" => $url, "id" => $id)); } + function api_version() { + return 2; + } + } ?> diff --git a/plugins/example/init.php b/plugins/example/init.php index 8f4e8abf..67f50277 100644 --- a/plugins/example/init.php +++ b/plugins/example/init.php @@ -76,5 +76,10 @@ class Example extends Plugin { print ""; #pane } + + function api_version() { + return 2; + } + } ?> diff --git a/plugins/example_api/init.php b/plugins/example_api/init.php index 9e0ad18b..1f896bad 100644 --- a/plugins/example_api/init.php +++ b/plugins/example_api/init.php @@ -25,5 +25,10 @@ class Example_Api extends Plugin { function example_testmethod() { return array(API::STATUS_OK, array("current_time" => time())); } + + function api_version() { + return 2; + } + } ?> diff --git a/plugins/example_article/init.php b/plugins/example_article/init.php index 000be7c4..69902cbf 100644 --- a/plugins/example_article/init.php +++ b/plugins/example_article/init.php @@ -25,5 +25,10 @@ class Example_Article extends Plugin { return $article; } + + function api_version() { + return 2; + } + } ?> diff --git a/plugins/example_feed/init.php b/plugins/example_feed/init.php index 19d08966..1d653a9f 100644 --- a/plugins/example_feed/init.php +++ b/plugins/example_feed/init.php @@ -23,5 +23,10 @@ class Example_Feed extends Plugin { _debug("I'm a little feed short and stout, here's my title: " . $feed->get_title()); _debug("... here's my link element: " . $feed->get_link()); } + + function api_version() { + return 2; + } + } ?> diff --git a/plugins/example_routing/init.php b/plugins/example_routing/init.php index 0ae446e3..a7b19d78 100644 --- a/plugins/example_routing/init.php +++ b/plugins/example_routing/init.php @@ -48,5 +48,9 @@ class Example_Routing extends Plugin implements IHandler { return true; } + function api_version() { + return 2; + } + } ?> diff --git a/plugins/example_vfeed/init.php b/plugins/example_vfeed/init.php index b137fd0f..31076190 100644 --- a/plugins/example_vfeed/init.php +++ b/plugins/example_vfeed/init.php @@ -43,5 +43,10 @@ class Example_VFeed extends Plugin { return $qfh_ret; } + + function api_version() { + return 2; + } + } ?> diff --git a/plugins/googlereaderimport/init.php b/plugins/googlereaderimport/init.php index 183875ec..be6b8198 100644 --- a/plugins/googlereaderimport/init.php +++ b/plugins/googlereaderimport/init.php @@ -374,5 +374,10 @@ class GoogleReaderImport extends Plugin { print ""; #pane } + + function api_version() { + return 2; + } + } ?> diff --git a/plugins/googlereaderkeys/init.php b/plugins/googlereaderkeys/init.php index 27428a48..c8e7d7a3 100644 --- a/plugins/googlereaderkeys/init.php +++ b/plugins/googlereaderkeys/init.php @@ -28,7 +28,11 @@ class GoogleReaderKeys extends Plugin { $hotkeys["(40)|down"] = "article_scroll_down"; return $hotkeys; + } + function api_version() { + return 2; } + } ?> diff --git a/plugins/import_export/init.php b/plugins/import_export/init.php index e4e98c03..15c7dea9 100644 --- a/plugins/import_export/init.php +++ b/plugins/import_export/init.php @@ -453,6 +453,9 @@ class Import_Export extends Plugin implements IHandler { } + function api_version() { + return 2; + } } ?> diff --git a/plugins/instances/init.php b/plugins/instances/init.php index d59e17ff..aac28196 100644 --- a/plugins/instances/init.php +++ b/plugins/instances/init.php @@ -444,6 +444,9 @@ class Instances extends Plugin implements IHandler { print json_encode(array("hash" => $hash)); } + function api_version() { + return 2; + } } ?> diff --git a/plugins/mail/init.php b/plugins/mail/init.php index 2897068a..80bc7d41 100644 --- a/plugins/mail/init.php +++ b/plugins/mail/init.php @@ -168,6 +168,9 @@ class Mail extends Plugin { print ""; } + function api_version() { + return 2; + } } ?> diff --git a/plugins/mailto/init.php b/plugins/mailto/init.php index c786cf0d..aa6d173f 100644 --- a/plugins/mailto/init.php +++ b/plugins/mailto/init.php @@ -86,5 +86,9 @@ class MailTo extends Plugin { //return; } + function api_version() { + return 2; + } + } ?> diff --git a/plugins/mark_button/init.php b/plugins/mark_button/init.php index b6a311bc..971b1293 100644 --- a/plugins/mark_button/init.php +++ b/plugins/mark_button/init.php @@ -34,5 +34,10 @@ class Mark_Button extends Plugin { return $marked_pic; } + + function api_version() { + return 2; + } + } ?> diff --git a/plugins/mobile/init.php b/plugins/mobile/init.php index ad2d1cdd..1a59fe33 100644 --- a/plugins/mobile/init.php +++ b/plugins/mobile/init.php @@ -37,6 +37,9 @@ class Mobile extends Plugin implements IHandler { } + function api_version() { + return 2; + } } ?> diff --git a/plugins/note/init.php b/plugins/note/init.php index f5816bc2..2a32961f 100644 --- a/plugins/note/init.php +++ b/plugins/note/init.php @@ -68,5 +68,9 @@ class Note extends Plugin { "raw_length" => mb_strlen($note))); } + function api_version() { + return 2; + } + } ?> diff --git a/plugins/nsfw/init.php b/plugins/nsfw/init.php index c4182731..a57aa445 100644 --- a/plugins/nsfw/init.php +++ b/plugins/nsfw/init.php @@ -98,5 +98,9 @@ class NSFW extends Plugin { echo __("Configuration saved."); } + function api_version() { + return 2; + } + } ?> diff --git a/plugins/share/init.php b/plugins/share/init.php index 53b9dcdc..72a4d4bf 100644 --- a/plugins/share/init.php +++ b/plugins/share/init.php @@ -67,6 +67,9 @@ class Share extends Plugin { print ""; } + function api_version() { + return 2; + } } ?> diff --git a/plugins/swap_jk/init.php b/plugins/swap_jk/init.php index 73fb8200..e60e7201 100644 --- a/plugins/swap_jk/init.php +++ b/plugins/swap_jk/init.php @@ -21,7 +21,11 @@ class Swap_JK extends Plugin { $hotkeys["k"] = "prev_feed"; return $hotkeys; + } + function api_version() { + return 2; } + } ?> diff --git a/plugins/updater/init.php b/plugins/updater/init.php index 2ae4c410..fa283c8b 100644 --- a/plugins/updater/init.php +++ b/plugins/updater/init.php @@ -380,5 +380,9 @@ class Updater extends Plugin { } } + function api_version() { + return 2; + } + } ?>