2023-11-05 17:53:48 +08:00
|
|
|
<?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
|
|
|
|
|
{
|
2024-03-16 22:37:39 +08:00
|
|
|
public function getDistName(): string
|
|
|
|
|
{
|
|
|
|
|
return '';
|
|
|
|
|
}
|
|
|
|
|
|
2024-01-10 21:08:25 +08:00
|
|
|
public function runCliCheckUnix(): void
|
2023-11-05 17:53:48 +08:00
|
|
|
{
|
2025-02-16 02:30:08 +09:00
|
|
|
[$ret] = shell()->execWithResult(BUILD_ROOT_PATH . '/bin/php -n -r "assert(defined(\'PASSWORD_ARGON2I\'));"');
|
2023-11-05 17:53:48 +08:00
|
|
|
if ($ret !== 0) {
|
|
|
|
|
throw new RuntimeException('extension ' . $this->getName() . ' failed sanity check');
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|