Drink it cold: Terminplanung für Kühlanhänger

This commit is contained in:
OpenCode 2026-11-13 00:35:39 +01:00
commit ec88c8ebac
55 changed files with 7091 additions and 0 deletions

28
app/db.php Normal file
View file

@ -0,0 +1,28 @@
<?php
declare(strict_types=1);
function db(): PDO
{
static $pdo = null;
if ($pdo instanceof PDO) {
return $pdo;
}
$db = (array) config('db', []);
$dsn = sprintf(
'mysql:host=%s;port=%d;dbname=%s;charset=%s',
(string) ($db['host'] ?? 'localhost'),
(int) ($db['port'] ?? 3306),
(string) ($db['name'] ?? ''),
(string) ($db['charset'] ?? 'utf8mb4')
);
$pdo = new PDO($dsn, (string) ($db['user'] ?? ''), (string) ($db['password'] ?? ''), [
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
PDO::ATTR_EMULATE_PREPARES => false,
PDO::ATTR_STRINGIFY_FETCHES => false,
]);
$pdo->exec("SET time_zone = '+00:00'");
return $pdo;
}