From e532e70b22603ef74626f1319428c683ed08a662 Mon Sep 17 00:00:00 2001 From: Volker Killesreiter Date: Fri, 14 Feb 2020 19:54:18 +0100 Subject: [PATCH 01/25] Revert "Chore: Use consistent directory path" This reverts commit 43e0321ee74aa5efb9b720f8576145c351d7f3e3. --- src/Composer/Command/CreateProjectCommand.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Composer/Command/CreateProjectCommand.php b/src/Composer/Command/CreateProjectCommand.php index 61fe740ee..eaffda6f5 100644 --- a/src/Composer/Command/CreateProjectCommand.php +++ b/src/Composer/Command/CreateProjectCommand.php @@ -302,10 +302,9 @@ EOT // if no directory was specified, use the 2nd part of the package name if (null === $directory) { $parts = explode("/", $name, 2); - $directory = array_pop($parts); + $directory = getcwd() . DIRECTORY_SEPARATOR . array_pop($parts); } - $directory = getcwd() . DIRECTORY_SEPARATOR . $directory; $io->writeError('Creating a "' . $packageName . '" project at "' . $directory . '"'); $fs = new Filesystem(); From 766c8d448c04e189febc9ea0b701841495a5c890 Mon Sep 17 00:00:00 2001 From: arai Date: Sun, 23 Feb 2020 21:31:28 +0900 Subject: [PATCH 02/25] add 'array' to document in ConfigSourceInterface.php --- src/Composer/Config/ConfigSourceInterface.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Composer/Config/ConfigSourceInterface.php b/src/Composer/Config/ConfigSourceInterface.php index 0d56fc0ed..a00e989bb 100644 --- a/src/Composer/Config/ConfigSourceInterface.php +++ b/src/Composer/Config/ConfigSourceInterface.php @@ -39,7 +39,7 @@ interface ConfigSourceInterface * Add a config setting * * @param string $name Name - * @param string $value Value + * @param string|array $value Value */ public function addConfigSetting($name, $value); From e61b559eb2305dd3627954640d73540a58f90f93 Mon Sep 17 00:00:00 2001 From: arai Date: Sun, 23 Feb 2020 21:38:14 +0900 Subject: [PATCH 03/25] delete 'return' in Filesystem.php --- src/Composer/Util/Filesystem.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Composer/Util/Filesystem.php b/src/Composer/Util/Filesystem.php index 7cdad1df4..e305b03b5 100644 --- a/src/Composer/Util/Filesystem.php +++ b/src/Composer/Util/Filesystem.php @@ -206,7 +206,7 @@ class Filesystem usleep(350000); $unlinked = @$this->unlinkImplementation($path); } - + if (!$unlinked) { $error = error_get_last(); $message = 'Could not delete '.$path.': ' . @$error['message']; @@ -237,7 +237,7 @@ class Filesystem usleep(350000); $deleted = @rmdir($path); } - + if (!$deleted) { $error = error_get_last(); $message = 'Could not delete '.$path.': ' . @$error['message']; @@ -340,7 +340,7 @@ class Filesystem } } - return $this->copyThenRemove($source, $target); + $this->copyThenRemove($source, $target); } /** From 30b1dfb8a99cb5c3cda57f6b749c748e7b7246d7 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Tue, 25 Feb 2020 16:09:36 +0100 Subject: [PATCH 04/25] report ambiguous classes across all classmaps --- src/Composer/Autoload/AutoloadGenerator.php | 25 +++++++++++++++------ 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/src/Composer/Autoload/AutoloadGenerator.php b/src/Composer/Autoload/AutoloadGenerator.php index 2bb0c98b1..8ee8d91c2 100644 --- a/src/Composer/Autoload/AutoloadGenerator.php +++ b/src/Composer/Autoload/AutoloadGenerator.php @@ -236,6 +236,7 @@ EOF; // flatten array $classMap = array(); + $ambigiousClasses = array(); if ($scanPsr0Packages) { $namespacesToScan = array(); @@ -256,14 +257,24 @@ EOF; continue; } - $classMap = $this->addClassMapCode($filesystem, $basePath, $vendorPath, $dir, $blacklist, $namespace, $group['type'], $classMap); + $classMap = $this->addClassMapCode($filesystem, $basePath, $vendorPath, $dir, $blacklist, $namespace, $group['type'], $classMap, $ambigiousClasses); } } } } foreach ($autoloads['classmap'] as $dir) { - $classMap = $this->addClassMapCode($filesystem, $basePath, $vendorPath, $dir, $blacklist, null, null, $classMap); + $classMap = $this->addClassMapCode($filesystem, $basePath, $vendorPath, $dir, $blacklist, null, null, $classMap, $ambigiousClasses); + } + + foreach($ambigiousClasses as $className => $ambigiousPaths) + { + $cleanPath = str_replace(array('$vendorDir . \'', "',\n"), array($vendorPath, ''), $classMap[$className]); + + $this->io->writeError( + 'Warning: Ambiguous class resolution, "'.$className.'"'. + ' was found '. (count($ambigiousPaths)+1) .'x: in "'.$cleanPath.'" and "'. implode('", "', $ambigiousPaths) .'", the first will be used.' + ); } ksort($classMap); @@ -326,17 +337,17 @@ EOF; return 0; } - private function addClassMapCode($filesystem, $basePath, $vendorPath, $dir, $blacklist = null, $namespaceFilter = null, $autoloadType = null, array $classMap = array()) + private function addClassMapCode($filesystem, $basePath, $vendorPath, $dir, $blacklist = null, $namespaceFilter = null, $autoloadType = null, array $classMap, array &$ambigiousClasses) { foreach ($this->generateClassMap($dir, $blacklist, $namespaceFilter, $autoloadType) as $class => $path) { $pathCode = $this->getPathCode($filesystem, $basePath, $vendorPath, $path).",\n"; if (!isset($classMap[$class])) { $classMap[$class] = $pathCode; } elseif ($this->io && $classMap[$class] !== $pathCode && !preg_match('{/(test|fixture|example|stub)s?/}i', strtr($classMap[$class].' '.$path, '\\', '/'))) { - $this->io->writeError( - 'Warning: Ambiguous class resolution, "'.$class.'"'. - ' was found in both "'.str_replace(array('$vendorDir . \'', "',\n"), array($vendorPath, ''), $classMap[$class]).'" and "'.$path.'", the first will be used.' - ); + if (!isset($ambigiousClasses[$class])) { + $ambigiousClasses[$class] = array(); + } + $ambigiousClasses[$class][] = $path; } } From 339ee953e5c9a4e763a43b6c457d8ad4eb9877d3 Mon Sep 17 00:00:00 2001 From: remorhaz Date: Tue, 18 Feb 2020 17:10:41 +0200 Subject: [PATCH 05/25] Fix incorrect --no-dev handling of replaced packages --- src/Composer/Autoload/AutoloadGenerator.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Composer/Autoload/AutoloadGenerator.php b/src/Composer/Autoload/AutoloadGenerator.php index 2bb0c98b1..ca1fc10d4 100644 --- a/src/Composer/Autoload/AutoloadGenerator.php +++ b/src/Composer/Autoload/AutoloadGenerator.php @@ -939,16 +939,23 @@ INITIALIZER; { $packages = array(); $include = array(); + $replacedBy = array(); foreach ($packageMap as $item) { $package = $item[0]; $name = $package->getName(); $packages[$name] = $package; + foreach ($package->getReplaces() as $replace) { + $replacedBy[$replace->getTarget()] = $name; + } } - $add = function (PackageInterface $package) use (&$add, $packages, &$include) { + $add = function (PackageInterface $package) use (&$add, $packages, &$include, $replacedBy) { foreach ($package->getRequires() as $link) { $target = $link->getTarget(); + if (isset($replacedBy[$target])) { + $target = $replacedBy[$target]; + } if (!isset($include[$target])) { $include[$target] = true; if (isset($packages[$target])) { From 8df263a75645238e7f7d9c277fe485c7cf6daf93 Mon Sep 17 00:00:00 2001 From: remorhaz Date: Mon, 24 Feb 2020 14:43:00 +0200 Subject: [PATCH 06/25] Test added for issue #8622 fix --- .../Test/Autoload/AutoloadGeneratorTest.php | 52 +++++++++++++++++++ .../Autoload/Fixtures/autoload_classmap9.php | 12 +++++ 2 files changed, 64 insertions(+) create mode 100644 tests/Composer/Test/Autoload/Fixtures/autoload_classmap9.php diff --git a/tests/Composer/Test/Autoload/AutoloadGeneratorTest.php b/tests/Composer/Test/Autoload/AutoloadGeneratorTest.php index 055b03e1c..3cd8f7ff2 100644 --- a/tests/Composer/Test/Autoload/AutoloadGeneratorTest.php +++ b/tests/Composer/Test/Autoload/AutoloadGeneratorTest.php @@ -486,6 +486,58 @@ class AutoloadGeneratorTest extends TestCase $this->assertFileExists($this->vendorDir.'/composer/autoload_classmap.php', "ClassMap file needs to be generated, even if empty."); } + public function testNonDevAutoloadReplacesNestedRequirements() + { + $package = new Package('a', '1.0', '1.0'); + $package->setRequires(array( + new Link('a', 'a/a') + )); + + $packages = array(); + $packages[] = $a = new Package('a/a', '1.0', '1.0'); + $packages[] = $b = new Package('b/b', '1.0', '1.0'); + $packages[] = $c = new Package('c/c', '1.0', '1.0'); + $packages[] = $d = new Package('d/d', '1.0', '1.0'); + $packages[] = $e = new Package('e/e', '1.0', '1.0'); + $a->setAutoload(array('classmap' => array('src/A.php'))); + $a->setRequires(array( + new Link('a/a', 'b/b') + )); + $b->setAutoload(array('classmap' => array('src/B.php'))); + $b->setRequires(array( + new Link('b/b', 'e/e') + )); + $c->setAutoload(array('classmap' => array('src/C.php'))); + $c->setReplaces(array( + new Link('c/c', 'b/b') + )); + $c->setRequires(array( + new Link('c/c', 'd/d') + )); + $d->setAutoload(array('classmap' => array('src/D.php'))); + $e->setAutoload(array('classmap' => array('src/E.php'))); + + $this->repository->expects($this->once()) + ->method('getCanonicalPackages') + ->will($this->returnValue($packages)); + + $this->fs->ensureDirectoryExists($this->vendorDir.'/a/a/src'); + $this->fs->ensureDirectoryExists($this->vendorDir.'/b/b/src'); + $this->fs->ensureDirectoryExists($this->vendorDir.'/c/c/src'); + $this->fs->ensureDirectoryExists($this->vendorDir.'/d/d/src'); + $this->fs->ensureDirectoryExists($this->vendorDir.'/e/e/src'); + + file_put_contents($this->vendorDir.'/a/a/src/A.php', 'vendorDir.'/b/b/src/B.php', 'vendorDir.'/c/c/src/C.php', 'vendorDir.'/d/d/src/D.php', 'vendorDir.'/e/e/src/E.php', 'generator->dump($this->config, $this->repository, $package, $this->im, 'composer', false, '_5'); + + $this->assertAutoloadFiles('classmap9', $this->vendorDir.'/composer', 'classmap'); + } + public function testPharAutoload() { $package = new Package('a', '1.0', '1.0'); diff --git a/tests/Composer/Test/Autoload/Fixtures/autoload_classmap9.php b/tests/Composer/Test/Autoload/Fixtures/autoload_classmap9.php new file mode 100644 index 000000000..f9ad3ca30 --- /dev/null +++ b/tests/Composer/Test/Autoload/Fixtures/autoload_classmap9.php @@ -0,0 +1,12 @@ + $vendorDir . '/a/a/src/A.php', + 'C' => $vendorDir . '/c/c/src/C.php', + 'D' => $vendorDir . '/d/d/src/D.php', +); From 7a270955f5f90c7a8d5ec7de07e285b56db7de16 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Fri, 28 Feb 2020 16:00:45 +0100 Subject: [PATCH 07/25] Fix issues handling branch names with pipes in them --- src/Composer/Repository/VcsRepository.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/Composer/Repository/VcsRepository.php b/src/Composer/Repository/VcsRepository.php index 18785c4e7..ccc49396a 100644 --- a/src/Composer/Repository/VcsRepository.php +++ b/src/Composer/Repository/VcsRepository.php @@ -20,6 +20,7 @@ use Composer\Package\Loader\ValidatingArrayLoader; use Composer\Package\Loader\InvalidPackageException; use Composer\Package\Loader\LoaderInterface; use Composer\EventDispatcher\EventDispatcher; +use Composer\Semver\Constraint\Constraint; use Composer\IO\IOInterface; use Composer\Config; @@ -363,7 +364,12 @@ class VcsRepository extends ArrayRepository implements ConfigurableRepositoryInt private function validateBranch($branch) { try { - return $this->versionParser->normalizeBranch($branch); + $normalizedBranch = $this->versionParser->normalizeBranch($branch); + + // validate that the branch name has no weird characters conflicting with constraints + $this->versionParser->parseConstraints($normalizedBranch); + + return $normalizedBranch; } catch (\Exception $e) { } @@ -403,7 +409,7 @@ class VcsRepository extends ArrayRepository implements ConfigurableRepositoryInt $this->io->overwriteError($msg, false); } - if ($existingPackage = $this->findPackage($cachedPackage['name'], $cachedPackage['version_normalized'])) { + if ($existingPackage = $this->findPackage($cachedPackage['name'], new Constraint('=', $cachedPackage['version_normalized']))) { if ($isVeryVerbose) { $this->io->writeError('Skipped cached version '.$version.', it conflicts with an another tag ('.$existingPackage->getPrettyVersion().') as both resolve to '.$cachedPackage['version_normalized'].' internally'); } From c6969756e8a0a54461e5513a3c60a27e7e5f0d27 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Fri, 28 Feb 2020 16:27:06 +0100 Subject: [PATCH 08/25] Make sure $_SERVER is updated when putenv updates environment variables, fixes #8298 --- src/Composer/Console/Application.php | 3 ++- src/Composer/EventDispatcher/EventDispatcher.php | 3 ++- src/Composer/Installer.php | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Composer/Console/Application.php b/src/Composer/Console/Application.php index 74e270a96..cc39c587b 100644 --- a/src/Composer/Console/Application.php +++ b/src/Composer/Console/Application.php @@ -131,7 +131,8 @@ class Application extends BaseApplication if ($input->hasParameterOption('--no-cache')) { $io->writeError('Disabling cache usage', true, IOInterface::DEBUG); - putenv('COMPOSER_CACHE_DIR='.(Platform::isWindows() ? 'nul' : '/dev/null')); + $_SERVER['COMPOSER_CACHE_DIR'] = Platform::isWindows() ? 'nul' : '/dev/null'; + putenv('COMPOSER_CACHE_DIR='.$_SERVER['COMPOSER_CACHE_DIR']); } // switch working dir diff --git a/src/Composer/EventDispatcher/EventDispatcher.php b/src/Composer/EventDispatcher/EventDispatcher.php index 45288825d..a5797fdae 100644 --- a/src/Composer/EventDispatcher/EventDispatcher.php +++ b/src/Composer/EventDispatcher/EventDispatcher.php @@ -242,7 +242,8 @@ class EventDispatcher $finder = new PhpExecutableFinder(); $phpPath = $finder->find(false); if ($phpPath) { - putenv('PHP_BINARY=' . $phpPath); + $_SERVER['PHP_BINARY'] = $phpPath; + putenv('PHP_BINARY=' . $_SERVER['PHP_BINARY']); } } diff --git a/src/Composer/Installer.php b/src/Composer/Installer.php index ff40b618f..2269d7958 100644 --- a/src/Composer/Installer.php +++ b/src/Composer/Installer.php @@ -200,8 +200,8 @@ class Installer } if ($this->runScripts) { - $devMode = (int) $this->devMode; - putenv("COMPOSER_DEV_MODE=$devMode"); + $_SERVER['COMPOSER_DEV_MODE'] = (int) $this->devMode; + putenv('COMPOSER_DEV_MODE='.$_SERVER['COMPOSER_DEV_MODE']); // dispatch pre event $eventName = $this->update ? ScriptEvents::PRE_UPDATE_CMD : ScriptEvents::PRE_INSTALL_CMD; From 5d970022e85ec6fb858b51d09bbcecf3a89d230c Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Fri, 28 Feb 2020 17:02:15 +0100 Subject: [PATCH 09/25] Normalize output of create-project target path, refs #8609, refs #8412 --- src/Composer/Command/CreateProjectCommand.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Composer/Command/CreateProjectCommand.php b/src/Composer/Command/CreateProjectCommand.php index eaffda6f5..1801583fd 100644 --- a/src/Composer/Command/CreateProjectCommand.php +++ b/src/Composer/Command/CreateProjectCommand.php @@ -305,9 +305,13 @@ EOT $directory = getcwd() . DIRECTORY_SEPARATOR . array_pop($parts); } - $io->writeError('Creating a "' . $packageName . '" project at "' . $directory . '"'); - $fs = new Filesystem(); + if (!$fs->isAbsolutePath($directory)) { + $directory = getcwd() . DIRECTORY_SEPARATOR . $directory; + } + + $io->writeError('Creating a "' . $packageName . '" project at "' . $fs->findShortestPath(getcwd(), $directory, true) . '"'); + if (file_exists($directory)) { if (!is_dir($directory)) { throw new \InvalidArgumentException('Cannot create project directory at "'.$directory.'", it exists as a file.'); From c5ce4de89eb58c17e1a0ac331b904afc02da2dfb Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Fri, 28 Feb 2020 22:27:53 +0100 Subject: [PATCH 10/25] Consistently return void --- src/Composer/Util/Filesystem.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Composer/Util/Filesystem.php b/src/Composer/Util/Filesystem.php index e305b03b5..008ed584a 100644 --- a/src/Composer/Util/Filesystem.php +++ b/src/Composer/Util/Filesystem.php @@ -310,7 +310,9 @@ class Filesystem } if (!function_exists('proc_open')) { - return $this->copyThenRemove($source, $target); + $this->copyThenRemove($source, $target); + + return; } if (Platform::isWindows()) { From 6cf54170ccae08c0dc67f8cc6ff04036be4a17dc Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Fri, 28 Feb 2020 22:42:19 +0100 Subject: [PATCH 11/25] Avoid mixing write/writeError which causes issues on some terminals, fixes #8656 --- src/Composer/Command/ShowCommand.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Composer/Command/ShowCommand.php b/src/Composer/Command/ShowCommand.php index 83f58350f..b515cc6a9 100644 --- a/src/Composer/Command/ShowCommand.php +++ b/src/Composer/Command/ShowCommand.php @@ -497,7 +497,7 @@ EOT } $io->write(''); if (isset($package['warning'])) { - $io->writeError('' . $package['warning'] . ''); + $io->write('' . $package['warning'] . ''); } } From 887f8cda083837d739c3a23a8a7137137cf33273 Mon Sep 17 00:00:00 2001 From: johnstevenson Date: Sun, 1 Mar 2020 12:56:24 +0000 Subject: [PATCH 12/25] Update xdebug-handler to 1.4.1 --- composer.lock | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/composer.lock b/composer.lock index 9542f4167..bdc8c1630 100644 --- a/composer.lock +++ b/composer.lock @@ -185,16 +185,16 @@ }, { "name": "composer/xdebug-handler", - "version": "1.4.0", + "version": "1.4.1", "source": { "type": "git", "url": "https://github.com/composer/xdebug-handler.git", - "reference": "cbe23383749496fe0f373345208b79568e4bc248" + "reference": "1ab9842d69e64fb3a01be6b656501032d1b78cb7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/cbe23383749496fe0f373345208b79568e4bc248", - "reference": "cbe23383749496fe0f373345208b79568e4bc248", + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/1ab9842d69e64fb3a01be6b656501032d1b78cb7", + "reference": "1ab9842d69e64fb3a01be6b656501032d1b78cb7", "shasum": "" }, "require": { @@ -230,7 +230,7 @@ "issues": "https://github.com/composer/xdebug-handler/issues", "source": "https://github.com/composer/xdebug-handler/tree/1.4.0" }, - "time": "2019-11-06T16:40:04+00:00" + "time": "2020-03-01T12:26:26+00:00" }, { "name": "justinrainbow/json-schema", From 61e0bf1cb5ec57584eaaa645338bd4fcb00d22ed Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Mon, 2 Mar 2020 13:23:33 +0100 Subject: [PATCH 13/25] fix typo --- src/Composer/Autoload/AutoloadGenerator.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Composer/Autoload/AutoloadGenerator.php b/src/Composer/Autoload/AutoloadGenerator.php index 8ee8d91c2..6f564cc8b 100644 --- a/src/Composer/Autoload/AutoloadGenerator.php +++ b/src/Composer/Autoload/AutoloadGenerator.php @@ -236,7 +236,7 @@ EOF; // flatten array $classMap = array(); - $ambigiousClasses = array(); + $ambiguousClasses = array(); if ($scanPsr0Packages) { $namespacesToScan = array(); @@ -257,17 +257,17 @@ EOF; continue; } - $classMap = $this->addClassMapCode($filesystem, $basePath, $vendorPath, $dir, $blacklist, $namespace, $group['type'], $classMap, $ambigiousClasses); + $classMap = $this->addClassMapCode($filesystem, $basePath, $vendorPath, $dir, $blacklist, $namespace, $group['type'], $classMap, $ambiguousClasses); } } } } foreach ($autoloads['classmap'] as $dir) { - $classMap = $this->addClassMapCode($filesystem, $basePath, $vendorPath, $dir, $blacklist, null, null, $classMap, $ambigiousClasses); + $classMap = $this->addClassMapCode($filesystem, $basePath, $vendorPath, $dir, $blacklist, null, null, $classMap, $ambiguousClasses); } - foreach($ambigiousClasses as $className => $ambigiousPaths) + foreach($ambiguousClasses as $className => $ambigiousPaths) { $cleanPath = str_replace(array('$vendorDir . \'', "',\n"), array($vendorPath, ''), $classMap[$className]); @@ -337,17 +337,17 @@ EOF; return 0; } - private function addClassMapCode($filesystem, $basePath, $vendorPath, $dir, $blacklist = null, $namespaceFilter = null, $autoloadType = null, array $classMap, array &$ambigiousClasses) + private function addClassMapCode($filesystem, $basePath, $vendorPath, $dir, $blacklist = null, $namespaceFilter = null, $autoloadType = null, array $classMap, array &$ambiguousClasses) { foreach ($this->generateClassMap($dir, $blacklist, $namespaceFilter, $autoloadType) as $class => $path) { $pathCode = $this->getPathCode($filesystem, $basePath, $vendorPath, $path).",\n"; if (!isset($classMap[$class])) { $classMap[$class] = $pathCode; } elseif ($this->io && $classMap[$class] !== $pathCode && !preg_match('{/(test|fixture|example|stub)s?/}i', strtr($classMap[$class].' '.$path, '\\', '/'))) { - if (!isset($ambigiousClasses[$class])) { - $ambigiousClasses[$class] = array(); + if (!isset($ambiguousClasses[$class])) { + $ambiguousClasses[$class] = array(); } - $ambigiousClasses[$class][] = $path; + $ambiguousClasses[$class][] = $path; } } From 883a179dec1493b3cb0de6e29451c9408055a318 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Mon, 2 Mar 2020 13:24:06 +0100 Subject: [PATCH 14/25] removed superflous code --- src/Composer/Autoload/AutoloadGenerator.php | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/Composer/Autoload/AutoloadGenerator.php b/src/Composer/Autoload/AutoloadGenerator.php index 6f564cc8b..bf22d3daf 100644 --- a/src/Composer/Autoload/AutoloadGenerator.php +++ b/src/Composer/Autoload/AutoloadGenerator.php @@ -344,9 +344,6 @@ EOF; if (!isset($classMap[$class])) { $classMap[$class] = $pathCode; } elseif ($this->io && $classMap[$class] !== $pathCode && !preg_match('{/(test|fixture|example|stub)s?/}i', strtr($classMap[$class].' '.$path, '\\', '/'))) { - if (!isset($ambiguousClasses[$class])) { - $ambiguousClasses[$class] = array(); - } $ambiguousClasses[$class][] = $path; } } From 04a18c72ba4f4f7120ba9617741d335d1cacbfc6 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Mon, 2 Mar 2020 13:25:54 +0100 Subject: [PATCH 15/25] fix CS --- src/Composer/Autoload/AutoloadGenerator.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/Composer/Autoload/AutoloadGenerator.php b/src/Composer/Autoload/AutoloadGenerator.php index bf22d3daf..46a57a542 100644 --- a/src/Composer/Autoload/AutoloadGenerator.php +++ b/src/Composer/Autoload/AutoloadGenerator.php @@ -267,13 +267,12 @@ EOF; $classMap = $this->addClassMapCode($filesystem, $basePath, $vendorPath, $dir, $blacklist, null, null, $classMap, $ambiguousClasses); } - foreach($ambiguousClasses as $className => $ambigiousPaths) - { + foreach ($ambiguousClasses as $className => $ambigiousPaths) { $cleanPath = str_replace(array('$vendorDir . \'', "',\n"), array($vendorPath, ''), $classMap[$className]); $this->io->writeError( 'Warning: Ambiguous class resolution, "'.$className.'"'. - ' was found '. (count($ambigiousPaths)+1) .'x: in "'.$cleanPath.'" and "'. implode('", "', $ambigiousPaths) .'", the first will be used.' + ' was found '. (count($ambigiousPaths) + 1) .'x: in "'.$cleanPath.'" and "'. implode('", "', $ambigiousPaths) .'", the first will be used.' ); } @@ -401,8 +400,8 @@ EOF; /** * Compiles an ordered list of namespace => path mappings * - * @param array $packageMap array of array(package, installDir-relative-to-composer.json) - * @param PackageInterface $mainPackage root package instance + * @param array $packageMap array of array(package, installDir-relative-to-composer.json) + * @param PackageInterface $mainPackage root package instance * @param bool $filterOutRequireDevPackages whether to filter out require-dev packages * @return array array('psr-0' => array('Ns\\Foo' => array('installDir'))) */ From cc5c5dbee16f1c3bf1c6a19c4ae3b8266bdd713a Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Mon, 2 Mar 2020 13:28:10 +0100 Subject: [PATCH 16/25] merge fix from https://github.com/composer/composer/pull/8651 --- src/Composer/Autoload/AutoloadGenerator.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Composer/Autoload/AutoloadGenerator.php b/src/Composer/Autoload/AutoloadGenerator.php index 46a57a542..c5b0714c1 100644 --- a/src/Composer/Autoload/AutoloadGenerator.php +++ b/src/Composer/Autoload/AutoloadGenerator.php @@ -268,7 +268,7 @@ EOF; } foreach ($ambiguousClasses as $className => $ambigiousPaths) { - $cleanPath = str_replace(array('$vendorDir . \'', "',\n"), array($vendorPath, ''), $classMap[$className]); + $cleanPath = str_replace(array('$vendorDir . \'', '$baseDir . \'', "',\n"), array($vendorPath, $basePath, ''), $classMap[$className]); $this->io->writeError( 'Warning: Ambiguous class resolution, "'.$className.'"'. From cbec8ceb538e706467b9edbb4e43c7966b2f6ad6 Mon Sep 17 00:00:00 2001 From: Ethan Clevenger Date: Wed, 4 Mar 2020 15:01:35 -0800 Subject: [PATCH 17/25] Bearer support. --- src/Composer/IO/BaseIO.php | 5 +++++ src/Composer/Util/RemoteFilesystem.php | 2 ++ 2 files changed, 7 insertions(+) diff --git a/src/Composer/IO/BaseIO.php b/src/Composer/IO/BaseIO.php index cb2e99def..d9dbc2d6f 100644 --- a/src/Composer/IO/BaseIO.php +++ b/src/Composer/IO/BaseIO.php @@ -116,6 +116,7 @@ abstract class BaseIO implements IOInterface, LoggerInterface $gitlabOauth = $config->get('gitlab-oauth') ?: array(); $gitlabToken = $config->get('gitlab-token') ?: array(); $httpBasic = $config->get('http-basic') ?: array(); + $bearerToken = $config->get('bearer') ?: array(); // reload oauth tokens from config if available @@ -143,6 +144,10 @@ abstract class BaseIO implements IOInterface, LoggerInterface $this->checkAndSetAuthentication($domain, $cred['username'], $cred['password']); } + foreach ($bearerToken as $domain => $token) { + $this->checkAndSetAuthentication($domain, $token, 'bearer'); + } + // setup process timeout ProcessExecutor::setTimeout((int) $config->get('process-timeout')); } diff --git a/src/Composer/Util/RemoteFilesystem.php b/src/Composer/Util/RemoteFilesystem.php index 4885b7530..4fc6e8ed9 100644 --- a/src/Composer/Util/RemoteFilesystem.php +++ b/src/Composer/Util/RemoteFilesystem.php @@ -835,6 +835,8 @@ class RemoteFilesystem $headers[] = 'Authorization: Bearer ' . $auth['password']; $authenticationDisplayMessage = 'Using Bitbucket OAuth token authentication'; } + } elseif ($auth['password'] === 'bearer' ) { + $headers[] = 'Authorization: Bearer '.$auth['username']; } else { $authStr = base64_encode($auth['username'] . ':' . $auth['password']); $headers[] = 'Authorization: Basic '.$authStr; From 41edce01fca0de4685acbbc355cccfa260e1e682 Mon Sep 17 00:00:00 2001 From: Romain Date: Fri, 6 Mar 2020 12:17:09 +0100 Subject: [PATCH 18/25] Update link to wikipedia VC -> Common terminology The wikipedia section `Version_control#Common_vocabulary` has moved to `Version_control#Common_terminology`. You know, scrolling along is harassing :-) --- doc/articles/versions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/articles/versions.md b/doc/articles/versions.md index e3da6c8ec..85c9356d2 100644 --- a/doc/articles/versions.md +++ b/doc/articles/versions.md @@ -54,7 +54,7 @@ v2.0.2 Normally, Composer deals with tags (as opposed to branches -- if you don't know what this means, read up on -[version control systems](https://en.wikipedia.org/wiki/Version_control#Common_vocabulary)). +[version control systems](https://en.wikipedia.org/wiki/Version_control#Common_terminology)). When you write a version constraint, it may reference a specific tag (e.g., `1.1`) or it may reference a valid range of tags (e.g., `>=1.1 <2.0`, or `~4.0`). To resolve these constraints, Composer first asks the VCS to list From beb64914a37205f6748552d764d9531d99c7f41e Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Fri, 6 Mar 2020 17:00:50 +0100 Subject: [PATCH 19/25] Retrieve latest funding info for all packages in fund command --- src/Composer/Command/FundCommand.php | 32 ++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/src/Composer/Command/FundCommand.php b/src/Composer/Command/FundCommand.php index 3c80abc23..53c915c68 100644 --- a/src/Composer/Command/FundCommand.php +++ b/src/Composer/Command/FundCommand.php @@ -14,6 +14,7 @@ namespace Composer\Command; use Composer\Package\CompletePackageInterface; use Composer\Package\AliasPackage; +use Composer\Repository\CompositeRepository; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; @@ -36,20 +37,19 @@ class FundCommand extends BaseCommand $composer = $this->getComposer(); $repo = $composer->getRepositoryManager()->getLocalRepository(); + $remoteRepos = new CompositeRepository($composer->getRepositoryManager()->getRepositories()); $fundings = array(); foreach ($repo->getPackages() as $package) { if ($package instanceof AliasPackage) { continue; } - if ($package instanceof CompletePackageInterface && $funding = $package->getFunding()) { - foreach ($funding as $fundingOption) { - list($vendor, $packageName) = explode('/', $package->getPrettyName()); - $url = $fundingOption['url']; - if (!empty($fundingOption['type']) && $fundingOption['type'] === 'github' && preg_match('{^https://github.com/([^/]+)$}', $url, $match)) { - $url = 'https://github.com/sponsors/'.$match[1]; - } - $fundings[$vendor][$url][] = $packageName; - } + $latest = $remoteRepos->findPackage($package->getName(), 'dev-master'); + if ($latest instanceof CompletePackageInterface && $latest->getFunding()) { + $fundings = $this->insertFundingData($fundings, $latest); + continue; + } + if ($package instanceof CompletePackageInterface && $package->getFunding()) { + $fundings = $this->insertFundingData($fundings, $package); } } @@ -86,4 +86,18 @@ class FundCommand extends BaseCommand return 0; } + + private function insertFundingData(array $fundings, CompletePackageInterface $package) + { + foreach ($package->getFunding() as $fundingOption) { + list($vendor, $packageName) = explode('/', $package->getPrettyName()); + $url = $fundingOption['url']; + if (!empty($fundingOption['type']) && $fundingOption['type'] === 'github' && preg_match('{^https://github.com/([^/]+)$}', $url, $match)) { + $url = 'https://github.com/sponsors/'.$match[1]; + } + $fundings[$vendor][$url][] = $packageName; + } + + return $fundings; + } } From 9d72c92f07c79bd02a28a75fa00f3bd20ed4901b Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Tue, 10 Mar 2020 11:25:45 +0100 Subject: [PATCH 20/25] Avoid looping endlessly for invalid GitLab tokens in git config, fixes #8667 --- src/Composer/Util/RemoteFilesystem.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Composer/Util/RemoteFilesystem.php b/src/Composer/Util/RemoteFilesystem.php index 4885b7530..bd2e19dfe 100644 --- a/src/Composer/Util/RemoteFilesystem.php +++ b/src/Composer/Util/RemoteFilesystem.php @@ -690,7 +690,7 @@ class RemoteFilesystem $message = "\n".'Could not fetch '.$this->fileUrl.', enter your ' . $this->originUrl . ' credentials ' .($httpStatus === 401 ? 'to access private repos' : 'to go over the API rate limit'); $gitLabUtil = new GitLab($this->io, $this->config, null); - if ($this->io->hasAuthentication($this->originUrl) && ($auth = $this->io->getAuthentication($this->originUrl)) && in_array($auth['password'], array('gitlab-ci-token', 'private-token'), true)) { + if ($this->io->hasAuthentication($this->originUrl) && ($auth = $this->io->getAuthentication($this->originUrl)) && in_array($auth['password'], array('gitlab-ci-token', 'private-token', 'oauth2'), true)) { throw new TransportException("Invalid credentials for '" . $this->fileUrl . "', aborting.", $httpStatus); } From 479414d8bd95d6ae0826c69e4a103366ef44200f Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Tue, 10 Mar 2020 13:26:53 +0100 Subject: [PATCH 21/25] Move bearer auth to be first to make sure it does not get shadowed by github/gitlab/.. configs --- src/Composer/Util/RemoteFilesystem.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Composer/Util/RemoteFilesystem.php b/src/Composer/Util/RemoteFilesystem.php index 4fc6e8ed9..2cb8025b7 100644 --- a/src/Composer/Util/RemoteFilesystem.php +++ b/src/Composer/Util/RemoteFilesystem.php @@ -817,7 +817,9 @@ class RemoteFilesystem if ($this->io->hasAuthentication($originUrl)) { $authenticationDisplayMessage = null; $auth = $this->io->getAuthentication($originUrl); - if ('github.com' === $originUrl && 'x-oauth-basic' === $auth['password']) { + if ($auth['password'] === 'bearer') { + $headers[] = 'Authorization: Bearer '.$auth['username']; + } elseif ('github.com' === $originUrl && 'x-oauth-basic' === $auth['password']) { $options['github-token'] = $auth['username']; $authenticationDisplayMessage = 'Using GitHub token authentication'; } elseif ($this->config && in_array($originUrl, $this->config->get('gitlab-domains'), true)) { @@ -835,8 +837,6 @@ class RemoteFilesystem $headers[] = 'Authorization: Bearer ' . $auth['password']; $authenticationDisplayMessage = 'Using Bitbucket OAuth token authentication'; } - } elseif ($auth['password'] === 'bearer' ) { - $headers[] = 'Authorization: Bearer '.$auth['username']; } else { $authStr = base64_encode($auth['username'] . ':' . $auth['password']); $headers[] = 'Authorization: Basic '.$authStr; From f964b8301837a49ee1a4cf77dbfb38d0c2c2a340 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Tue, 10 Mar 2020 13:39:22 +0100 Subject: [PATCH 22/25] Add bearer support in config command and add to docs/schema, refs #8671 --- doc/06-config.md | 18 ++++++++++++------ res/composer-schema.json | 5 +++++ src/Composer/Command/ConfigCommand.php | 6 +++--- src/Composer/Config.php | 3 ++- src/Composer/Config/JsonConfigSource.php | 4 ++-- 5 files changed, 24 insertions(+), 12 deletions(-) diff --git a/doc/06-config.md b/doc/06-config.md index 0f110a428..603de014a 100644 --- a/doc/06-config.md +++ b/doc/06-config.md @@ -79,16 +79,16 @@ an OAuth token for GitHub. A list of domain names and oauth keys. For example using `{"gitlab.com": "oauthtoken"}` as the value of this option will use `oauthtoken` to access -private repositories on gitlab. Please note: If the package is not hosted at -gitlab.com the domain names must be also specified with the +private repositories on gitlab. Please note: If the package is not hosted at +gitlab.com the domain names must be also specified with the [`gitlab-domains`](06-config.md#gitlab-domains) option. ## gitlab-token A list of domain names and private tokens. For example using `{"gitlab.com": "privatetoken"}` as the value of this option will use `privatetoken` to access -private repositories on gitlab. Please note: If the package is not hosted at -gitlab.com the domain names must be also specified with the +private repositories on gitlab. Please note: If the package is not hosted at +gitlab.com the domain names must be also specified with the [`gitlab-domains`](06-config.md#gitlab-domains) option. ## disable-tls @@ -129,11 +129,17 @@ A list of domain names and username/passwords to authenticate against them. For example using `{"example.org": {"username": "alice", "password": "foo"}}` as the value of this option will let Composer authenticate against example.org. -> **Note:** Authentication-related config options like `http-basic` and +> **Note:** Authentication-related config options like `http-basic`, `bearer` and > `github-oauth` can also be specified inside a `auth.json` file that goes > besides your `composer.json`. That way you can gitignore it and every > developer can place their own credentials in there. +## bearer + +A list of domain names and tokens to authenticate against them. For example using +`{"example.org": "foo"}` as the value of this option will let Composer authenticate +against example.org using an `Authorization: Bearer foo` header. + ## platform Lets you fake platform packages (PHP and extensions) so that you can emulate a @@ -298,7 +304,7 @@ in the composer home, cache, and data directories. ## lock -Defaults to `true`. If set to `false`, Composer will not create a `composer.lock` +Defaults to `true`. If set to `false`, Composer will not create a `composer.lock` file. ← [Repositories](05-repositories.md) | [Community](07-community.md) → diff --git a/res/composer-schema.json b/res/composer-schema.json index a74819baa..d238c265e 100644 --- a/res/composer-schema.json +++ b/res/composer-schema.json @@ -142,6 +142,11 @@ "description": "A hash of domain name => gitlab private tokens, typically {\"gitlab.com\":\"\"}.", "additionalProperties": true }, + "bearer": { + "type": "object", + "description": "A hash of domain name => bearer authentication token, for example {\"example.com\":\"\"}.", + "additionalProperties": true + }, "disable-tls": { "type": "boolean", "description": "Defaults to `false`. If set to true all HTTPS URLs will be tried with HTTP instead and no network level encryption is performed. Enabling this is a security risk and is NOT recommended. The better way is to enable the php_openssl extension in php.ini." diff --git a/src/Composer/Command/ConfigCommand.php b/src/Composer/Command/ConfigCommand.php index 7f79f3251..be1743ba0 100644 --- a/src/Composer/Command/ConfigCommand.php +++ b/src/Composer/Command/ConfigCommand.php @@ -187,7 +187,7 @@ EOT } if ($input->getOption('global') && !$this->authConfigFile->exists()) { touch($this->authConfigFile->getPath()); - $this->authConfigFile->write(array('bitbucket-oauth' => new \ArrayObject, 'github-oauth' => new \ArrayObject, 'gitlab-oauth' => new \ArrayObject, 'gitlab-token' => new \ArrayObject, 'http-basic' => new \ArrayObject)); + $this->authConfigFile->write(array('bitbucket-oauth' => new \ArrayObject, 'github-oauth' => new \ArrayObject, 'gitlab-oauth' => new \ArrayObject, 'gitlab-token' => new \ArrayObject, 'http-basic' => new \ArrayObject, 'bearer' => new \ArrayObject)); Silencer::call('chmod', $this->authConfigFile->getPath(), 0600); } @@ -667,7 +667,7 @@ EOT } // handle auth - if (preg_match('/^(bitbucket-oauth|github-oauth|gitlab-oauth|gitlab-token|http-basic)\.(.+)/', $settingKey, $matches)) { + if (preg_match('/^(bitbucket-oauth|github-oauth|gitlab-oauth|gitlab-token|http-basic|bearer)\.(.+)/', $settingKey, $matches)) { if ($input->getOption('unset')) { $this->authConfigSource->removeConfigSetting($matches[1].'.'.$matches[2]); $this->configSource->removeConfigSetting($matches[1].'.'.$matches[2]); @@ -681,7 +681,7 @@ EOT } $this->configSource->removeConfigSetting($matches[1].'.'.$matches[2]); $this->authConfigSource->addConfigSetting($matches[1].'.'.$matches[2], array('consumer-key' => $values[0], 'consumer-secret' => $values[1])); - } elseif (in_array($matches[1], array('github-oauth', 'gitlab-oauth', 'gitlab-token'), true)) { + } elseif (in_array($matches[1], array('github-oauth', 'gitlab-oauth', 'gitlab-token', 'bearer'), true)) { if (1 !== count($values)) { throw new \RuntimeException('Too many arguments, expected only one token'); } diff --git a/src/Composer/Config.php b/src/Composer/Config.php index 1050096b1..e57d21cab 100644 --- a/src/Composer/Config.php +++ b/src/Composer/Config.php @@ -70,6 +70,7 @@ class Config // gitlab-oauth // gitlab-token // http-basic + // bearer ); public static $defaultRepositories = array( @@ -133,7 +134,7 @@ class Config // override defaults with given config if (!empty($config['config']) && is_array($config['config'])) { foreach ($config['config'] as $key => $val) { - if (in_array($key, array('bitbucket-oauth', 'github-oauth', 'gitlab-oauth', 'gitlab-token', 'http-basic')) && isset($this->config[$key])) { + if (in_array($key, array('bitbucket-oauth', 'github-oauth', 'gitlab-oauth', 'gitlab-token', 'http-basic', 'bearer')) && isset($this->config[$key])) { $this->config[$key] = array_merge($this->config[$key], $val); } elseif ('preferred-install' === $key && isset($this->config[$key])) { if (is_array($val) || is_array($this->config[$key])) { diff --git a/src/Composer/Config/JsonConfigSource.php b/src/Composer/Config/JsonConfigSource.php index f455845a4..6084d66e8 100644 --- a/src/Composer/Config/JsonConfigSource.php +++ b/src/Composer/Config/JsonConfigSource.php @@ -96,7 +96,7 @@ class JsonConfigSource implements ConfigSourceInterface { $authConfig = $this->authConfig; $this->manipulateJson('addConfigSetting', $name, $value, function (&$config, $key, $val) use ($authConfig) { - if (preg_match('{^(bitbucket-oauth|github-oauth|gitlab-oauth|gitlab-token|http-basic|platform)\.}', $key)) { + if (preg_match('{^(bitbucket-oauth|github-oauth|gitlab-oauth|gitlab-token|bearer|http-basic|platform)\.}', $key)) { list($key, $host) = explode('.', $key, 2); if ($authConfig) { $config[$key][$host] = $val; @@ -116,7 +116,7 @@ class JsonConfigSource implements ConfigSourceInterface { $authConfig = $this->authConfig; $this->manipulateJson('removeConfigSetting', $name, function (&$config, $key) use ($authConfig) { - if (preg_match('{^(bitbucket-oauth|github-oauth|gitlab-oauth|gitlab-token|http-basic|platform)\.}', $key)) { + if (preg_match('{^(bitbucket-oauth|github-oauth|gitlab-oauth|gitlab-token|bearer|http-basic|platform)\.}', $key)) { list($key, $host) = explode('.', $key, 2); if ($authConfig) { unset($config[$key][$host]); From 414bc180889c048acb266be850c8d0d95bc5c996 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Tue, 10 Mar 2020 13:56:10 +0100 Subject: [PATCH 23/25] Update deps --- composer.lock | 60 +++++++++++++++++++++++++++++++-------------------- 1 file changed, 37 insertions(+), 23 deletions(-) diff --git a/composer.lock b/composer.lock index bdc8c1630..583dff81e 100644 --- a/composer.lock +++ b/composer.lock @@ -225,11 +225,12 @@ "Xdebug", "performance" ], - "support": { - "irc": "irc://irc.freenode.org/composer", - "issues": "https://github.com/composer/xdebug-handler/issues", - "source": "https://github.com/composer/xdebug-handler/tree/1.4.0" - }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + } + ], "time": "2020-03-01T12:26:26+00:00" }, { @@ -901,6 +902,10 @@ "constructor", "instantiate" ], + "support": { + "issues": "https://github.com/doctrine/instantiator/issues", + "source": "https://github.com/doctrine/instantiator/tree/master" + }, "time": "2015-06-14T21:17:01+00:00" }, { @@ -944,26 +949,20 @@ "license": [ "MIT" ], - "authors": [ - { - "name": "Mike van Riel", - "email": "mike.vanriel@naenius.com" - } - ], "time": "2016-01-25T08:17:30+00:00" }, { "name": "phpspec/prophecy", - "version": "v1.10.2", + "version": "v1.10.3", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "b4400efc9d206e83138e2bb97ed7f5b14b831cd9" + "reference": "451c3cd1418cf640de218914901e51b064abb093" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/b4400efc9d206e83138e2bb97ed7f5b14b831cd9", - "reference": "b4400efc9d206e83138e2bb97ed7f5b14b831cd9", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/451c3cd1418cf640de218914901e51b064abb093", + "reference": "451c3cd1418cf640de218914901e51b064abb093", "shasum": "" }, "require": { @@ -1013,7 +1012,7 @@ "spy", "stub" ], - "time": "2020-01-20T15:57:02+00:00" + "time": "2020-03-05T15:02:03+00:00" }, { "name": "sebastian/comparator", @@ -1253,23 +1252,23 @@ }, { "name": "symfony/phpunit-bridge", - "version": "v3.4.37", + "version": "v3.4.38", "source": { "type": "git", "url": "https://github.com/symfony/phpunit-bridge.git", - "reference": "ebfd1b428ffc14306e843092763f228bfba168d0" + "reference": "c02893ae43532b46a4f0e0f207d088b939f278d9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/phpunit-bridge/zipball/ebfd1b428ffc14306e843092763f228bfba168d0", - "reference": "ebfd1b428ffc14306e843092763f228bfba168d0", + "url": "https://api.github.com/repos/symfony/phpunit-bridge/zipball/c02893ae43532b46a4f0e0f207d088b939f278d9", + "reference": "c02893ae43532b46a4f0e0f207d088b939f278d9", "shasum": "" }, "require": { "php": ">=5.3.3" }, "conflict": { - "phpunit/phpunit": "<4.8.35|<5.4.3,>=5.0" + "phpunit/phpunit": "<4.8.35|<5.4.3,>=5.0|<6.4,>=6.0" }, "suggest": { "symfony/debug": "For tracking deprecated interfaces usages at runtime with DebugClassLoader" @@ -1314,7 +1313,21 @@ ], "description": "Symfony PHPUnit Bridge", "homepage": "https://symfony.com", - "time": "2020-01-14T14:27:59+00:00" + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2020-02-21T08:01:47+00:00" } ], "aliases": [], @@ -1328,5 +1341,6 @@ "platform-dev": [], "platform-overrides": { "php": "5.3.9" - } + }, + "plugin-api-version": "1.1.0" } From 781cf751914c5402ca8639371155c3284a085dd2 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Tue, 10 Mar 2020 13:56:22 +0100 Subject: [PATCH 24/25] Fix schema rules to be more strict --- res/composer-schema.json | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/res/composer-schema.json b/res/composer-schema.json index d238c265e..bcb712882 100644 --- a/res/composer-schema.json +++ b/res/composer-schema.json @@ -140,12 +140,16 @@ "gitlab-token": { "type": "object", "description": "A hash of domain name => gitlab private tokens, typically {\"gitlab.com\":\"\"}.", - "additionalProperties": true + "additionalProperties": { + "type": "string" + } }, "bearer": { "type": "object", "description": "A hash of domain name => bearer authentication token, for example {\"example.com\":\"\"}.", - "additionalProperties": true + "additionalProperties": { + "type": "string" + } }, "disable-tls": { "type": "boolean", From 548505f103d4e55a4044bedcd17bd93eba2fe68b Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Tue, 10 Mar 2020 13:56:45 +0100 Subject: [PATCH 25/25] Update changelog --- CHANGELOG.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index bec514aa2..045b45c1e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,11 @@ +### [1.10.0] 2020-03-10 + + * Added `bearer` auth config to authenticate using `Authorization: Bearer ` headers + * Added `plugin-api-version` in composer.lock so future Composer versions know if they are running a lock file which was not built by the correct version + * Fixed composer fund command and funding info parsing to be more useful + * Fixed issue where --no-dev autoload generation was excluding some packages which should not have been excluded + * Fixed 1.10-RC regression in create project's handling of absolute paths + ### [1.10.0-RC] 2020-02-14 * Breaking: `composer global exec ...` now executes the process in the current working directory instead of executing it in the global directory. @@ -811,6 +819,7 @@ * Initial release +[1.10.0]: https://github.com/composer/composer/compare/1.10.0-RC...1.10.0 [1.10.0-RC]: https://github.com/composer/composer/compare/1.9.3...1.10.0-RC [1.9.3]: https://github.com/composer/composer/compare/1.9.2...1.9.3 [1.9.2]: https://github.com/composer/composer/compare/1.9.1...1.9.2