mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-18 21:04:52 +08:00
27 lines
614 B
PHP
27 lines
614 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace SPC\builder\extension;
|
|
|
|
use SPC\builder\Extension;
|
|
use SPC\exception\RuntimeException;
|
|
use SPC\util\CustomExt;
|
|
|
|
#[CustomExt('password-argon2')]
|
|
class password_argon2 extends Extension
|
|
{
|
|
public function getDistName(): string
|
|
{
|
|
return '';
|
|
}
|
|
|
|
public function runCliCheckUnix(): void
|
|
{
|
|
[$ret] = shell()->execWithResult(BUILD_ROOT_PATH . '/bin/php -n -r "assert(defined(\'PASSWORD_ARGON2I\'));"');
|
|
if ($ret !== 0) {
|
|
throw new RuntimeException('extension ' . $this->getName() . ' failed sanity check');
|
|
}
|
|
}
|
|
}
|