add hook to add additional routes

This commit is contained in:
Uwe Steinmann 2022-11-10 08:27:00 +01:00
parent ebf7fb7591
commit 25c2d03190

View File

@ -2611,9 +2611,6 @@ class TestController { /* {{{ */
} /* }}} */
} /* }}} */
//$app = new Slim(array('mode'=>'development', '_session.handler'=>null));
$app = new \Slim\App();
/* Middleware for authentication */
class Auth { /* {{{ */
@ -2706,6 +2703,8 @@ class Auth { /* {{{ */
}
} /* }}} */
$app = new \Slim\App();
$container = $app->getContainer();
$container['dms'] = $dms;
$container['config'] = $settings;
@ -2798,6 +2797,14 @@ $app->get('/attributedefinitions', \RestapiController::class.':getAttributeDefin
$app->put('/attributedefinitions/{id}/name', \RestapiController::class.':changeAttributeDefinitionName');
$app->get('/echo/{data}', \TestController::class.':echoData');
$app->get('/statstotal', \RestapiController::class.':getStatsTotal');
if(isset($GLOBALS['SEEDDMS_HOOKS']['initRestAPI'])) {
foreach($GLOBALS['SEEDDMS_HOOKS']['initRestAPI'] as $hookObj) {
if (method_exists($hookObj, 'addRoute')) {
$hookObj->addRoute($app);
}
}
}
$app->run();
?>