2023-04-15 18:45:11 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
|
|
namespace SPC\builder\extension;
|
|
|
|
|
|
|
|
|
|
use SPC\builder\Extension;
|
|
|
|
|
use SPC\util\CustomExt;
|
|
|
|
|
|
|
|
|
|
#[CustomExt('redis')]
|
|
|
|
|
class redis extends Extension
|
|
|
|
|
{
|
|
|
|
|
public function getUnixConfigureArg(): string
|
|
|
|
|
{
|
2023-08-09 11:00:01 +08:00
|
|
|
$arg = '--enable-redis';
|
2023-12-23 13:53:22 +08:00
|
|
|
$arg .= $this->builder->getExt('session') ? ' --enable-redis-session' : ' --disable-redis-session';
|
|
|
|
|
$arg .= $this->builder->getExt('igbinary') ? ' --enable-redis-igbinary' : ' --disable-redis-igbinary';
|
2023-04-15 18:45:11 +08:00
|
|
|
if ($this->builder->getLib('zstd')) {
|
|
|
|
|
$arg .= ' --enable-redis-zstd --with-libzstd="' . BUILD_ROOT_PATH . '"';
|
|
|
|
|
}
|
2023-12-23 13:53:22 +08:00
|
|
|
if ($this->builder->getLib('liblz4')) {
|
|
|
|
|
$arg .= ' --enable-redis-lz4 --with-liblz4="' . BUILD_ROOT_PATH . '"';
|
|
|
|
|
}
|
2023-04-15 18:45:11 +08:00
|
|
|
return $arg;
|
|
|
|
|
}
|
2024-08-12 12:11:17 +08:00
|
|
|
|
|
|
|
|
public function getWindowsConfigureArg(): string
|
|
|
|
|
{
|
|
|
|
|
$arg = '--enable-redis';
|
|
|
|
|
$arg .= $this->builder->getExt('session') ? ' --enable-redis-session' : ' --disable-redis-session';
|
|
|
|
|
$arg .= $this->builder->getExt('igbinary') ? ' --enable-redis-igbinary' : ' --disable-redis-igbinary';
|
|
|
|
|
return $arg;
|
|
|
|
|
}
|
2023-04-15 18:45:11 +08:00
|
|
|
}
|