index.php
@@ -1,10 +1,24 @@ <?php declare(strict_types= 1); $show_errors = true; if($show_errors) { ini_set("display_errors", "1"); }else{ ini_set("display_errors","0"); } spl_autoload_register(function ($class) { require "src/". str_replace("\\", "/", $class). ".php"; }); $path = parse_url($_SERVER["REQUEST_URI"], PHP_URL_PATH); if ($path === false) { throw new UnexpectedValueException("Malformed URL: {$_SERVER["REQUEST_URI"]}"); } $segments = explode("/", $path); $router = new Framework\Router;