mirror of
https://github.com/getnamingo/registry.git
synced 2025-07-20 17:46:03 +02:00
Added basic domain history page; will be expanded
This commit is contained in:
parent
6ca9e5256a
commit
5e49fbc2bb
6 changed files with 220 additions and 1 deletions
|
@ -32,4 +32,28 @@ try {
|
|||
|
||||
} catch (PDOException $e) {
|
||||
$log->alert("Database connection failed: " . $e->getMessage(), ['driver' => $defaultDriver]);
|
||||
}
|
||||
|
||||
// Audit DB (optional)
|
||||
try {
|
||||
$auditDriver = match ($defaultDriver) {
|
||||
'mysql' => "{$config['mysql']['driver']}:dbname=registryAudit;host={$config['mysql']['host']};charset={$config['mysql']['charset']}",
|
||||
'sqlite' => "{$config['sqlite']['driver']}:{$config['sqlite']['audit_path']}", // assumes audit_path is set for SQLite
|
||||
'pgsql' => "{$config['pgsql']['driver']}:dbname=registryAudit;host={$config['pgsql']['host']}",
|
||||
default => throw new \RuntimeException('Unsupported database driver for audit'),
|
||||
};
|
||||
|
||||
if (str_starts_with($auditDriver, "sqlite")) {
|
||||
$pdo_audit = new \PDO($auditDriver);
|
||||
} else {
|
||||
$pdo_audit = new \PDO(
|
||||
$auditDriver,
|
||||
$config[$defaultDriver]['username'],
|
||||
$config[$defaultDriver]['password']
|
||||
);
|
||||
}
|
||||
|
||||
$db_audit = PdoDatabase::fromPdo($pdo_audit);
|
||||
} catch (PDOException $e) {
|
||||
$log->alert("Audit database connection failed: " . $e->getMessage(), ['driver' => 'audit']);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue