public function execute() { if ($this->vNew->getVid() == $this->vCurr->getVid()) { echo "Current system is the same version as the version installed. Upgrade is aborted.\n"; return; } $handler = CalemUpgradeMap::getHandler($this->vNew, $this->vCurr); if (!$handler) { echo "No handler is found for upgrading from " . $this->vCurr->getVid() . ' to ' . $this->vNew->getVid() . "\n"; return; } $results = $handler->upgrade(); return $results; }
public function getUpgradeHdlr($newVersion, $currVersion) { $rtn = null; if ($currVersion) { require_once _CALEM_DIR_ . 'server/upgrade/CalemUpgradeMap.php'; $rtn = CalemUpgradeMap::getHandler($newVersion, $currVersion); } if ($this->logger->isInfoEnabled()) { $this->logger->info('newVer=' . $newVersion->getVid() . ", currVer=" . ($currVersion ? $currVersion->getVid() : '') . ', hdlr=' . ($rtn ? get_class($rtn) : '')); } return $rtn; }