* @deprecated use migrations instead. See https://github.com/oat-sa/generis/wiki/Tao-Update-Process */ class Updater extends common_ext_ExtensionUpdater { /** * @param string $initialVersion * * @return string $versionUpdatedTo * @throws common_Exception */ public function update($initialVersion) { if ($this->isBetween('1.0.0', '2.0.0')) { throw new NotImplementedException('Updates from versions prior to 2.0.0 are not longer supported'); } $this->skip('2.0.0', '2.1.2'); if ($this->isVersion('2.1.2')) { $fss = $this->getServiceManager()->get(FileSystemService::SERVICE_ID); $fss->createFileSystem(RepositoryService::FILE_SYSTEM_NAME, 'tao/revisions'); $this->getServiceManager()->register(FileSystemService::SERVICE_ID, $fss); $repositoryService = $this->getServiceManager()->get(RepositoryInterface::SERVICE_ID); $repositoryService->setOption(RepositoryService::OPTION_FILE_SYSTEM, RepositoryService::FILE_SYSTEM_NAME); $this->getServiceManager()->register(RepositoryInterface::SERVICE_ID, $repositoryService); $this->setVersion('2.2.0'); } $this->skip('2.2.0', '7.1.0'); if ($this->isVersion('7.1.0')) { $repositoryService = $this->getServiceManager()->get(RepositoryInterface::SERVICE_ID); $revisionStorageService = $this->getServiceManager()->get( $repositoryService->getOption(RepositoryService::OPTION_STORAGE) ); $this->getServiceManager()->register(RepositoryInterface::SERVICE_ID, new RepositoryService([ RepositoryService::OPTION_STORAGE => $revisionStorageService, RepositoryService::OPTION_FILE_SYSTEM => $repositoryService->getOption(RepositoryService::OPTION_FILE_SYSTEM), ])); $this->getServiceManager()->unregister(RevisionStorageInterface::SERVICE_ID); $triplesManagerService = new TriplesManagerService(); $this->getServiceManager()->register(TriplesManagerService::SERVICE_ID, $triplesManagerService); $this->setVersion('8.0.0'); } $this->skip('8.0.0','8.7.0'); //Updater files are deprecated. Please use migrations. //See: https://github.com/oat-sa/generis/wiki/Tao-Update-Process $this->setVersion($this->getExtension()->getManifest()->getVersion()); } }