protected function makeUpdate(InputInterface $input, OutputInterface $output, $doDryRun)
{
$this->checkAllRequiredOptionsAreNotEmpty($input);
$updater = $this->makeUpdaterInstance($output);
$componentsWithUpdateFile = $updater->getComponentUpdates();
if (empty($componentsWithUpdateFile)) {
throw new NoUpdatesFoundException("Everything is already up to date.");
}
$output->writeln(array("", " *** " . Piwik::translate('CoreUpdater_UpdateTitle') . " ***"));
// handle case of existing database with no tables
if (!DbHelper::isInstalled()) {
$this->handleCoreError($output, Piwik::translate('CoreUpdater_EmptyDatabaseError', Config::getInstance()->database['dbname']));
return;
}
$output->writeln(array("", " " . Piwik::translate('CoreUpdater_DatabaseUpgradeRequired'), "", " " . Piwik::translate('CoreUpdater_YourDatabaseIsOutOfDate')));
if ($this->isUpdatingCore($componentsWithUpdateFile)) {
$currentVersion = $this->getCurrentVersionForCore($updater);
$output->writeln(array("", " " . Piwik::translate('CoreUpdater_PiwikWillBeUpgradedFromVersionXToVersionY', array($currentVersion, Version::VERSION))));
}
$pluginsToUpdate = $this->getPluginsToUpdate($componentsWithUpdateFile);
if (!empty($pluginsToUpdate)) {
$output->writeln(array("", " " . Piwik::translate('CoreUpdater_TheFollowingPluginsWillBeUpgradedX', implode(', ', $pluginsToUpdate))));
}
$dimensionsToUpdate = $this->getDimensionsToUpdate($componentsWithUpdateFile);
if (!empty($dimensionsToUpdate)) {
$output->writeln(array("", " " . Piwik::translate('CoreUpdater_TheFollowingDimensionsWillBeUpgradedX', implode(', ', $dimensionsToUpdate))));
}
$output->writeln("");
if ($doDryRun) {
$this->doDryRun($updater, $output);
} else {
$this->doRealUpdate($updater, $componentsWithUpdateFile, $output);
}
}