mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-18 21:04:52 +08:00
33 lines
720 B
PHP
33 lines
720 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
declare(strict_types=1);
|
||
|
|
|
||
|
|
namespace SPC\builder\extension;
|
||
|
|
|
||
|
|
use SPC\builder\Extension;
|
||
|
|
use SPC\exception\WrongUsageException;
|
||
|
|
use SPC\util\CustomExt;
|
||
|
|
|
||
|
|
#[CustomExt('spx')]
|
||
|
|
class spx extends Extension
|
||
|
|
{
|
||
|
|
/**
|
||
|
|
* @throws WrongUsageException
|
||
|
|
*/
|
||
|
|
public function validate(): void
|
||
|
|
{
|
||
|
|
if ($this->builder->getOption('enable-zts')) {
|
||
|
|
throw new WrongUsageException('ext-spx is not thread safe, do not build it with ZTS builds');
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
public function getUnixConfigureArg(): string
|
||
|
|
{
|
||
|
|
$arg = '--enable-spx';
|
||
|
|
if ($this->builder->getExt('zlib') === null) {
|
||
|
|
$arg .= ' --with-zlib-dir=' . BUILD_ROOT_PATH;
|
||
|
|
}
|
||
|
|
return $arg;
|
||
|
|
}
|
||
|
|
}
|