/**
  * route Handles incoming requests. 
  * 
  * @access public
  * @return void
  */
 public function route()
 {
     global $logger;
     try {
         // TODO : Refactor Code :
         // $url    = URLParser::parse();
         // $route  = RouteMapper::getRoute($url['route']);
         // $router = new Router();
         // $router->route($route);
         $urlInterpreter = new UrlInterpreter();
         $command = $urlInterpreter->getCommand();
         $router = new Router($command);
         $logger->debug('Routing to : ' . $command->getControllerName());
         $router->route();
     } catch (Exception $e) {
         throw new RouteNotFoundException();
     }
 }
Ejemplo n.º 2
0
<?php

/**
 * @Name: index.php
 * @File Description:  
 * @link http://www.a2big.com/ 
 * @author jhkang,kang <*****@*****.**>
 * @Update: 2015-12-18
 * @version 1.0
 * @Copyright 2012 a2big.com
 */
include_once dirname(__FILE__) . "/a2bigPHP/include/index.php";
include_once "urls.php";
include_once "views.php";
require "settings.php";
$myController = new MyController();
//$myController->invoke('aaa',array('faaa','nnnn'));
$urlInterpreter = new UrlInterpreter();
$command = $urlInterpreter->getCommand();
$commandDispatcher = new CommandDispatcher($command, $url, $myController);
$commandDispatcher->Dispatch();
?>