From 72a3563f1ef0a2132e9185285e90e15b5c9c29ef Mon Sep 17 00:00:00 2001 From: Niels Keurentjes Date: Mon, 15 Feb 2016 21:37:19 +0100 Subject: [PATCH] Removed some 3 year old backward compatibility code. --- src/Composer/Installer.php | 15 --------- src/Composer/Installer/LibraryInstaller.php | 2 +- .../Repository/ComposerRepository.php | 33 ++----------------- 3 files changed, 3 insertions(+), 47 deletions(-) diff --git a/src/Composer/Installer.php b/src/Composer/Installer.php index 78ea92c03..509c01d81 100644 --- a/src/Composer/Installer.php +++ b/src/Composer/Installer.php @@ -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('BC Notice: Removing old dev packages to migrate to the new require-dev handling.'); - 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; diff --git a/src/Composer/Installer/LibraryInstaller.php b/src/Composer/Installer/LibraryInstaller.php index 31090de00..e3cd6bd9b 100644 --- a/src/Composer/Installer/LibraryInstaller.php +++ b/src/Composer/Installer/LibraryInstaller.php @@ -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 diff --git a/src/Composer/Repository/ComposerRepository.php b/src/Composer/Repository/ComposerRepository.php index 4101d7826..ec673a62f 100644 --- a/src/Composer/Repository/ComposerRepository.php +++ b/src/Composer/Repository/ComposerRepository.php @@ -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,15 +298,7 @@ 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; + return array(); } $packages = null; @@ -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); } }