1) { unset($url[0]); $url = array_values($url); } //url -> www.site.com/class/function/param if (file_exists("system/controllers/" . $url[0] . ".php")) { require_once("system/controllers/" . $url[0] . ".php"); $controller = new $url[0](); if (count($url) == 1) { $controller->view(); } else if (!empty($url[3])) { $controller->{$url[1]}($url[2]); } else if (!empty($url[2])) { $controller->{$url[1]}($url[2]); } else if (!method_exists($controller, $url[1])) { if (method_exists($controller, "view")) { $controller->{'view'}($url[1]); } else { Helper::controller("content", "view", $_GET['url']); } } else if (!empty($url[1])) { $controller->{$url[1]}(); } } else { Helper::controller("content", "view", $_GET['url']); } } else { Helper::controller("content", "home", "home"); } $html = ob_get_contents(); ob_end_clean(); echo empty($GLOBALS["admin"]) ? Crawl::parse($html) : $html; session_write_close(); //echo "Usage Memory: ".round(memory_get_usage() / 1024, 2). " kb\n"; //echo "Peak Memory: ".round(memory_get_peak_usage()/1024, 2). " kb\n"; //print_r(Database::$sqlcalls); /* echo str_replace(["",""],"", $html); if ($GLOBALS["scripts"]) { foreach($GLOBALS["scripts"] as $key => $scripts) { foreach($scripts as $index => $script) { ?> "; */