isBetween('0.0.0', '0.2.5')) { 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('0.3.0', '9.4.0'); if ($this->isVersion('9.4.0')) { OntologyUpdater::syncModels(); $this->getServiceManager()->register( MediaRelationRepositoryInterface::SERVICE_ID, new RdfMediaRelationRepository() ); $eventManager = $this->getServiceManager()->get(EventManager::SERVICE_ID); $eventManager->attach(ItemUpdatedEvent::class, [MediaRelationListener::class, 'whenItemIsUpdated']); $eventManager->attach(ItemRemovedEvent::class, [MediaRelationListener::class, 'whenItemIsRemoved']); $eventManager->attach(MediaRemovedEvent::class, [MediaRelationListener::class, 'whenMediaIsRemoved']); $eventManager->attach(MediaSavedEvent::class, [MediaRelationListener::class, 'whenMediaIsSaved']); $this->getServiceManager()->register(EventManager::SERVICE_ID, $eventManager); /** @var FileSystemService $filesystemService */ $filesystemService = $this->getServiceManager()->get(FileSystemService::SERVICE_ID); /** @var $adapters */ if ($filesystemService->hasDirectory('memory')) { $dirs = $filesystemService->getOption(FileSystemService::OPTION_DIRECTORIES); $dirs[CommandFactory::DEFAULT_DIRECTORY] = 'memory'; $filesystemService->setOption(FileSystemService::OPTION_DIRECTORIES, $dirs); } else { $fileSystem = $filesystemService->createFileSystem(CommandFactory::DEFAULT_DIRECTORY); } $this->getServiceManager()->register(FileSystemService::SERVICE_ID, $filesystemService); $this->setVersion('10.0.0'); } $this->skip('10.0.0', '10.2.0'); if ($this->isVersion('10.2.0')) { $originalMediaService = $this->getServiceManager()->get(MediaService::SERVICE_ID); $cleanedMediaService = new MediaService( [ MediaService::OPTION_SOURCE => $originalMediaService->getOption(MediaService::OPTION_SOURCE), ] ); $this->getServiceManager()->register(MediaService::SERVICE_ID, $cleanedMediaService); $this->setVersion('11.0.0'); } $this->skip('11.0.0', '11.0.3'); //Updater files are deprecated. Please use migrations. //See: https://github.com/oat-sa/generis/wiki/Tao-Update-Process $this->setVersion($this->getExtension()->getManifest()->getVersion()); } }