mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-12 03:15:35 +08:00
29 lines
888 B
PHP
29 lines
888 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Package\Extension;
|
|
|
|
use StaticPHP\Attribute\Package\CustomPhpConfigureArg;
|
|
use StaticPHP\Attribute\Package\Extension;
|
|
use StaticPHP\Package\PackageInstaller;
|
|
|
|
#[Extension('mbstring')]
|
|
class mbstring
|
|
{
|
|
#[CustomPhpConfigureArg('Linux')]
|
|
#[CustomPhpConfigureArg('Darwin')]
|
|
public function getUnixConfigureArg(bool $shared, PackageInstaller $installer): string
|
|
{
|
|
$arg = '--enable-mbstring' . ($shared ? '=shared' : '');
|
|
$arg .= $installer->isPackageResolved('ext-mbregex') === false ? ' --disable-mbregex' : ' --enable-mbregex';
|
|
return $arg;
|
|
}
|
|
|
|
#[CustomPhpConfigureArg('Windows')]
|
|
public function getWinConfigureArg(PackageInstaller $installer): string
|
|
{
|
|
return '--enable-mbstring ' . ($installer->isPackageResolved('ext-mbregex') ? '--enable-mbregex' : ' --disable-mbregex');
|
|
}
|
|
}
|