commit
aea6045668
|
@ -104,6 +104,9 @@ EOT
|
||||||
|
|
||||||
$this->updatePreferredOptions($config, $input, $preferSource, $preferDist, true);
|
$this->updatePreferredOptions($config, $input, $preferSource, $preferDist, true);
|
||||||
|
|
||||||
|
if ($input->getOption('dev')) {
|
||||||
|
$io->writeError('<warning>You are using the deprecated option "dev". Dev packages are installed by default now.</warning>');
|
||||||
|
}
|
||||||
if ($input->getOption('no-custom-installers')) {
|
if ($input->getOption('no-custom-installers')) {
|
||||||
$io->writeError('<warning>You are using the deprecated option "no-custom-installers". Use "no-plugins" instead.</warning>');
|
$io->writeError('<warning>You are using the deprecated option "no-custom-installers". Use "no-plugins" instead.</warning>');
|
||||||
$input->setOption('no-plugins', true);
|
$input->setOption('no-plugins', true);
|
||||||
|
|
|
@ -62,16 +62,6 @@ class DefaultPolicy implements PolicyInterface
|
||||||
return $pool->getPriority($package->getRepository());
|
return $pool->getPriority($package->getRepository());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @deprecated Method has been renamed to selectPreferredPackages, you should update usages
|
|
||||||
*/
|
|
||||||
public function selectPreferedPackages(Pool $pool, array $installedMap, array $literals, $requiredPackage = null)
|
|
||||||
{
|
|
||||||
trigger_error('Method selectPreferedPackages is deprecated and replaced by selectPreferredPackages, please update your usage', E_USER_DEPRECATED);
|
|
||||||
|
|
||||||
return $this->selectPreferredPackages($pool, $installedMap, $literals, $requiredPackage);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function selectPreferredPackages(Pool $pool, array $installedMap, array $literals, $requiredPackage = null)
|
public function selectPreferredPackages(Pool $pool, array $installedMap, array $literals, $requiredPackage = null)
|
||||||
{
|
{
|
||||||
$packages = $this->groupLiteralsByNamePreferInstalled($pool, $installedMap, $literals);
|
$packages = $this->groupLiteralsByNamePreferInstalled($pool, $installedMap, $literals);
|
||||||
|
|
|
@ -147,14 +147,6 @@ class Rule
|
||||||
return !(($this->bitfield & (255 << self::BITFIELD_DISABLED)) >> self::BITFIELD_DISABLED);
|
return !(($this->bitfield & (255 << self::BITFIELD_DISABLED)) >> self::BITFIELD_DISABLED);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @deprecated Use public literals member
|
|
||||||
*/
|
|
||||||
public function getLiterals()
|
|
||||||
{
|
|
||||||
return $this->literals;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function isAssertion()
|
public function isAssertion()
|
||||||
{
|
{
|
||||||
return 1 === count($this->literals);
|
return 1 === count($this->literals);
|
||||||
|
|
|
@ -175,21 +175,6 @@ class Installer
|
||||||
$this->mockLocalRepositories($this->repositoryManager);
|
$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) {
|
if ($this->runScripts) {
|
||||||
// dispatch pre event
|
// dispatch pre event
|
||||||
$eventName = $this->update ? ScriptEvents::PRE_UPDATE_CMD : ScriptEvents::PRE_INSTALL_CMD;
|
$eventName = $this->update ? ScriptEvents::PRE_UPDATE_CMD : ScriptEvents::PRE_INSTALL_CMD;
|
||||||
|
|
|
@ -153,7 +153,7 @@ class LibraryInstaller implements InstallerInterface
|
||||||
/**
|
/**
|
||||||
* Returns the base path of the package without target-dir path
|
* 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
|
* installer plugins but not getPackageBasePath
|
||||||
*
|
*
|
||||||
* @param PackageInterface $package
|
* @param PackageInterface $package
|
||||||
|
|
|
@ -236,13 +236,7 @@ class ComposerRepository extends ArrayRepository implements ConfigurableReposito
|
||||||
return array_keys($this->providerListing);
|
return array_keys($this->providerListing);
|
||||||
}
|
}
|
||||||
|
|
||||||
// BC handling for old providers-includes
|
return array();
|
||||||
$providers = array();
|
|
||||||
foreach (array_keys($this->providerListing) as $provider) {
|
|
||||||
$providers[] = substr($provider, 2, -5);
|
|
||||||
}
|
|
||||||
|
|
||||||
return $providers;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function configurePackageTransportOptions(PackageInterface $package)
|
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);
|
$url = str_replace(array('%package%', '%hash%'), array($name, $hash), $this->providersUrl);
|
||||||
$cacheKey = 'provider-'.strtr($name, '/', '$').'.json';
|
$cacheKey = 'provider-'.strtr($name, '/', '$').'.json';
|
||||||
} else {
|
} 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();
|
return array();
|
||||||
}
|
}
|
||||||
$hash = $this->providerListing[$url]['sha256'];
|
|
||||||
$cacheKey = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
$packages = null;
|
$packages = null;
|
||||||
if ($cacheKey) {
|
if ($cacheKey) {
|
||||||
|
@ -459,9 +445,6 @@ class ComposerRepository extends ArrayRepository implements ConfigurableReposito
|
||||||
|
|
||||||
if (!empty($data['notify-batch'])) {
|
if (!empty($data['notify-batch'])) {
|
||||||
$this->notifyUrl = $this->canonicalizeUrl($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'])) {
|
} elseif (!empty($data['notify'])) {
|
||||||
$this->notifyUrl = $this->canonicalizeUrl($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']);
|
$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);
|
$this->loadProviderListings($includedData);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -154,17 +154,4 @@ class RepositoryManager
|
||||||
{
|
{
|
||||||
return $this->localRepository;
|
return $this->localRepository;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns all local repositories for the project.
|
|
||||||
*
|
|
||||||
* @deprecated getLocalDevRepository is gone, so this is useless now, just use getLocalRepository instead
|
|
||||||
* @return array[WritableRepositoryInterface]
|
|
||||||
*/
|
|
||||||
public function getLocalRepositories()
|
|
||||||
{
|
|
||||||
trigger_error('This method is deprecated, use getLocalRepository instead since the getLocalDevRepository is now gone', E_USER_DEPRECATED);
|
|
||||||
|
|
||||||
return array($this->localRepository);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -110,7 +110,8 @@ class ComposerRepositoryTest extends TestCase
|
||||||
$properties = array(
|
$properties = array(
|
||||||
'cache' => $cache,
|
'cache' => $cache,
|
||||||
'loader' => new ArrayLoader(),
|
'loader' => new ArrayLoader(),
|
||||||
'providerListing' => array('p/a.json' => array('sha256' => 'xxx')),
|
'providerListing' => array('a' => array('sha256' => 'xxx')),
|
||||||
|
'providersUrl' => 'https://dummy.test.link/to/%package%/file',
|
||||||
);
|
);
|
||||||
|
|
||||||
foreach ($properties as $property => $value) {
|
foreach ($properties as $property => $value) {
|
||||||
|
|
Loading…
Reference in New Issue