mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-22 08:15:35 +08:00
update comments
This commit is contained in:
@@ -46,37 +46,29 @@ class swoole extends Extension
|
|||||||
// enable swoole
|
// enable swoole
|
||||||
$arg = '--enable-swoole' . ($shared ? '=shared' : '');
|
$arg = '--enable-swoole' . ($shared ? '=shared' : '');
|
||||||
|
|
||||||
// commonly-used feature: coroutine-time
|
// commonly used feature: coroutine-time
|
||||||
$arg .= ' --enable-swoole-coro-time --with-pic';
|
$arg .= ' --enable-swoole-coro-time --with-pic';
|
||||||
|
|
||||||
$arg .= $this->builder->getOption('enable-zts') ? ' --enable-swoole-thread --disable-thread-context' : ' --disable-swoole-thread --enable-thread-context';
|
$arg .= $this->builder->getOption('enable-zts') ? ' --enable-swoole-thread --disable-thread-context' : ' --disable-swoole-thread --enable-thread-context';
|
||||||
|
|
||||||
// required feature: curl, openssl (but curl hook is buggy for php 8.0)
|
// required features: curl, openssl (but curl hook is buggy for php 8.0)
|
||||||
$arg .= $this->builder->getPHPVersionID() >= 80100 ? ' --enable-swoole-curl' : ' --disable-swoole-curl';
|
$arg .= $this->builder->getPHPVersionID() >= 80100 ? ' --enable-swoole-curl' : ' --disable-swoole-curl';
|
||||||
$arg .= ' --enable-openssl';
|
$arg .= ' --enable-openssl';
|
||||||
|
|
||||||
// additional feature: c-ares, brotli, nghttp2 (can be disabled, but we enable it by default in config to support full network feature)
|
// additional features that only require libraries
|
||||||
$arg .= $this->builder->getLib('libcares') ? ' --enable-cares' : '';
|
$arg .= $this->builder->getLib('libcares') ? ' --enable-cares' : '';
|
||||||
if (!$shared) {
|
$arg .= $this->builder->getLib('brotli') ? (' --enable-brotli --with-brotli-dir=' . BUILD_ROOT_PATH) : '';
|
||||||
$arg .= $this->builder->getLib('brotli') ? (' --enable-brotli --with-brotli-dir=' . BUILD_ROOT_PATH) : '';
|
|
||||||
}
|
|
||||||
$arg .= $this->builder->getLib('nghttp2') ? (' --with-nghttp2-dir=' . BUILD_ROOT_PATH) : '';
|
$arg .= $this->builder->getLib('nghttp2') ? (' --with-nghttp2-dir=' . BUILD_ROOT_PATH) : '';
|
||||||
$arg .= $this->builder->getLib('zstd') ? ' --enable-zstd' : '';
|
$arg .= $this->builder->getLib('zstd') ? ' --enable-zstd' : '';
|
||||||
$arg .= $this->builder->getLib('liburing') ? ' --enable-iouring' : '';
|
$arg .= $this->builder->getLib('liburing') ? ' --enable-iouring' : '';
|
||||||
$arg .= $this->builder->getExt('sockets') ? ' --enable-sockets' : '';
|
$arg .= $this->builder->getExt('sockets') ? ' --enable-sockets' : '';
|
||||||
|
|
||||||
// additional feature: swoole-pgsql, it should depend on lib [postgresql], but it will lack of CFLAGS etc.
|
// enable additional features that require the pdo extension, but conflict with pdo_* extensions
|
||||||
// so this is a tricky way (enable ext [pgsql,pdo] to add postgresql hook and pdo_pgsql support)
|
// to make sure everything works as it should, this is done in fake addon extensions
|
||||||
$arg .= $this->builder->getExt('swoole-hook-pgsql') ? ' --enable-swoole-pgsql' : ' --disable-swoole-pgsql';
|
$arg .= $this->builder->getExt('swoole-hook-pgsql') ? ' --enable-swoole-pgsql' : ' --disable-swoole-pgsql';
|
||||||
|
|
||||||
// additional feature: swoole-mysql
|
|
||||||
$arg .= $this->builder->getExt('swoole-hook-mysql') ? ' --enable-mysqlnd' : ' --disable-mysqlnd';
|
$arg .= $this->builder->getExt('swoole-hook-mysql') ? ' --enable-mysqlnd' : ' --disable-mysqlnd';
|
||||||
|
|
||||||
// enable this feature , need remove pdo_sqlite
|
|
||||||
// more info : https://wenda.swoole.com/detail/109023
|
|
||||||
$arg .= $this->builder->getExt('swoole-hook-sqlite') ? ' --enable-swoole-sqlite' : ' --disable-swoole-sqlite';
|
$arg .= $this->builder->getExt('swoole-hook-sqlite') ? ' --enable-swoole-sqlite' : ' --disable-swoole-sqlite';
|
||||||
|
|
||||||
// enable this feature , need stop pdo_*
|
|
||||||
$config = (new SPCConfigUtil($this->builder, ['libs_only_deps' => true]))->config([], ['unixodbc']);
|
$config = (new SPCConfigUtil($this->builder, ['libs_only_deps' => true]))->config([], ['unixodbc']);
|
||||||
$arg .= $this->builder->getExt('swoole-hook-odbc') ? ' --with-swoole-odbc=unixODBC,' . BUILD_ROOT_PATH . ' SWOOLE_ODBC_LIBS="' . $config['libs'] . '"' : '';
|
$arg .= $this->builder->getExt('swoole-hook-odbc') ? ' --with-swoole-odbc=unixODBC,' . BUILD_ROOT_PATH . ' SWOOLE_ODBC_LIBS="' . $config['libs'] . '"' : '';
|
||||||
return $arg;
|
return $arg;
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ class swoole_hook_odbc extends Extension
|
|||||||
throw new ValidationException("extension {$this->getName()} failed compile check: php-cli returned {$ret}", validation_module: "Extension {$this->getName()} sanity check");
|
throw new ValidationException("extension {$this->getName()} failed compile check: php-cli returned {$ret}", validation_module: "Extension {$this->getName()} sanity check");
|
||||||
}
|
}
|
||||||
if (!str_contains($out, 'coroutine_odbc')) {
|
if (!str_contains($out, 'coroutine_odbc')) {
|
||||||
throw new ValidationException('swoole sqlite hook is not enabled correctly.', validation_module: 'Extension swoole sqlite hook availability check');
|
throw new ValidationException('swoole odbc hook is not enabled correctly.', validation_module: 'Extension swoole odbc hook availability check');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user