1
0
Fork 0

Merge branch '2.2' into 2.3

pull/10953/head
Jordi Boggiano 2022-07-17 13:06:43 +02:00
commit 3c68b579ed
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC
4 changed files with 12 additions and 4 deletions

View File

@ -97,6 +97,10 @@ trait PackageDiscoveryTrait
$io = $this->getIO(); $io = $this->getIO();
foreach ($requires as $requirement) { foreach ($requires as $requirement) {
if (isset($requirement['version']) && Preg::isMatch('{^\d+(\.\d+)?$}', $requirement['version'])) {
$io->writeError('<warning>The "'.$requirement['version'].'" constraint for "'.$requirement['name'].'" appears too strict and will likely not match what you want. See https://getcomposer.org/constraints');
}
if (!isset($requirement['version'])) { if (!isset($requirement['version'])) {
// determine the best version automatically // determine the best version automatically
list($name, $version) = $this->findBestVersionAndNameForPackage($input, $requirement['name'], $platformRepo, $preferredStability, null, null, $fixed); list($name, $version) = $this->findBestVersionAndNameForPackage($input, $requirement['name'], $platformRepo, $preferredStability, null, null, $fixed);

View File

@ -117,9 +117,9 @@ class SolverProblemsException extends \RuntimeException
return ''; return '';
} }
$ignoreExtensionsArguments = implode(" ", array_map(function ($extension) { $ignoreExtensionsArguments = implode(" ", array_map(static function ($extension) {
return "--ignore-platform-req=$extension"; return "--ignore-platform-req=$extension";
}, $missingExtensions)); }, array_unique($missingExtensions)));
$text = "To enable extensions, verify that they are enabled in your .ini files:\n - "; $text = "To enable extensions, verify that they are enabled in your .ini files:\n - ";
$text .= implode("\n - ", $paths); $text .= implode("\n - ", $paths);

View File

@ -287,6 +287,11 @@ class Factory
*/ */
public function createComposer(IOInterface $io, $localConfig = null, $disablePlugins = false, ?string $cwd = null, bool $fullLoad = true, bool $disableScripts = false) public function createComposer(IOInterface $io, $localConfig = null, $disablePlugins = false, ?string $cwd = null, bool $fullLoad = true, bool $disableScripts = false)
{ {
// if a custom composer.json path is given, we change the default cwd to be that file's directory
if (is_string($localConfig) && is_file($localConfig) && null === $cwd) {
$cwd = dirname($localConfig);
}
$cwd = $cwd ?? Platform::getCwd(true); $cwd = $cwd ?? Platform::getCwd(true);
// load Composer configuration // load Composer configuration

View File

@ -81,7 +81,6 @@ Your requirements could not be resolved to an installable set of packages.
To enable extensions, verify that they are enabled in your .ini files: To enable extensions, verify that they are enabled in your .ini files:
__inilist__ __inilist__
You can also run `php --ini` in a terminal to see which files are used by PHP in CLI mode. You can also run `php --ini` in a terminal to see which files are used by PHP in CLI mode.
Alternatively, you can run Composer with `--ignore-platform-req=ext-foobar --ignore-platform-req=ext-pcre --ignore-platform-req=ext-foobar --ignore-platform-req=ext-pcre` to temporarily ignore these required extensions. Alternatively, you can run Composer with `--ignore-platform-req=ext-foobar --ignore-platform-req=ext-pcre` to temporarily ignore these required extensions.
--EXPECT-- --EXPECT--