public function removeRootInstallerDescriptor($name)
{
$this->assertInstallersLoaded();
$previouslySetInRoot = isset($this->rootInstallerDescriptors[$name]);
$previousInstaller = $previouslySetInRoot ? $this->rootInstallerDescriptors[$name] : null;
if (isset($this->installerDescriptors[$name]) && !$previouslySetInRoot) {
throw new RuntimeException(sprintf('Cannot remove installer "%s": Can only remove installers ' . 'configured in the root module.', $name));
}
if (!$previouslySetInRoot) {
return;
}
try {
unset($this->installerDescriptors[$name]);
unset($this->rootInstallerDescriptors[$name]);
$this->persistInstallersData();
} catch (Exception $e) {
if ($previouslySetInRoot) {
$this->installerDescriptors[$name] = $previousInstaller;
$this->rootInstallerDescriptors[$name] = $previousInstaller;
}
throw $e;
}
}