<?php //gtalk include_once 'includes/init.php'; $dmp = API_HIT_ENTRY_LIST; debug("api({$dmp}): Start!"); //run $api = new LDAP_Api($dmp); $api->hit(); debug("api({$dmp}): act -> {$dmp}"); //free unset($api); debug("api({$dmp}): Done !");
$app->config('cookies.encrypt', true); $app->config('cookies.secret_key', md5(sprintf("%s-%s", MY_APP_NAME, @date('Ymd')))); $app->config('http.version', '1.1'); } //instantiate it here debug("api(): Start!"); //run /** | | LDAP_Api($action = API_HIT_ENTRY_SEARCH,$showres=true,$status=false) | | - SHOWRES = will output json reply | - STATUS = will output headers | **/ $api = new LDAP_Api(API_HIT_ENTRY_RESTAPI, true, false); debug("api(): VIA REST API > "); //@ MAPPING of ROUTES //ldap group $app->group('/ldap', function () use($app, &$api) { $app->group('/restapi', function () use($app, &$api) { //sign-in $app->map('/signin', function () use($app, &$api) { $api->hit(API_HIT_SIGN_IN, $app); return true; })->via('GET', 'POST'); //add entry $app->map('/add', function () use($app, &$api) { $api->hit(API_HIT_ENTRY_ADD, $app); return true; })->via('POST', 'PUT');