* @deprecated use migrations instead. See https://github.com/oat-sa/generis/wiki/Tao-Update-Process */ class taoItems_scripts_update_Updater extends common_ext_ExtensionUpdater { /** * @param $initialVersion * @return string|void * @throws common_Exception */ public function update($initialVersion) { if ($this->isBetween('0.0.0', '2.8.0')) { throw new common_exception_NotImplemented('Updates from versions prior to Tao 3.1 are not longer supported, please update to Tao 3.1 first'); } $this->skip('2.8.1', '2.22.3'); if ($this->isVersion('2.22.3')) { OntologyUpdater::syncModels(); $categoryService = new CategoryService(); $categoryService->setServiceManager($this->getServiceManager()); $this->getServiceManager()->register(CategoryService::SERVICE_ID, $categoryService); $this->setVersion('2.23.0'); } if ($this->isVersion('2.23.0')) { OntologyUpdater::syncModels(); $this->setVersion('2.24.0'); } $this->skip('2.24.0', '5.5.1'); if ($this->isVersion('5.5.1')) { OntologyUpdater::syncModels(); $this->setVersion('5.6.0'); } $this->skip('5.6.0', '5.9.0'); if ($this->isVersion('5.9.0')) { AclProxy::applyRule(new AccessRule('grant', TaoRoles::REST_PUBLISHER, ['ext' => 'taoItems', 'mod' => 'RestItems'])); AclProxy::applyRule(new AccessRule('grant', TaoRoles::REST_PUBLISHER, ['ext' => 'taoItems', 'mod' => 'RestFormItem'])); $this->setVersion('5.10.0'); } if ($this->isVersion('5.10.0')) { $replacementService = new NoneItemReplacement(); $this->getServiceManager()->register(ItemAssetsReplacement::SERVICE_ID, $replacementService); $this->setVersion('5.11.0'); } $this->skip('5.11.0', '5.12.2'); if ($this->isVersion('5.12.2')) { $itemPreviewerService = new ItemPreviewerService(); $this->getServiceManager()->register(ItemPreviewerService::SERVICE_ID, $itemPreviewerService); $this->setVersion('5.13.0'); } $this->skip('5.13.0', '6.0.0'); if ($this->isVersion('6.0.0')) { OntologyUpdater::syncModels(); $this->setVersion('6.1.0'); } $this->skip('6.1.0', '8.2.1'); if ($this->isVersion('8.2.1')) { $assetService = $this->getServiceManager()->get(AssetService::SERVICE_ID); $taoItemsNpmDist = $assetService->getJsBaseWww('taoItems') . 'node_modules/@oat-sa/tao-item-runner/dist/'; $clientLibRegistry = ClientLibRegistry::getRegistry(); $clientLibRegistry->register('taoItems/assets', $taoItemsNpmDist . 'assets'); $clientLibRegistry->register('taoItems/runner', $taoItemsNpmDist . 'runner'); $clientLibRegistry->register('taoItems/scoring', $taoItemsNpmDist . 'scoring'); $this->setVersion('9.0.0'); } $this->skip('9.0.0', '10.7.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()); } }