public function completeAction()
{
ini_set('max_execution_time', 100);
$this->checkInstall(6);
if ($this->getRequest()->isXmlHttpRequest()) {
if ($this->getRequest()->isPost()) {
$session = $this->getSession();
$dbAdapter = new DbAdapter($session['install']['db']);
$dbAdapter->getDriver()->getConnection()->connect();
GlobalAdapterFeature::setStaticAdapter($dbAdapter);
$step = $this->getRequest()->getPost()->get('step');
$sqlType = str_replace('pdo_', '', $session['install']['db']['driver']);
try {
switch ($step) {
//Create database
case 'c-db':
$this->createDatabase($dbAdapter, $sqlType);
break;
//Insert data
//Insert data
case 'i-d':
$this->insertData($dbAdapter, $session);
break;
//Insert data
//Insert data
case 'i-t':
$this->insertTranslations($session['install']['configuration']);
break;
//Create user and roles
//Create user and roles
case 'c-uar':
$this->createUsersAndRoles($dbAdapter, $session['install']['configuration'], $sqlType);
break;
//Install template
//Install template
case 'it':
$this->installTemplate($dbAdapter, $session['install']['configuration']['template'], $sqlType);
break;
//Create configuration file
//Create configuration file
case 'c-cf':
return $this->completeInstallation($session['install']['db']);
}
} catch (Exception $e) {
return $this->returnJson(array('success' => false, 'message' => $e->getMessage()));
}
return $this->returnJson(array('success' => true));
}
}
}