swoole enable pgsql

This commit is contained in:
jingjingxyk
2023-11-29 22:19:20 +08:00
parent 266108b25f
commit 7c866cb0e3
3 changed files with 62 additions and 17 deletions

View File

@@ -13,12 +13,23 @@ class swoole extends Extension
public function getUnixConfigureArg(): string
{
$arg = '--enable-swoole';
// pgsql hook is buggy for static php
$arg .= ' --disable-swoole-pgsql';
$options = '';
if ($this->builder->getLib('postgresql')) {
if (!$this->builder->getExt('pdo_pgsql')) {
$options .= '--enable-swoole-pgsql';
}
} else {
$options .= '--disable-swoole-pgsql';
}
$arg .= $options;
$arg .= $this->builder->getLib('openssl') ? ' --enable-openssl' : ' --disable-openssl --without-openssl';
$arg .= $this->builder->getLib('brotli') ? (' --enable-brotli --with-brotli-dir=' . BUILD_ROOT_PATH) : ' --disable-brotli';
$arg .= $this->builder->getLib(
'brotli'
) ? (' --enable-brotli --with-brotli-dir=' . BUILD_ROOT_PATH) : ' --disable-brotli';
// swoole curl hook is buggy for php 8.0
$arg .= $this->builder->getExt('curl') && $this->builder->getPHPVersionID() >= 80100 ? ' --enable-swoole-curl' : ' --disable-swoole-curl';
$arg .= $this->builder->getExt('curl') && $this->builder->getPHPVersionID(
) >= 80100 ? ' --enable-swoole-curl' : ' --disable-swoole-curl';
return $arg;
}
}