summaryrefslogtreecommitdiff
path: root/api
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2013-04-17 18:58:30 +0400
committerAndrew Dolgov <[email protected]>2013-04-17 18:58:30 +0400
commit4a70edea1a16f859a8c8df33b651a6454e80cbac (patch)
treef934155157690bbc074c449c71b80bf0a61dce4a /api
parentae35bb87ebcf08007a6086f136b98cba2448d34f (diff)
api: remove db_connect stuff
Diffstat (limited to 'api')
-rw-r--r--api/index.php8
1 files changed, 2 insertions, 6 deletions
diff --git a/api/index.php b/api/index.php
index d28ab763a..9f0d93f69 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();