ChatGPT's update to harden software and run db updates.

This commit is contained in:
2026-10-21 06:53:45 -04:00
parent 1e63076123
commit acc8cb70f5
171 changed files with 9325 additions and 404 deletions
+14
View File
@@ -0,0 +1,14 @@
<?php
final class BackupValidation {
/** mariadb-dump writes the completion comment at the end; never load the dump. */
public static function complete(string $path): bool {
clearstatcache(true,$path);
if(!is_file($path)||filesize($path)<100)return false;
$stream=fopen($path,'rb');if(!$stream)return false;
try{
if(fseek($stream,max(0,filesize($path)-8192),SEEK_SET)!==0)return false;
$tail=fread($stream,8192);
return $tail!==false&&preg_match('/(?:\A|\r?\n)-- Dump completed on [^\r\n]+(?:\r?\n)*\z/',$tail)===1;
}finally{fclose($stream);}
}
}