* @author Jérôme Bogaerts * @deprecated use migrations instead. See https://github.com/oat-sa/generis/wiki/Tao-Update-Process */ class Updater extends common_ext_ExtensionUpdater { /** * @inheritDoc */ public function update($initialVersion) { $this->skip('2.6', '2.11.2'); if ($this->isVersion('2.11.2')) { $this->getServiceManager()->register(QtiResultsService::SERVICE_ID, new QtiResultsService()); $this->setVersion('2.12.0'); } $this->skip('2.12.0', '3.2.0'); if ($this->isVersion('3.2.0')) { $service = $this->getServiceManager()->get(QtiResultsService::SERVICE_ID); if (!$service instanceof ResultService) { $this->getServiceManager()->register(QtiResultsService::SERVICE_ID, new QtiResultsService()); } $this->setVersion('3.2.1'); } $this->skip('3.2.1', '3.3.1'); if ($this->isVersion('3.3.1')) { $this->getServiceManager()->register(ResultAliasService::SERVICE_ID, new ResultAliasService()); $this->setVersion('3.4.0'); } $this->skip('3.4.0', '5.0.2'); if ($this->isVersion('5.0.2')) { OntologyUpdater::syncModels(); $this->setVersion('5.1.0'); } $this->skip('5.1.0', '11.0.1'); if ($this->isVersion('11.0.1')) { $resultServerService = $this->safeLoadService(ResultServerService::SERVICE_ID); if (get_class($resultServerService) === 'oat\taoResultServer\models\classes\implementation\OntologyService') { $resultService = new ResultServerService([ ResultServerService::OPTION_RESULT_STORAGE => 'taoOutcomeRds/RdsResultStorage' ]); $this->getServiceManager()->register(ResultServerService::SERVICE_ID, $resultService); } OntologyUpdater::syncModels(); $this->setVersion('12.0.0'); } $this->skip('12.0.0', '12.1.1'); //Updater files are deprecated. Please use migrations. //See: https://github.com/oat-sa/generis/wiki/Tao-Update-Process $this->setVersion($this->getExtension()->getManifest()->getVersion()); } }