From 4fa7d93ff66cfc358aa591ccf41cc273aa1b8714 Mon Sep 17 00:00:00 2001 From: Flatlogic Bot Date: Sat, 2 May 2026 03:10:43 +0000 Subject: [PATCH] index update --- index.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/index.php b/index.php index 04121e8..c218780 100644 --- a/index.php +++ b/index.php @@ -102,6 +102,10 @@ if (!function_exists('runtime_debug_infer_schema_hint')) { function runtime_debug_infer_schema_hint(Throwable $throwable): ?string { $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)) { return 'Missing table: ' . $matches[1]; } @@ -301,9 +305,12 @@ require_once 'includes/DatabaseInstaller.php'; try { if (!DatabaseInstaller::isInstalled()) { DatabaseInstaller::install(); + } elseif (method_exists('DatabaseInstaller', 'ensureCurrentSchema')) { + DatabaseInstaller::ensureCurrentSchema(); + } else { + error_log('Skipping DatabaseInstaller::ensureCurrentSchema() because the loaded DatabaseInstaller class does not define it.'); } - DatabaseInstaller::ensureCurrentSchema(); -} catch (Exception $e) { +} catch (Throwable $e) { die("Installation Error: " . $e->getMessage()); }