Skip to content

Commit c92b9c2

Browse files
committed
Exclude opcache from 8.5 as it is permanent now
1 parent 66c5d9e commit c92b9c2

File tree

2 files changed

+19
-9
lines changed

2 files changed

+19
-9
lines changed

src/ComposerIntegration/BundledPhpExtensionsRepository.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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'],

test/install-bundled-php-exts.php

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
declare(strict_types=1);
44

55
use Composer\Package\PackageInterface;
6+
use Composer\Package\Version\VersionParser;
67
use Php\Pie\ComposerIntegration\BundledPhpExtensionsRepository;
78
use Php\Pie\Platform\TargetPhp\PhpBinaryPath;
89
use Php\Pie\Platform\TargetPlatform;
@@ -17,17 +18,26 @@
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;

0 commit comments

Comments
 (0)