Skip to content

Commit c94d97a

Browse files
committed
[ticket/17336] Also check for compatible extension by PHP version
PHPBB-17336 Signed-off-by: Matt Friedman <[email protected]>
1 parent 1d71006 commit c94d97a

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

composer/installer.php

+11
Original file line numberDiff line numberDiff line change
@@ -514,6 +514,17 @@ private function get_compatible_versions(array $compatible_packages, ConstraintI
514514
}
515515
}
516516

517+
// Check for compatibility with php if 'php' exists in 'requires'
518+
if (isset($requires['php']))
519+
{
520+
$php_constraint = $version_parser->parseConstraints(PHP_VERSION);
521+
$package_constraint = $requires['php']->getConstraint();
522+
if (!$package_constraint->matches($php_constraint))
523+
{
524+
continue;
525+
}
526+
}
527+
517528
$compatible_packages[$package_name][] = $version;
518529
}
519530
catch (\Exception $e)

0 commit comments

Comments
 (0)