Esempio n. 1
0
 public function start()
 {
     try {
         Database::createNonExistingDatabase(DatabaseConfig::DB_NAME);
         Database::setInstance(DatabaseConfig::DB_INSTANCE, DatabaseConfig::DB_DRIVER, DatabaseConfig::DB_USER, DatabaseConfig::DB_PASS, DatabaseConfig::DB_NAME, DatabaseConfig::DB_HOST);
     } catch (\Exception $e) {
         require_once "error.php";
         exit;
     }
     Manager::getInstance()->start();
     HttpContext::getInstance()->getIdentity()->setCurrentUser();
     $this->frontController->dispatch();
 }
Esempio n. 2
0
 public function run()
 {
     if ($this->_config->getConfigFolder() == null) {
         $this->setConfigFolder('../config');
     }
     $this->_frontController = FrontController::getInstance();
     if ($this->router instanceof IRouter) {
         $this->_frontController->setRouter($this->router);
     } else {
         if ($this->router == 'JsonRPCRouter') {
             $this->_frontController->setRouter(new JsonRPCRouter());
         } else {
             $this->_frontController->setRouter(new DefaultRouter());
         }
     }
     $_sess = $this->_config->app['session'];
     if ($_sess['autostart']) {
         if ($_sess['type'] == 'native') {
             $s = new NativeSession($_sess['name'], $_sess['lifetime'], $_sess['path'], $_sess['domain'], $_sess['secure']);
         }
         $this->setSession($s);
     }
     $this->overrideRoutes();
     $this->_frontController->dispatch();
 }
Esempio n. 3
0
 public function run()
 {
     if ($this->_config->getConfigFolder() == null) {
         $this->setConfigFolder('../config');
     }
     $this->_frontController = FrontController::getInstance();
     if ($this->_router instanceof IRouter) {
         $this->_frontController->setRouter($this->_router);
     } else {
         if ($this->_router == 'JsonRPCRouter') {
             $this->_frontController->setRouter(new DefaultRouter());
         } else {
             if ($this->_router == 'CLIRouter') {
                 $this->_frontController->setRouter(new DefaultRouter());
             } else {
                 $this->_frontController->setRouter(new DefaultRouter());
             }
         }
     }
     $sessionConfig = $this->_config->app['session'];
     if ($sessionConfig['autostart']) {
         if ($sessionConfig['type'] == 'native') {
             $usableSession = new NativeSession($sessionConfig['name'], $sessionConfig['lifetime'], $sessionConfig['path'], $sessionConfig['domain'], $sessionConfig['secure']);
         } else {
             if ($sessionConfig['type'] == 'database') {
                 $usableSession = new DatabaseSession($sessionConfig['databaseConnection'], $sessionConfig['name'], $sessionConfig['databaseTable'], $sessionConfig['lifetime'], $sessionConfig['path'], $sessionConfig['domain'], $sessionConfig['secure']);
             } else {
                 throw new \Exception('No valid sessionConfig', 500);
             }
         }
         $this->setSession($usableSession);
     }
     $this->_frontController->dispatch();
 }
Esempio n. 4
0
 public function run()
 {
     if ($this->config->getConfigFolder() == null) {
         $this->setConfigFolder('../config');
     }
     $this->frontController = \Framework\FrontController::getInstance();
     if ($this->router instanceof \Framework\Routers\IRouter) {
         $this->frontController->setRouter($this->router);
     } else {
         if ($this->router == 'JsonRpcRouter') {
             $this->frontController->setRouter(new \Framework\Routers\JsonRpcRouter());
         } else {
             $this->frontController->setRouter(new \Framework\Routers\DefaultRouter());
         }
     }
     $sess = $this->config->app['session'];
     if ($sess['autostart']) {
         if ($sess['type'] == 'native') {
             $s = new \Framework\Sessions\NativeSession($sess['name'], $sess['lifetime'], $sess['path'], $sess['domain'], $sess['secure']);
         } else {
             if ($sess['type'] = 'database') {
                 $s = new \Framework\Sessions\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();
 }
Esempio n. 5
0
 public function run()
 {
     if (!$this->_config->getConfigFolder()) {
         $this->setConfigFolder('../config');
     }
     $this->_fornt_controller = \Framework\FrontController::getInstance();
     $this->_fornt_controller->dispatch();
 }
Esempio n. 6
0
 public function run()
 {
     if ($this->_config->getConfigFolder() == null) {
         $this->setConfigFolder('../config');
     }
     $this->_frontController = FrontController::getInstance();
     if ($this->_router instanceof IRouter) {
         $this->_frontController->setRouter($this->_router);
     }
     if ($this->_router == null) {
         // Can add here more routers
         $this->_frontController->setRouter(new DefaultRouter());
     }
     if ($this->_session == null) {
         $sessionInfo = $this->_config->app['session'];
         if ($sessionInfo['auto_start']) {
             if ($sessionInfo['type'] == 'native') {
                 $this->_session = new NativeSession($sessionInfo['name'], $sessionInfo['lifetime'], $sessionInfo['path'], $sessionInfo['domain'], $sessionInfo['secure']);
             }
         }
     }
     $this->_frontController->dispatch();
 }