Changes some API things.

This commit is contained in:
Lars Jung 2012-10-09 14:16:57 +02:00
parent 811994423d
commit a60d5556af
13 changed files with 36 additions and 33 deletions

View file

@ -19,14 +19,25 @@ normalized_require_once("/server/php/inc/util.php");
normalized_require_once("/server/php/inc/App.php");
normalized_require_once("/server/php/inc/Entry.php");
$APP = new App(APP_ABS_PATH, APP_ABS_HREF, ABS_HREF);
$app = new App(APP_ABS_PATH, APP_ABS_HREF, ABS_HREF);
if (array_key_exists("api", $_REQUEST)) {
if (count($_REQUEST)) {
header("Content-type: application/json;h5ai={{pkg.version}}");
use_request_params("api");
normalized_require_once("/server/php/inc/Api.php");
$api = new Api($APP);
$api = new Api($app);
$api->apply();
json_fail(100, "unsupported request");
} else {
header("Content-type: text/html;h5ai={{pkg.version}}");
$HREF = $app->get_app_abs_href();
$JSON = $app->get_generic_json();
$FALLBACK = $app->get_no_js_fallback();
}
?>