$script_started = microtime(true);
- $link = db_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME);
-
if (!init_plugins()) return;
header("Content-Type: text/json; charset=utf-8");
$op = str_replace("-", "_", $op);
- global $pluginhost;
- $override = $pluginhost->lookup_handler($op, $method);
+ $override = PluginHost::getInstance()->lookup_handler($op, $method);
if (class_exists($op) || $override) {
if ($override) {
$handler = $override;
} else {
- $handler = new $op(Db::get(), $_REQUEST);
+ $handler = new $op($_REQUEST);
}
if ($handler && implements_interface($handler, 'IHandler')) {
header("Content-Type: text/json");
print json_encode(array("error" => array("code" => 7)));
- // We close the connection to database.
- db_close();
?>