示例#1
0
 public function dispatch()
 {
     try {
         $map = (include ROOT_DIR . '/conf/routes.php');
         SRoutes::initialize($map);
         SLocale::initialize();
         $request = new SRequest();
         $response = new SResponse();
         if (file_exists($path = APP_DIR . '/controllers/application_controller.php')) {
             require_once $path;
         }
         if (file_exists($path = APP_DIR . '/helpers/application_helper.php')) {
             require_once $path;
         }
         SActionController::factory(SRoutes::recognize($request), $response)->out();
     } catch (Exception $e) {
         SActionController::processWithException($request, $response, $e)->out();
     }
 }