Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 16 additions & 9 deletions src/DependencyResolver/ResolveDependencyWithComposer.php
Original file line numberDiff line numberDiff line change
Expand Up@@ -114,7 +114,11 @@ private function assertBuildProviderProvidersBundledExtensions(TargetPlatform $t
throw BundledPhpExtensionRefusal::forPhpExtraVersion($targetPlatform->phpBinaryPath);
}

$buildProvider = $targetPlatform->phpBinaryPath->buildProvider();
$buildProvider = $targetPlatform->phpBinaryPath->buildProvider();
if (! $buildProvider) {
return;
}

$identifiedBuildProvider = false;
$note = '<options=bold,underscore;fg=red>Note:</> ';

Expand DownExpand Up@@ -143,16 +147,19 @@ private function assertBuildProviderProvidersBundledExtensions(TargetPlatform $t
'CentOS',
'Fedora Project',
'Red Hat, Inc.',
'Remi\'s RPM repository <https://rpms.remirepo.net/> #StandWithUkraine',
'|^Remi\'s RPM repository <https://rpms.remirepo.net/>|',
'Rocky Enterprise Software Foundation',
];
if (in_array($buildProvider, $rpmProviders)) {
$identifiedBuildProvider = true;
$this->io->write(sprintf(
'<comment>%sYou should probably use "dnf install php-%s" instead</comment>',
$note,
$piePackage->extensionName()->name(),
));
foreach ($rpmProviders as $rpmProvider) {
if ($buildProvider === $rpmProvider || ($rpmProvider[0] === '|' && preg_match($rpmProvider, $buildProvider))) {
$identifiedBuildProvider = true;
$this->io->write(sprintf(
'<comment>%sYou should probably use "dnf install php-%s" instead</comment>',
$note,
$piePackage->extensionName()->name(),
));
break;
}
}

if ($buildProvider === 'Homebrew') {
Expand Down
Loading