From 76b316766e1e1be57b96aa68178006152b704201 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Sun, 15 Dec 2013 11:20:00 +0100 Subject: Delete FrontController.php --- lib/minz/FrontController.php | 97 -------------------------------------------- 1 file changed, 97 deletions(-) delete mode 100755 lib/minz/FrontController.php (limited to 'lib/minz/FrontController.php') diff --git a/lib/minz/FrontController.php b/lib/minz/FrontController.php deleted file mode 100755 index eb9835fe5..000000000 --- a/lib/minz/FrontController.php +++ /dev/null @@ -1,97 +0,0 @@ -. -# -# ***** END LICENSE BLOCK ***** - -/** - * La classe FrontController est le Dispatcher du framework, elle lance l'application - * Elle est appelée en général dans le fichier index.php à la racine du serveur - */ -class Minz_FrontController { - protected $dispatcher; - protected $router; - - /** - * Constructeur - * Initialise le router et le dispatcher - */ - public function __construct () { - if (LOG_PATH === false) { - $this->killApp ('Path doesn\'t exist : LOG_PATH'); - } - - try { - Minz_Configuration::init (); - - Minz_Request::init (); - - $this->router = new Minz_Router (); - $this->router->init (); - } catch (Minz_RouteNotFoundException $e) { - Minz_Log::record ($e->getMessage (), Minz_Log::ERROR); - Minz_Error::error ( - 404, - array ('error' => array ($e->getMessage ())) - ); - } catch (Minz_Exception $e) { - Minz_Log::record ($e->getMessage (), Minz_Log::ERROR); - $this->killApp ($e->getMessage ()); - } - - $this->dispatcher = Minz_Dispatcher::getInstance ($this->router); - } - - /** - * Démarre l'application (lance le dispatcher et renvoie la réponse - */ - public function run () { - try { - $this->dispatcher->run (); - Minz_Response::send (); - } catch (Minz_Exception $e) { - try { - Minz_Log::record ($e->getMessage (), Minz_Log::ERROR); - } catch (Minz_PermissionDeniedException $e) { - $this->killApp ($e->getMessage ()); - } - - if ($e instanceof Minz_FileNotExistException || - $e instanceof Minz_ControllerNotExistException || - $e instanceof Minz_ControllerNotActionControllerException || - $e instanceof Minz_ActionException) { - Minz_Error::error ( - 404, - array ('error' => array ($e->getMessage ())), - true - ); - } else { - $this->killApp (); - } - } - } - - /** - * Permet d'arrêter le programme en urgence - */ - private function killApp ($txt = '') { - if ($txt == '') { - $txt = 'See logs files'; - } - exit ('### Application problem ###
'."\n".$txt); - } -} -- cgit v1.2.3