Example #1
0
 public function run()
 {
     if ($this->_config->getConfigFolder() == null) {
         $this->_config->setConfigFolder('../config');
     }
     $this->_frontController = \GF\FrontController::GetInstance();
     $this->_frontController->dispatch();
     echo 'kkk';
 }
Example #2
0
 public function run()
 {
     //if config folder is not set, use defaultone
     if ($this->_config->getConfigFolder() == null) {
         $this->setConfigFolder('../config');
     }
     $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 RPC 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\Session\NativeSession($_sess['name'], $_sess['lifetime'], $_sess['path'], $_sess['domain'], $_sess['secure']);
         } else {
             if ($_sess['type'] == 'database') {
                 $_s = new \GF\Session\DBSession($_sess['dbConnection'], $_sess['name'], $_sess['dbTable'], $_sess['lifetime'], $_sess['path'], $_sess['domain'], $_sess['secure']);
             } else {
                 throw new \Exception('No valid session', 500);
             }
         }
         $this->setSession($_s);
     }
     $this->_frontController->dispatch();
 }