Add ext-mbstring,ext-mbregex,onig

This commit is contained in:
crazywhalecc
2026-02-04 16:24:57 +08:00
parent 0652d4aa03
commit 3fa2d69813
6 changed files with 78 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
<?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;
}
}