diff --git a/www/index.php b/www/index.php index 9c0106cbe..23f2951da 100644 --- a/www/index.php +++ b/www/index.php @@ -34,7 +34,7 @@ require "inc/inc.Settings.php"; use DI\ContainerBuilder; use Slim\Factory\AppFactory; -if(true) { +if (true) { require_once("inc/inc.Utils.php"); require_once("inc/inc.LogInit.php"); require_once("inc/inc.Language.php"); @@ -60,18 +60,18 @@ if(true) { $container->set('notifier', $notifier); $container->set('authenticator', $authenticator); - if(isset($GLOBALS['SEEDDMS_HOOKS']['initDMS'])) { - foreach($GLOBALS['SEEDDMS_HOOKS']['initDMS'] as $hookObj) { - if (method_exists($hookObj, 'addMiddleware')) { - $hookObj->addMiddleware($app); - } + if (isset($GLOBALS['SEEDDMS_HOOKS']['initDMS'])) { + foreach ($GLOBALS['SEEDDMS_HOOKS']['initDMS'] as $hookObj) { + if (method_exists($hookObj, 'addMiddleware')) { + $hookObj->addMiddleware($app); } + } } $app->addErrorMiddleware(false, true, true); - if(isset($GLOBALS['SEEDDMS_HOOKS']['initDMS'])) { - foreach($GLOBALS['SEEDDMS_HOOKS']['initDMS'] as $hookObj) { + if (isset($GLOBALS['SEEDDMS_HOOKS']['initDMS'])) { + foreach ($GLOBALS['SEEDDMS_HOOKS']['initDMS'] as $hookObj) { if (method_exists($hookObj, 'addRoute')) { // FIXME: pass $app only just like initRestAPI. $app has a container // which contains all other objects @@ -81,16 +81,14 @@ if(true) { } /* Catch all route */ - $app->get('/{path:.*}', function($request, $response) use ($settings) { + $app->get('/{path:.*}', function ($request, $response) use ($settings) { return $response ->withHeader('Location', $settings->_httpRoot.'out/out.ViewFolder.php') ->withStatus(302); - }); $app->run(); } else { - header("Location: ". (isset($settings->_siteDefaultPage) && strlen($settings->_siteDefaultPage)>0 ? $settings->_siteDefaultPage : "out/out.ViewFolder.php")); ?>