Exemple #1
0
        break;
}
header('Content-type:' . $content_type . '; charset=utf-8');
$rest_obj = false;
$rest_module = $rest_params[_REST_APINAME_INDEX];
//the module specification
$rest_function = $rest_params[_REST_APIMETHOD_INDEX];
//the name of module's method to call
// extract additional parameters from GET string, void and outputtype parameter should be already avoided
$i = _REST_APIMETHOD_INDEX + 1;
$rest_subparams = array();
while ($i < count($rest_params)) {
    //$numparams) {
    $rest_subparams[] = $rest_params[$i];
    $i++;
}
$res = API::Execute($auth_code, $rest_module, $rest_function, $rest_subparams);
if (!$res['success']) {
    $err_msg = $res['message'];
    rest_cout(RestAPI::HandleError($err_msg, $GLOBALS['REST_API_ACCEPT']));
} else {
    rest_cout(RestAPI::HandleOutput($res, $GLOBALS['REST_API_ACCEPT']));
}
// finalize
Boot::finalize();
//clear debug messages and clean buffer for output
$debug = ob_get_contents();
ob_clean();
echo $GLOBALS['output'];
// flush buffer
ob_end_flush();