Esempio n. 1
0
 public function run()
 {
     if ($this->_config->getConfigFolder() == null) {
         $this->_config->setConfigFolder('../config');
     }
     $this->_frontController = \GF\FrontController::GetInstance();
     $this->_frontController->dispatch();
     echo 'kkk';
 }
Esempio n. 2
0
 /**
  * @throws \Exception
  */
 public function run()
 {
     $this->frontController = \GF\FrontController::getInstance();
     if ($this->router instanceof \GF\Routers\iRouter) {
         $this->frontController->setRouter($this->router);
     } else {
         if ($this->router == 'JsonRPCRouter') {
             //TODO fix it when RPC is done
             $this->frontController->setRouter(new \GF\Routers\DefaultRouter());
         } else {
             if ($this->router == 'CLIRouter') {
                 //TODO fix it when CLI is done
                 $this->frontController->setRouter(new \GF\Routers\DefaultRouter());
             } else {
                 $this->frontController->setRouter(new \GF\Routers\DefaultRouter());
             }
         }
     }
     $_sess = $this->config->app['session'];
     if ($_sess['autostart']) {
         if ($_sess['type'] == 'native') {
             $_s = new \GF\Sessions\NativeSession($_sess['name'], $_sess['lifetime'], $_sess['path'], $_sess['domain'], $_sess['secure']);
         } else {
             if ($_sess['type'] == 'database') {
                 $_s = new \GF\Sessions\DBSession($_sess['dbConnection'], $_sess['name'], $_sess['dbTable'], $_sess['lifetime'], $_sess['path'], $_sess['domain'], $_sess['secure']);
             } else {
                 //TODO
                 throw new Exception('No valid session', 500);
             }
         }
         $this->setSession($_s);
     }
     $this->frontController->dispatch();
 }