示例#1
0
 /**
  * Initialize application and run controllers chain.
  */
 public function run()
 {
     if (!$this->initialized) {
         $this->initialize();
     }
     $this->frontController->run();
 }
示例#2
0
 protected function checkMysql()
 {
     foreach ($this->controllerFront->getControllerChain() as $item) {
         if (get_class($item['instance']) == 'controllers\\Setup' && strtolower($item['action']) == 'actionindex') {
             return;
         }
         break;
     }
     $mysqlModel = new \tables\MysqlCredentials();
     $mysql = $mysqlModel->getMysqlConnection();
     $setupLink = $this->controllerFront->makeLink('setup/index');
     if (is_null($mysql)) {
         $this->registry->getResponse()->redirect($setupLink);
     }
     if ($mysql === false) {
         $this->registry->getFlashMessenger()->add('Cannot connect to Mysql!', 'error');
         $this->registry->getResponse()->redirect($setupLink);
     }
     $this->controllerFront->getRegistry()->getConnectionStorage()->add($mysql, db\ConnectionStorage::MYSQL, false);
     db\table\Mysql::setDefaultConnection($mysql);
 }