1
0
Fork 0

Removed some 3 year old backward compatibility code.

pull/4921/head
Niels Keurentjes 2016-02-15 21:37:19 +01:00
parent d6d0435c54
commit 72a3563f1e
3 changed files with 3 additions and 47 deletions

View File

@ -175,21 +175,6 @@ class Installer
$this->mockLocalRepositories($this->repositoryManager);
}
// TODO remove this BC feature at some point
// purge old require-dev packages to avoid conflicts with the new way of handling dev requirements
$devRepo = new InstalledFilesystemRepository(new JsonFile($this->config->get('vendor-dir').'/composer/installed_dev.json'));
if ($devRepo->getPackages()) {
$this->io->writeError('<warning>BC Notice: Removing old dev packages to migrate to the new require-dev handling.</warning>');
foreach ($devRepo->getPackages() as $package) {
if ($this->installationManager->isPackageInstalled($devRepo, $package)) {
$this->installationManager->uninstall($devRepo, new UninstallOperation($package));
}
}
unlink($this->config->get('vendor-dir').'/composer/installed_dev.json');
}
unset($devRepo, $package);
// end BC
if ($this->runScripts) {
// dispatch pre event
$eventName = $this->update ? ScriptEvents::PRE_UPDATE_CMD : ScriptEvents::PRE_INSTALL_CMD;

View File

@ -153,7 +153,7 @@ class LibraryInstaller implements InstallerInterface
/**
* Returns the base path of the package without target-dir path
*
* It is used for BC as getInstallPath tends to be overriden by
* It is used for BC as getInstallPath tends to be overridden by
* installer plugins but not getPackageBasePath
*
* @param PackageInterface $package

View File

@ -236,13 +236,7 @@ class ComposerRepository extends ArrayRepository implements ConfigurableReposito
return array_keys($this->providerListing);
}
// BC handling for old providers-includes
$providers = array();
foreach (array_keys($this->providerListing) as $provider) {
$providers[] = substr($provider, 2, -5);
}
return $providers;
return array();
}
protected function configurePackageTransportOptions(PackageInterface $package)
@ -304,16 +298,8 @@ class ComposerRepository extends ArrayRepository implements ConfigurableReposito
$url = str_replace(array('%package%', '%hash%'), array($name, $hash), $this->providersUrl);
$cacheKey = 'provider-'.strtr($name, '/', '$').'.json';
} else {
// BC handling for old providers-includes
$url = 'p/'.$name.'.json';
// package does not exist in this repo
if (!isset($this->providerListing[$url])) {
return array();
}
$hash = $this->providerListing[$url]['sha256'];
$cacheKey = null;
}
$packages = null;
if ($cacheKey) {
@ -459,9 +445,6 @@ class ComposerRepository extends ArrayRepository implements ConfigurableReposito
if (!empty($data['notify-batch'])) {
$this->notifyUrl = $this->canonicalizeUrl($data['notify-batch']);
} elseif (!empty($data['notify_batch'])) {
// TODO remove this BC notify_batch support
$this->notifyUrl = $this->canonicalizeUrl($data['notify_batch']);
} elseif (!empty($data['notify'])) {
$this->notifyUrl = $this->canonicalizeUrl($data['notify']);
}
@ -557,18 +540,6 @@ class ComposerRepository extends ArrayRepository implements ConfigurableReposito
$includedData = $this->fetchFile($url, $cacheKey, $metadata['sha256']);
}
$this->loadProviderListings($includedData);
}
} elseif (isset($data['providers-includes'])) {
// BC layer for old-style providers-includes
$includes = $data['providers-includes'];
foreach ($includes as $include => $metadata) {
if ($this->cache->sha256($include) === $metadata['sha256']) {
$includedData = json_decode($this->cache->read($include), true);
} else {
$includedData = $this->fetchFile($include, null, $metadata['sha256']);
}
$this->loadProviderListings($includedData);
}
}