function fg_optional_echo_edit_content_button() { if (fg_is_logged_in_admin()) { $path_pagina = Engines::getRequestUri(); ?> <br /> <div id="modifica_contenuto_link"> <a href="/admin/modifica_contenuto.php?path_pagina=<?php echo $path_pagina; ?> ">[[ Modifica il contenuto della pagina ]]</a> </div> <br /> <?php } }
<?php /* This software is released under the BSD license. Full text at project root -> license.txt */ require_once "../../../init.php"; //Benchmark::start(__FILE__, "TOTAL_PAGE_TIME"); try { Log::info("routing", "Initializing framework."); Framework::init(); Log::info("routing", "Framework initialized"); Log::info("routing", "Executing request ..."); Engines::executeRequest(); Log::info("routing", "Request executed."); } catch (Exception $ex) { echo "Exception !! " . $ex->getMessage(); Log::print_logs_as_html_list(); } //Benchmark::stop(); //Benchmark::print_as_html_comments();
public static function dispatch() { $route_matched = false; $request_uri = Engines::getRequestUri(); foreach (self::$route_definitions as $def) { if ($def->matches($request_uri)) { $route_matched = true; $match = $def->getMatch($request_uri); $controller_name = $match->getController(); $action_name = $match->getAction(); $format_name = $match->getFormat(); CallStack::call($controller_name, $action_name, $format_name, array()); } } if (!$route_matched) { foreach (self::$route_definitions as $route_def) { echo $route_def->dump(); } Log::error("dispatch", "Mapping not found for URL : " . Engines::getRequestUri()); } }
<?php Engines::registerEngine("StaticPageEngine"); Engines::registerEngine("ActionEngine");
public function testEngineRequestUrl() { $this->assertEqual(Engines::getRequestUri(), "/" . FRAMEWORK_CORE_PATH . "tests/all_tests.php"); }
public static function getInstance() { if (self::$instance == null) { self::$instance = new Engines(); } }