public static function main($uri) { if (file_exists('application/bootstrap.php')) { include 'application/bootstrap.php'; } $routes = json_decode(file_get_contents('application/routes.json')); foreach ($routes as $route) { Route::add($route); } $route = Route::find($uri); if ($route) { self::$arguments = $route->arguments; foreach ($route->initialNodes as $init) { Node\NodeMachine::run($init); } $output = Node\NodeMachine::run($route->nodes); echo $output; } else { echo 404; } }
/** * @param Kernel $Kernel */ public static function setInstance(Kernel $Kernel) { self::$Instance = $Kernel; }