Skip to content

Commit

Permalink
Refs #4990 More fixes to make installer bullet proof
Browse files Browse the repository at this point in the history
  • Loading branch information
mattab committed May 5, 2014
1 parent b3cac10 commit ce1ed12
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 14 deletions.
2 changes: 1 addition & 1 deletion core/Version.php
Expand Up @@ -21,5 +21,5 @@ final class Version
* The current Piwik version.
* @var string
*/
const VERSION = '2.2.1-rc1';
const VERSION = '2.2.1-rc2';
}
37 changes: 26 additions & 11 deletions plugins/Installation/Controller.php
Expand Up @@ -106,6 +106,8 @@ function systemCheck()
{
$this->checkPiwikIsNotInstalled();

$this->deleteConfigFileIfNeeded();

$view = new View(
'@Installation/systemCheck',
$this->getInstallationSteps(),
Expand Down Expand Up @@ -154,7 +156,6 @@ function databaseSetup()

Db::get()->checkClientVersion();

$this->deleteConfigFileIfNeeded();
$this->createConfigFile($dbInfos);

$this->redirectToNextStep(__FUNCTION__);
Expand Down Expand Up @@ -208,7 +209,10 @@ function tablesCreation()
DbHelper::createTables();
DbHelper::createAnonymousUser();

$this->updateComponents();

Updater::recordComponentSuccessfullyUpdated('core', Version::VERSION);

$view->tablesCreated = true;
$view->showNextStep = true;
}
Expand All @@ -229,20 +233,13 @@ function reuseTables()
'tablesCreation'
);

Access::getInstance();
Piwik::setUserHasSuperUserAccess();

$updater = new Updater();
$componentsWithUpdateFile = CoreUpdater::getComponentUpdates($updater);

if (empty($componentsWithUpdateFile)) {
return $this->redirectToNextStep('tablesCreation');
$result = $this->updateComponents();
if($result === false) {
$this->redirectToNextStep('tablesCreation');
}

$oldVersion = Option::get('version_core');

$result = CoreUpdater::updateComponents($updater, $componentsWithUpdateFile);

$view->coreError = $result['coreError'];
$view->warningMessages = $result['warnings'];
$view->errorMessages = $result['errors'];
Expand Down Expand Up @@ -693,4 +690,22 @@ protected function registerNewsletter($email, $newsletterSecurity, $newsletterCo
}
}

/**
* @return array|bool
*/
protected function updateComponents()
{
Access::getInstance();
Piwik::setUserHasSuperUserAccess();

$updater = new Updater();
$componentsWithUpdateFile = CoreUpdater::getComponentUpdates($updater);

if (empty($componentsWithUpdateFile)) {
return false;
}
$result = CoreUpdater::updateComponents($updater, $componentsWithUpdateFile);
return $result;
}

}
2 changes: 1 addition & 1 deletion plugins/TreemapVisualization
2 changes: 1 addition & 1 deletion tests/PHPUnit/UI
Submodule UI updated from 59f389 to 5a1919

0 comments on commit ce1ed12

Please sign in to comment.