public static function bye_framework($successful = true) { if ($successful) { exit; } $controller = new FrameworkController(); $output = $controller->Display(FrameworkController::SHOW_MESSAGE); echo $output; exit; }
// $_GET und $_POST zusammenfasen $request = array_merge($_GET, $_POST); $files = $_FILES; include_once $_SERVER['DOCUMENT_ROOT'] . "/src/Framework/hook.php"; try { try { hi_framework(); $controllerModel = RouteService::getInstance()->getController($_SERVER['REQUEST_URI']); RuntimeService::getInstance()->setParams($_SERVER['REQUEST_URI'], $controllerModel); RuntimeService::getInstance()->setParams($_SERVER['REQUEST_URI'], $controllerModel); if ($controllerModel instanceof ControllerModel) { $controllerName = $controllerModel->getController(); $controller = new $controllerName($request, RuntimeService::getInstance()->getControllerParams(), $files); $output = $controller->Display(); echo $output; bye_framework(); } else { $controller = new FrameworkController($request, RuntimeService::getInstance()->getControllerParams(), $files); $output = $controller->Display(FrameworkController::CONTROLLER_NOT_FOUND); echo $output; bye_framework(); } } catch (Exception $ex) { LogHelper::getInstance()->logException($ex); bye_framework(false); } } catch (Exception $ex) { //this will never ever happen! echo $ex; bye_framework(); }