File tree Expand file tree Collapse file tree 2 files changed +19
-9
lines changed
Expand file tree Collapse file tree 2 files changed +19
-9
lines changed Original file line number Diff line number Diff line change @@ -96,7 +96,7 @@ class BundledPhpExtensionsRepository extends ArrayRepository
9696 [
9797 'name ' => 'opcache ' ,
9898 'type ' => ExtensionType::ZendExtension,
99- 'require ' => ['php ' => '>= 5.5.0 ' ],
99+ 'require ' => ['php ' => '>= 5.5.0, < 8.5.0 ' ],
100100 ],
101101// ['name' => 'openssl'], // Not building in CI
102102 ['name ' => 'pcntl ' ],
Original file line number Diff line number Diff line change 33declare (strict_types=1 );
44
55use Composer \Package \PackageInterface ;
6+ use Composer \Package \Version \VersionParser ;
67use Php \Pie \ComposerIntegration \BundledPhpExtensionsRepository ;
78use Php \Pie \Platform \TargetPhp \PhpBinaryPath ;
89use Php \Pie \Platform \TargetPlatform ;
1718 exit (1 );
1819}
1920
20- $ phpBinaryPath = PhpBinaryPath::fromPhpConfigExecutable ($ phpConfigPath );
21+ $ phpBinaryPath = PhpBinaryPath::fromPhpConfigExecutable ($ phpConfigPath );
22+ $ phpVersionConstraint = (new VersionParser ())->parseConstraints ($ phpBinaryPath ->version ());
2123
2224$ packageNames = array_map (
2325 static fn (PackageInterface $ package ): string => $ package ->getName (),
24- BundledPhpExtensionsRepository::forTargetPlatform (
25- TargetPlatform::fromPhpBinaryPath (
26- $ phpBinaryPath ,
27- null ,
28- ),
29- )
30- ->getPackages (),
26+ array_filter (
27+ BundledPhpExtensionsRepository::forTargetPlatform (
28+ TargetPlatform::fromPhpBinaryPath (
29+ $ phpBinaryPath ,
30+ null ,
31+ ),
32+ )
33+ ->getPackages (),
34+ static function (PackageInterface $ package ) use ($ phpVersionConstraint ): bool {
35+ $ requires = $ package ->getRequires ();
36+
37+ return ! array_key_exists ('php ' , $ requires )
38+ || $ requires ['php ' ]->getConstraint ()->matches ($ phpVersionConstraint );
39+ },
40+ ),
3141);
3242
3343$ anyFailures = false ;
You can’t perform that action at this time.
0 commit comments