[ticket/11150] Skip invalid extensions, not the whole list

PHPBB3-11150
This commit is contained in:
Tristan Darricau 2015-12-29 22:36:36 +01:00 committed by Tristan Darricau
parent 5f4aa4f416
commit 1703b678d0
No known key found for this signature in database
GPG key ID: 817043C2E29DB881
2 changed files with 20 additions and 13 deletions

View file

@ -164,7 +164,7 @@ $lang = array_merge($lang, array(
'EXTENSIONS_REMOVED' => 'Extensions successfully removed.',
'EXTENSIONS_UPDATED' => 'Extensions successfully updated.',
'EXTENSIONS_COMPOSER_NOT_WRITABLE' => 'In order to use the catalog, the following files and directories must be writable: ext/ vendor-ext/ composer-ext.json and composer-ext.json.lock',
'EXTENSIONS_COMPOSER_NOT_WRITABLE' => 'In order to use the catalog, the following files and directories must be writable: ext/ vendor-ext/ composer-ext.json and composer-ext.lock',
'STABILITY_STABLE' => 'stable',
'STABILITY_RC' => 'RC',

View file

@ -455,23 +455,30 @@ class installer
/** @var \Composer\Package\PackageInterface $version */
foreach ($versions as $version)
{
if (BasePackage::$stabilities[$version->getStability()] > $core_stability_value)
try
{
continue;
}
if (array_key_exists('phpbb/phpbb', $version->getRequires()))
{
/** @var ConstraintInterface $package_constraint */
$package_constraint = $version->getRequires()['phpbb/phpbb']->getConstraint();
if (!$package_constraint->matches($core_constraint))
if (BasePackage::$stabilities[$version->getStability()] > $core_stability_value)
{
continue;
}
}
$compatible_packages[$package_name][] = $version;
if (array_key_exists('phpbb/phpbb', $version->getRequires()))
{
/** @var ConstraintInterface $package_constraint */
$package_constraint = $version->getRequires()['phpbb/phpbb']->getConstraint();
if (!$package_constraint->matches($core_constraint))
{
continue;
}
}
$compatible_packages[$package_name][] = $version;
}
catch (\Exception $e)
{
// Do nothing (to log when a true debug logger is available)
}
}
return $compatible_packages;