mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-17 20:34:51 +08:00
Fix pgsql with PHP 8.4 embed missing libs bug
This commit is contained in:
parent
a8a071de1a
commit
05b602d38c
@ -30,7 +30,7 @@ use Symfony\Component\Console\Application;
|
||||
*/
|
||||
final class ConsoleApplication extends Application
|
||||
{
|
||||
public const VERSION = '2.4.0';
|
||||
public const VERSION = '2.4.1';
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
|
||||
@ -6,6 +6,8 @@ namespace SPC\builder\extension;
|
||||
|
||||
use SPC\builder\Extension;
|
||||
use SPC\exception\FileSystemException;
|
||||
use SPC\exception\RuntimeException;
|
||||
use SPC\exception\WrongUsageException;
|
||||
use SPC\store\FileSystem;
|
||||
use SPC\util\CustomExt;
|
||||
|
||||
@ -13,10 +15,21 @@ use SPC\util\CustomExt;
|
||||
class pgsql extends Extension
|
||||
{
|
||||
/**
|
||||
* @return bool
|
||||
* @throws FileSystemException
|
||||
* @throws RuntimeException
|
||||
* @throws WrongUsageException
|
||||
*/
|
||||
public function patchBeforeConfigure(): bool
|
||||
{
|
||||
if ($this->builder->getPHPVersionID() >= 80400) {
|
||||
FileSystem::replaceFileStr(
|
||||
SOURCE_PATH . '/php-src/configure',
|
||||
'LIBS="-lpq',
|
||||
'LIBS="-lpq -lpgport -lpgcommon'
|
||||
);
|
||||
return true;
|
||||
}
|
||||
FileSystem::replaceFileRegex(
|
||||
SOURCE_PATH . '/php-src/configure',
|
||||
'/-lpq/',
|
||||
@ -24,4 +37,16 @@ class pgsql extends Extension
|
||||
);
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws WrongUsageException
|
||||
* @throws RuntimeException
|
||||
*/
|
||||
public function getUnixConfigureArg(): string
|
||||
{
|
||||
if ($this->builder->getPHPVersionID() >= 80400) {
|
||||
return '--with-pgsql=' . BUILD_ROOT_PATH . ' PGSQL_CFLAGS=-I' . BUILD_INCLUDE_PATH . ' PGSQL_LIBS="-L' . BUILD_LIB_PATH . ' -lpq -lpgport -lpgcommon"';
|
||||
}
|
||||
return '--with-pgsql=' . BUILD_ROOT_PATH;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user