add redis-session support

This commit is contained in:
crazywhalecc 2023-08-09 11:00:01 +08:00 committed by Jerry Ma
parent a6f07051c3
commit 61d1507a4d
2 changed files with 10 additions and 2 deletions

View File

@ -298,7 +298,10 @@
"redis": { "redis": {
"type": "external", "type": "external",
"source": "redis", "source": "redis",
"arg-type": "custom" "arg-type": "custom",
"ext-suggests": [
"session"
]
}, },
"session": { "session": {
"type": "builtin" "type": "builtin"

View File

@ -12,7 +12,12 @@ class redis extends Extension
{ {
public function getUnixConfigureArg(): string public function getUnixConfigureArg(): string
{ {
$arg = '--enable-redis --disable-redis-session'; $arg = '--enable-redis';
if (!$this->builder->getExt('session')) {
$arg .= ' --disable-redis-session';
} else {
$arg .= ' --enable-redis-session';
}
if ($this->builder->getLib('zstd')) { if ($this->builder->getLib('zstd')) {
$arg .= ' --enable-redis-zstd --with-libzstd="' . BUILD_ROOT_PATH . '"'; $arg .= ' --enable-redis-zstd --with-libzstd="' . BUILD_ROOT_PATH . '"';
} }