diff options
author | Andrew Dolgov <[email protected]> | 2009-12-16 15:04:24 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2009-12-16 15:04:24 +0300 |
commit | 7c6d05cda4536c752d244f8a4f9495cef5defa0f (patch) | |
tree | d9be0580703f4a35abe004d1f8f0567390d2dd8e /api | |
parent | 2bebdd344b7259738c2d424572d202482d92e6f1 (diff) |
api: add getConfig
Diffstat (limited to 'api')
-rw-r--r-- | api/index.php | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/api/index.php b/api/index.php index 8d7e1db96..be2661285 100644 --- a/api/index.php +++ b/api/index.php @@ -326,6 +326,26 @@ print json_encode($article); break; + case "getConfig": + $config = array( + "icons_dir" => ICONS_DIR, + "icons_url" => ICONS_URL); + + if (ENABLE_UPDATE_DAEMON) { + $config["daemon_is_running"] = file_is_locked("update_daemon.lock"); + } + + $result = db_query($link, "SELECT COUNT(*) AS cf FROM + ttrss_feeds WHERE owner_uid = " . $_SESSION["uid"]); + + $num_feeds = db_fetch_result($result, 0, "cf"); + + $config["num_feeds"] = (int)$num_feeds; + + print json_encode($config); + + + break; } db_close($link); |