- api.fahrschultermin.de: full API entry point with CORS + session auth - fahrschultermin.de: frontend only, no more /api/v1 routing - Database.php: PostgreSQL support (pgsql driver + lastval()) - All repositories: use Database::lastInsertId() for PG compatibility - config/app.php: PostgreSQL connection settings + CORS config - bootstrap.php: pass full $config to Database::configure() - public/index.php: fetch-patch to redirect /api/v1 to api.fahrschultermin.de - database/schema_pgsql.sql: full PostgreSQL schema (BIGSERIAL) - database/import_pgsql.sql: 518 rows migrated from SQLite
29 lines
424 B
PHP
29 lines
424 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Repositories;
|
|
|
|
use App\Support\Database;
|
|
use PDO;
|
|
|
|
abstract class BaseRepository
|
|
{
|
|
protected PDO $db;
|
|
|
|
public function __construct()
|
|
{
|
|
$this->db = Database::connection();
|
|
}
|
|
|
|
protected function lastInsertId(): string
|
|
{
|
|
return Database::lastInsertId();
|
|
}
|
|
|
|
protected function now(): string
|
|
{
|
|
return gmdate('c');
|
|
}
|
|
}
|