From: Andrew Dolgov Date: Wed, 16 Dec 2009 12:04:24 +0000 (+0300) Subject: api: add getConfig X-Git-Tag: 1.4.0~183^2~3 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=7c6d05cda4536c752d244f8a4f9495cef5defa0f;p=tt-rss.git api: add getConfig --- diff --git a/api/index.php b/api/index.php index 8d7e1db9..be266128 100644 --- a/api/index.php +++ b/api/index.php @@ -325,6 +325,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; }