/**
  * {@inheritdoc}
  */
 public function rollback()
 {
     $rootModuleName = $this->rootModule->getName();
     $rootModuleFile = $this->rootModule->getModuleFile();
     foreach ($this->overriddenModules as $moduleName) {
         $rootModuleFile->removeOverriddenModule($moduleName);
     }
     foreach ($this->addedEdgesFrom as $moduleName) {
         $this->overrideGraph->removeEdge($moduleName, $rootModuleName);
     }
 }
 /**
  * {@inheritdoc}
  */
 public function getRootInstallerDescriptor($name)
 {
     $this->assertInstallersLoaded();
     if (!isset($this->rootInstallerDescriptors[$name])) {
         throw NoSuchInstallerException::forInstallerNameAndModuleName($name, $this->rootModule->getName());
     }
     return $this->rootInstallerDescriptors[$name];
 }
Example #3
0
 /**
  * Returns all installed modules.
  *
  * The installed modules are all modules that are not the root module.
  *
  * @return Module[] The installed modules indexed by their names.
  */
 public function getInstalledModules()
 {
     $modules = $this->modules;
     if ($this->rootModule) {
         unset($modules[$this->rootModule->getName()]);
     }
     return $modules;
 }
Example #4
0
 /**
  * {@inheritdoc}
  */
 public function getRootBindingDescriptor(Uuid $uuid)
 {
     $binding = $this->getBindingDescriptor($uuid);
     if (!$binding->getContainingModule() instanceof RootModule) {
         throw NoSuchBindingException::forUuidAndModule($uuid, $this->rootModule->getName());
     }
     return $binding;
 }
Example #5
0
 private function renameRootModule(RootModule $module, $newName)
 {
     $moduleFile = $module->getModuleFile();
     $previousName = $moduleFile->getModuleName();
     $moduleFile->setModuleName($newName);
     try {
         $this->moduleFileStorage->saveRootModuleFile($this->rootModuleFile);
     } catch (Exception $e) {
         $moduleFile->setModuleName($previousName);
         throw $e;
     }
     $this->modules->remove($module->getName());
     $this->modules->add(new RootModule($moduleFile, $module->getInstallPath()));
 }
Example #6
0
 /**
  * {@inheritdoc}
  */
 public function hasRootPathMapping($repositoryPath)
 {
     return $this->hasPathMapping($repositoryPath, $this->rootModule->getName());
 }