1
0
Fork 0

Add uopz warning from installer code (#11988)

pull/11962/merge
John Stevenson 2024-05-21 21:42:10 +01:00 committed by GitHub
parent ede152bd65
commit 8d90eb694a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 11 additions and 0 deletions

View File

@ -678,6 +678,12 @@ EOT
$warnings['onedrive'] = PHP_VERSION; $warnings['onedrive'] = PHP_VERSION;
} }
if (extension_loaded('uopz')
&& !(filter_var(ini_get('uopz.disable'), FILTER_VALIDATE_BOOLEAN)
|| filter_var(ini_get('uopz.exit'), FILTER_VALIDATE_BOOLEAN))) {
$warnings['uopz'] = true;
}
if (!empty($errors)) { if (!empty($errors)) {
foreach ($errors as $error => $current) { foreach ($errors as $error => $current) {
switch ($error) { switch ($error) {
@ -791,6 +797,11 @@ EOT
$text .= "Upgrade your PHP ({$current}) to use this location with Composer.".PHP_EOL; $text .= "Upgrade your PHP ({$current}) to use this location with Composer.".PHP_EOL;
break; break;
case 'uopz':
$text = "The uopz extension ignores exit calls and may not work with all Composer commands.".PHP_EOL;
$text .= "Disabling it when using Composer is recommended.";
break;
default: default:
throw new \InvalidArgumentException(sprintf("DiagnoseCommand: Unknown warning type \"%s\". Please report at https://github.com/composer/composer/issues/new.", $warning)); throw new \InvalidArgumentException(sprintf("DiagnoseCommand: Unknown warning type \"%s\". Please report at https://github.com/composer/composer/issues/new.", $warning));
} }