Fix missing SPC_EXTRA_LIBS with type error bug

This commit is contained in:
crazywhalecc 2025-08-01 00:09:05 +08:00
parent 4c54d99621
commit 5f9fe2948c
No known key found for this signature in database
GPG Key ID: 1F4BDD59391F2680
2 changed files with 2 additions and 2 deletions

View File

@ -61,7 +61,7 @@ class curl extends Extension
public function patchBeforeMake(): bool
{
$patched = parent::patchBeforeMake();
$extra_libs = getenv('SPC_EXTRA_LIBS');
$extra_libs = getenv('SPC_EXTRA_LIBS') ?: '';
if ($this->builder instanceof WindowsBuilder && !str_contains($extra_libs, 'secur32.lib')) {
$extra_libs .= ' secur32.lib';
putenv('SPC_EXTRA_LIBS=' . trim($extra_libs));

View File

@ -49,7 +49,7 @@ class imap extends Extension
if (PHP_OS_FAMILY !== 'Linux' || SystemUtil::isMuslDist()) {
return $patched;
}
$extra_libs = trim(getenv('SPC_EXTRA_LIBS') . ' -lcrypt');
$extra_libs = trim((getenv('SPC_EXTRA_LIBS') ?: '') . ' -lcrypt');
f_putenv('SPC_EXTRA_LIBS=' . $extra_libs);
return true;
}