index update
This commit is contained in:
parent
6d25117591
commit
4fa7d93ff6
11
index.php
11
index.php
@ -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());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user