Skip to content
Snippets Groups Projects
Commit 4a70edea authored by Andrew Dolgov's avatar Andrew Dolgov
Browse files

api: remove db_connect stuff

parent ae35bb87
No related branches found
No related tags found
No related merge requests found
...@@ -31,8 +31,6 @@ ...@@ -31,8 +31,6 @@
ob_start(); ob_start();
} }
$link = db_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME);
$input = file_get_contents("php://input"); $input = file_get_contents("php://input");
if (defined('_API_DEBUG_HTTP_ENABLED') && _API_DEBUG_HTTP_ENABLED) { if (defined('_API_DEBUG_HTTP_ENABLED') && _API_DEBUG_HTTP_ENABLED) {
...@@ -55,11 +53,11 @@ ...@@ -55,11 +53,11 @@
@session_start(); @session_start();
} }
if (!init_plugins($link)) return; if (!init_plugins()) return;
$method = strtolower($_REQUEST["op"]); $method = strtolower($_REQUEST["op"]);
$handler = new API($link, $_REQUEST); $handler = new API(Db::get(), $_REQUEST);
if ($handler->before($method)) { if ($handler->before($method)) {
if ($method && method_exists($handler, $method)) { if ($method && method_exists($handler, $method)) {
...@@ -70,8 +68,6 @@ ...@@ -70,8 +68,6 @@
$handler->after(); $handler->after();
} }
db_close($link);
header("Api-Content-Length: " . ob_get_length()); header("Api-Content-Length: " . ob_get_length());
ob_end_flush(); ob_end_flush();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment