index update

This commit is contained in:
Flatlogic Bot 2026-05-02 03:10:43 +00:00
parent 6d25117591
commit 4fa7d93ff6

View File

@ -102,6 +102,10 @@ if (!function_exists('runtime_debug_infer_schema_hint')) {
function runtime_debug_infer_schema_hint(Throwable $throwable): ?string { function runtime_debug_infer_schema_hint(Throwable $throwable): ?string {
$message = $throwable->getMessage(); $message = $throwable->getMessage();
if (str_contains($message, 'Call to undefined method DatabaseInstaller::ensureCurrentSchema()')) {
return 'Outdated installer class: re-sync includes/DatabaseInstaller.php with the latest project version.';
}
if (preg_match("/Table '[^']+\.([^']+)' doesn't exist/i", $message, $matches)) { if (preg_match("/Table '[^']+\.([^']+)' doesn't exist/i", $message, $matches)) {
return 'Missing table: ' . $matches[1]; return 'Missing table: ' . $matches[1];
} }
@ -301,9 +305,12 @@ require_once 'includes/DatabaseInstaller.php';
try { try {
if (!DatabaseInstaller::isInstalled()) { if (!DatabaseInstaller::isInstalled()) {
DatabaseInstaller::install(); DatabaseInstaller::install();
} } elseif (method_exists('DatabaseInstaller', 'ensureCurrentSchema')) {
DatabaseInstaller::ensureCurrentSchema(); DatabaseInstaller::ensureCurrentSchema();
} catch (Exception $e) { } else {
error_log('Skipping DatabaseInstaller::ensureCurrentSchema() because the loaded DatabaseInstaller class does not define it.');
}
} catch (Throwable $e) {
die("Installation Error: " . $e->getMessage()); die("Installation Error: " . $e->getMessage());
} }