Returns the install info of an installed module.
public getInstallInfo ( string $moduleName ) : Puli\Manager\Api\Module\InstallInfo | ||
$moduleName | string | The module name. |
return | Puli\Manager\Api\Module\InstallInfo | The install info. |
/** * {@inheritdoc} */ public function removeModule($name) { // Only check that this is a string. The error message "not found" is // more helpful than e.g. "module name must contain /". Assert::string($name, 'The module name must be a string. Got: %s'); $this->assertModulesLoaded(); if ($this->rootModuleFile->hasInstallInfo($name)) { $installInfo = $this->rootModuleFile->getInstallInfo($name); $this->rootModuleFile->removeInstallInfo($name); try { $this->moduleFileStorage->saveRootModuleFile($this->rootModuleFile); } catch (Exception $e) { $this->rootModuleFile->addInstallInfo($installInfo); throw $e; } } $this->modules->remove($name); }
/** * {@inheritdoc} */ public function removeObsoleteDisabledBindingDescriptors() { $this->assertModulesLoaded(); $removedUuidsByModule = array(); try { foreach ($this->rootModuleFile->getInstallInfos() as $installInfo) { foreach ($installInfo->getDisabledBindingUuids() as $uuid) { if (!$this->bindingDescriptors->contains($uuid)) { $installInfo->removeDisabledBindingUuid($uuid); $removedUuidsByModule[$installInfo->getModuleName()][] = $uuid; } } } $this->saveRootModuleFile(); } catch (Exception $e) { foreach ($removedUuidsByModule as $moduleName => $removedUuids) { $installInfo = $this->rootModuleFile->getInstallInfo($moduleName); foreach ($removedUuids as $uuid) { $installInfo->addDisabledBindingUuid($uuid); } } throw $e; } }