getUri(); if($uri->getBasePath()) $file = $uri->getPath(); else $file = substr($uri->getPath(), 1); if(file_exists($file) && is_file($file)) { $_SERVER['SCRIPT_FILENAME'] = basename($file); include($file); exit; } // print_r($request->getUri()); // exit; return $c['response'] ->withStatus(302) ->withHeader('Location', isset($settings->_siteDefaultPage) && strlen($settings->_siteDefaultPage)>0 ? $settings->_httpRoot.$settings->_siteDefaultPage : $settings->_httpRoot."out/out.ViewFolder.php"); }; }; $app = new \Slim\App($c); if(isset($GLOBALS['SEEDDMS_HOOKS']['initDMS'])) { foreach($GLOBALS['SEEDDMS_HOOKS']['initDMS'] as $hookObj) { if (method_exists($hookObj, 'addRoute')) { $hookObj->addRoute(array('dms'=>$dms, 'app'=>$app, 'settings'=>$settings)); } else { include("inc/inc.Authentication.php"); if (method_exists($hookObj, 'addRouteAfterAuthentication')) { $hookObj->addRouteAfterAuthentication(array('dms'=>$dms, 'app'=>$app, 'settings'=>$settings, 'user'=>$user)); } } } } /* $app->get('/out/[{path:.*}]', function($request, $response, $path = null) use ($app) { $uri = $request->getUri(); if($uri->getBasePath()) $file = $uri->getPath(); else $file = substr($uri->getPath(), 1); if(file_exists($file) && is_file($file)) { $_SERVER['SCRIPT_FILENAME'] = basename($file); include($file); exit; } }); */ $app->run(); } else { header("Location: ". (isset($settings->_siteDefaultPage) && strlen($settings->_siteDefaultPage)>0 ? $settings->_siteDefaultPage : "out/out.ViewFolder.php")); ?>