コード例 #1
0
ファイル: CApp.php プロジェクト: wlmwang/simple-php-frame
 public function run($_conf = NULL)
 {
     //全局配置
     $this->setConf(self::import(__CUU__ . '/Conf/CMain.php'));
     //项目配置
     $this->setConf($_conf);
     $this->_tty = isset($_SERVER['argv']) ? CFactory::SFactory('CCli') : CFactory::SFactory('CWeb');
     $this->_router = $this->_tty->getRouter();
     $this->_controller = CFactory::createCController($this->_router['controller'], self::$_app);
     if (!$this->_controller) {
         CLog::log();
     }
     /**
      * 运行方法
      */
     if (method_exists($this->_controller, $this->_router['action'])) {
         $this->_controller->{$this->_router['action']}();
     } else {
         CLog::log();
     }
     /**
      * 善后处理
      */
 }