feat(php): API works

This commit is contained in:
Pavel Korytov 2022-05-23 11:14:59 +03:00
parent d1e4646b09
commit 598bdb2d76
2 changed files with 15 additions and 6 deletions

3
README.md Normal file
View file

@ -0,0 +1,3 @@
# Installation
- Clone the repo to the `plugins.local` folder
- Add `elfeed_sync` to the `TTRSS_PLUGINS` variable

View file

@ -3,17 +3,23 @@ class Elfeed_Sync extends Plugin {
private $host; private $host;
function about() { function about() {
return array(1.0, "Elfeed Sync", "Sync API for elfeed", false, "http://example.com"); return array(null, "Elfeed Sync", "Sync API for elfeed", true);
} }
function api_version() { function api_version() {
return 1; return 2;
}
function init($host) {
$this->host = $host;
} }
function testMethod() { function init($host) {
$this->host = $host;
$this->host->add_api_method("kek", $this);
}
/**
* Our own API.
*/
function kek() {
return array(API::STATUS_OK, array("ok" => true)); return array(API::STATUS_OK, array("ok" => true));
} }
} }