diff --git a/src/SPC/ConsoleApplication.php b/src/SPC/ConsoleApplication.php index 0ef842b6..cfebb831 100644 --- a/src/SPC/ConsoleApplication.php +++ b/src/SPC/ConsoleApplication.php @@ -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() { diff --git a/src/SPC/builder/extension/pgsql.php b/src/SPC/builder/extension/pgsql.php index 8b447a16..1c82d7d0 100644 --- a/src/SPC/builder/extension/pgsql.php +++ b/src/SPC/builder/extension/pgsql.php @@ -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; + } }