SAAS-547: Refactor upgrade procedure in 2.5.x-installer branch

* Start using "schema_version" key instead of "system_version"
* Refactored the upgrade code a bit and make it be automatically invoked
  from the Zend bootstrap if a schema update is needed.
* Fixed error logging in certain cases
* Fixed an exception in Show related to image_path
This commit is contained in:
Albert Santoni 2015-01-19 13:41:23 -05:00
parent 5abe364a69
commit 2cb26db84b
7 changed files with 81 additions and 34 deletions

View file

@ -13,25 +13,19 @@ class UpgradeController extends Zend_Controller_Action
return;
}
$upgraders = array();
array_push($upgraders, new AirtimeUpgrader252());
/* These upgrades do not apply to open source Airtime yet.
array_push($upgraders, new AirtimeUpgrader253());
array_push($upgraders, new AirtimeUpgrader254());
*/
$didWePerformAnUpgrade = false;
try {
$upgradeManager = new UpgradeManager();
$didWePerformAnUpgrade = $upgradeManager->runUpgrades($upgraders, __DIR__);
$didWePerformAnUpgrade = $upgradeManager->doUpgrade();
if (!$didWePerformAnUpgrade) {
$this->getResponse()
->setHttpResponseCode(200)
->appendBody("No upgrade was performed. The current Airtime version is " . AirtimeUpgrader::getCurrentVersion() . ".<br>");
->appendBody("No upgrade was performed. The current schema version is " . Application_Model_Preference::GetSchemaVersion() . ".<br>");
} else {
$this->getResponse()
->setHttpResponseCode(200)
->appendBody("Upgrade to Airtime " . $upgrader->getNewVersion() . " OK<br>");
->appendBody("Upgrade to Airtime schema version " . Application_Model_Preference::GetSchemaVersion() . " OK<br>");
}
}
catch (Exception $e)