mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-18 04:44:53 +08:00
overwrite mbregex cli check
This commit is contained in:
parent
dccfde9f39
commit
ff74f0cdaf
@ -5,18 +5,25 @@ declare(strict_types=1);
|
|||||||
namespace SPC\builder\extension;
|
namespace SPC\builder\extension;
|
||||||
|
|
||||||
use SPC\builder\Extension;
|
use SPC\builder\Extension;
|
||||||
|
use SPC\exception\RuntimeException;
|
||||||
use SPC\util\CustomExt;
|
use SPC\util\CustomExt;
|
||||||
|
|
||||||
#[CustomExt('mbregex')]
|
#[CustomExt('mbregex')]
|
||||||
class mbregex extends Extension
|
class mbregex extends Extension
|
||||||
{
|
{
|
||||||
public function getDistName(): string
|
|
||||||
{
|
|
||||||
return 'mbstring';
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getConfigureArg(): string
|
public function getConfigureArg(): string
|
||||||
{
|
{
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* mbregex is not an extension, we need to overwrite the default check.
|
||||||
|
*/
|
||||||
|
public function runCliCheck(): void
|
||||||
|
{
|
||||||
|
[$ret] = shell()->execWithResult(BUILD_ROOT_PATH . '/bin/php --ri "mbstring" | grep regex', false);
|
||||||
|
if ($ret !== 0) {
|
||||||
|
throw new RuntimeException('extension ' . $this->getName() . ' failed compile check: compiled php-cli mbstring extension does not contain regex !');
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user