]> git.wh0rd.org - tt-rss.git/commitdiff
api: remove db_connect stuff
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Wed, 17 Apr 2013 14:58:30 +0000 (18:58 +0400)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Wed, 17 Apr 2013 14:58:30 +0000 (18:58 +0400)
api/index.php

index d28ab763a0a27b08a4ac892d748bf063b5cc81f5..9f0d93f695d19880e1c1b77bd08dbeb662cd3790 100644 (file)
@@ -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) {
                @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();