X-Git-Url: https://git.wh0rd.org/?a=blobdiff_plain;f=classes%2Fplugin.php;h=b90c603b7357e1174d24bba94de16846d9d12610;hb=07fd4f8d9d4f301f5ad88ff9e80f042fc3eb0c36;hp=b96874a20864f0773741e65f4f21a8e24a7c4d43;hpb=369dbc19d6ae35c97a2306ae4821c7812e2f24b2;p=tt-rss.git diff --git a/classes/plugin.php b/classes/plugin.php index b96874a2..b90c603b 100644 --- a/classes/plugin.php +++ b/classes/plugin.php @@ -1,21 +1,43 @@ link = $link; - $this->handler = $handler; - $this->initialize(); +abstract class Plugin { + const API_VERSION_COMPAT = 1; + + /** @var PDO */ + protected $pdo; + + /* @var PluginHost $host */ + abstract function init($host); + + abstract function about(); + // return array(1.0, "plugin", "No description", "No author", false); + + function __construct() { + $this->pdo = Db::pdo(); } - function initialize() { + function flags() { + /* associative array, possible keys: + needs_curl = boolean + */ + return array(); + } + + /** + * @SuppressWarnings(PHPMD.UnusedFormalParameter) + */ + function is_public_method($method) { + return false; + } + function get_js() { + return ""; + } + function get_prefs_js() { + return ""; } - function add_listener($hook) { - $this->handler->add_listener($hook, $this); + function api_version() { + return Plugin::API_VERSION_COMPAT; } -} -?> +} \ No newline at end of file