PDO::ERRMODE_EXCEPTION,PDO::ATTR_DEFAULT_FETCH_MODE=>PDO::FETCH_ASSOC,PDO::ATTR_EMULATE_PREPARES=>false]);
$attempts[]=['dsn'=>$dsn,'ok'=>true];
return $pdo;
}catch(Throwable $e){
$attempts[]=['dsn'=>$dsn,'ok'=>false,'error'=>$e->getMessage()];
return null;
}
};
if (is_array($cfg)) $pdo=$mkPdo($cfg);
$tables = [
$prefix.'templates',
$prefix.'sections',
$prefix.'blocks',
$prefix.'snippets',
$prefix.'template_items',
$prefix.'section_items',
];
$tblStatus=[];
if ($pdo){
foreach($tables as $t){
try{ $pdo->query("SELECT 1 FROM {$t} LIMIT 1"); $tblStatus[$t]='ok'; }
catch(Throwable $e){ $tblStatus[$t]='missing/invalid: '.$e->getMessage(); }
}
}
?>
DB-Doctor (=h($profile)?>)
DB-Doctor (Profil: =h($profile)?>)
Verbindungsversuche
| DSN | Ergebnis | Detail |
=h($a['dsn'])?> |
= !empty($a['ok']) ? 'OK' : 'FAIL' ?> |
= h($a['error'] ?? '') ?> |
Tabellen-Check (Templates-Schema)
| Tabelle | Status |
=h($t)?> |
OK' : ''.h($s).''; ?>
|
Rohdaten
=h(json_encode([
'prefix'=>$prefix,
'hasPdo'=>!!$pdo,
'configKeys'=>array_keys($conf),
], JSON_PRETTY_PRINT|JSON_UNESCAPED_UNICODE|JSON_UNESCAPED_SLASHES))?>