public function run() { $router_route = $this->router->read_routes(launcher::get_url()); if (array_key_exists('route', $router_route)) { $route = $router_route['route']; if ($route->get_allow_display_module() && array_key_exists('display_route', $router_route)) { $router_route['display_route']['route']->create_object(); $GLOBALS[$router_route['display_route']['route']->get_module_name()]->set_dir($this->modules_dir . $router_route['display_route']['route']->get_module_name()); } if ($route->get_allow_non_routing_modules() || $route->get_allow_non_routing_modules() == \routing\route::BEFORE_ONLY) { $this->load_before_modules(); } $dir = $this->modules_dir . $route->get_module_name(); $GLOBALS[$route->get_module_name()]->set_dir($dir); // tells the module object its directory $route->files->load($dir . '/'); // loads the files, giving the directory in which the files to load are if ($route->get_allow_non_routing_modules() || $route->get_allow_non_routing_modules() == \routing\route::AFTER_ONLY) { $this->load_after_modules(); } if ($route->get_allow_display_module() && array_key_exists('display_route', $router_route)) { $display_dir = $this->modules_dir . $router_route['display_route']['route']->get_module_name() . '/'; $file = $display_dir . $router_route['display_route']['files']; if (file_exists($file)) { include $file; } } } elseif (array_key_exists('module', $router_route)) { // shows it } else { // add warning : Script did nothing } }