public function saveAction(Request $request) { try { BigBrother::updateConfig($request->request->all()); DbConnection::getInstance()->getConnection(); BigBrother::saveConfig(); $installer = new Installer(); $installer->run(); } catch (Exception $e) { $request->getSession()->set('message', 'Can\'t connect to database. Please try again.'); } return $this->RedirectToRoute('lancer_lance_install'); }
protected function _install($installNode) { try { if (version_compare($installNode->version, $this->config->version) > 0) { DbConnection::getInstance()->getConnection()->beginTransaction(); foreach ($installNode->tasks[0] as $task) { DbConnection::getInstance()->getConnection()->query((string) $task); } DbConnection::getInstance()->getConnection()->commit(); $this->config->version = $installNode->version; BigBrother::updateConfig($this->config); } } catch (\Exception $e) { DbConnection::getInstance()->getConnection()->rollBack(); throw new \Exception("Install problems. Please check install content and repeat."); } }