1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

gen_stub: inline computeStubHash()

This commit is contained in:
Daniel Scherzer
2025-05-15 14:30:52 -04:00
parent 2ed5472f06
commit ecc403a8fa

View File

@@ -84,7 +84,7 @@ function processStubFile(string $stubFile, Context $context, bool $includeOnly =
$legacyFile = "{$stubFilenameWithoutExtension}_legacy_arginfo.h";
$stubCode = file_get_contents($stubFile);
$stubHash = computeStubHash($stubCode);
$stubHash = sha1(str_replace("\r\n", "\n", $stubCode));
$oldStubHash = extractStubHash($arginfoFile);
if ($stubHash === $oldStubHash && !$context->forceParse) {
/* Stub file did not change, do not regenerate. */
@@ -153,10 +153,6 @@ function processStubFile(string $stubFile, Context $context, bool $includeOnly =
}
}
function computeStubHash(string $stubCode): string {
return sha1(str_replace("\r\n", "\n", $stubCode));
}
function extractStubHash(string $arginfoFile): ?string {
if (!file_exists($arginfoFile)) {
return null;