Add openssl argon2 password hash support for PHP 8.5

This commit is contained in:
crazywhalecc
2025-07-30 23:02:28 +08:00
parent 9ed3c8b498
commit 5f5d934d58
5 changed files with 37 additions and 3 deletions

View File

@@ -26,6 +26,14 @@ class openssl extends Extension
public function getUnixConfigureArg(bool $shared = false): string
{
$openssl_dir = $this->builder->getPHPVersionID() >= 80400 ? '' : ' --with-openssl-dir=' . BUILD_ROOT_PATH;
return '--with-openssl=' . ($shared ? 'shared,' : '') . BUILD_ROOT_PATH . $openssl_dir;
$args = '--with-openssl=' . ($shared ? 'shared,' : '') . BUILD_ROOT_PATH . $openssl_dir;
if (
$this->builder->getPHPVersionID() >= 80500 &&
($ver = $this->builder->getLib('openssl')->getLibVersion()) &&
version_compare($ver, '3.2.0', '>=')
) {
$args .= ' --with-openssl-argon2 OPENSSL_LIBS="-lz"';
}
return $args;
}
}