/** * Déroulement de la liste des routes enregistrées pour matching * * @return Route */ public function run() { if (!isset($this->routes[Request::getRequestMethod()])) { Response::json404(); } foreach ($this->routes[Request::getRequestMethod()] as $route) { if ($route->match(Request::getCurrentUri())) { return $route->call(); } } Response::json404(); }
/** * Chargement de la configuration * * @return void */ public function __construct() { $this->database = (require '../config/database.php'); $this->env = Request::getEnv(); }