Add .gitignore and project files

This commit is contained in:
kirill.khorkov
2025-12-16 01:28:06 +03:00
parent 0541b0c020
commit 3f257120fa
140 changed files with 13360 additions and 0 deletions

32
config/database.php Normal file
View File

@@ -0,0 +1,32 @@
<?php
// config/database.php
class Database {
private static $instance = null;
private $connection;
private function __construct() {
try {
$this->connection = new PDO(
"pgsql:host=localhost;dbname=aeterna_db;",
"postgres",
"1234"
);
$this->connection->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$this->connection->exec("SET NAMES 'utf8'");
} catch(PDOException $e) {
die("Ошибка подключения: " . $e->getMessage());
}
}
public static function getInstance() {
if (self::$instance == null) {
self::$instance = new Database();
}
return self::$instance;
}
public function getConnection() {
return $this->connection;
}
}
?>