From: Andrew Dolgov Date: Wed, 17 Apr 2013 14:58:30 +0000 (+0400) Subject: api: remove db_connect stuff X-Git-Tag: 1.7.9~25^2~163 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=4a70edea1a16f859a8c8df33b651a6454e80cbac;p=tt-rss.git api: remove db_connect stuff --- diff --git a/api/index.php b/api/index.php index d28ab763..9f0d93f6 100644 --- a/api/index.php +++ b/api/index.php @@ -31,8 +31,6 @@ ob_start(); } - $link = db_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME); - $input = file_get_contents("php://input"); if (defined('_API_DEBUG_HTTP_ENABLED') && _API_DEBUG_HTTP_ENABLED) { @@ -55,11 +53,11 @@ @session_start(); } - if (!init_plugins($link)) return; + if (!init_plugins()) return; $method = strtolower($_REQUEST["op"]); - $handler = new API($link, $_REQUEST); + $handler = new API(Db::get(), $_REQUEST); if ($handler->before($method)) { if ($method && method_exists($handler, $method)) { @@ -70,8 +68,6 @@ $handler->after(); } - db_close($link); - header("Api-Content-Length: " . ob_get_length()); ob_end_flush();