Delete comment
This commit is contained in:
@@ -1,32 +1,32 @@
|
||||
<?php
|
||||
// config/database.php
|
||||
class Database {
|
||||
private static $instance = null;
|
||||
private $connection;
|
||||
|
||||
private function __construct() {
|
||||
try {
|
||||
$this->connection = new PDO(
|
||||
"pgsql:host=185.130.224.177;port=5481;dbname=postgres",
|
||||
"admin",
|
||||
"38feaad2840ccfda0e71243a6faaecfd"
|
||||
);
|
||||
$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;
|
||||
}
|
||||
}
|
||||
<?php
|
||||
|
||||
class Database {
|
||||
private static $instance = null;
|
||||
private $connection;
|
||||
|
||||
private function __construct() {
|
||||
try {
|
||||
$this->connection = new PDO(
|
||||
"pgsql:host=185.130.224.177;port=5481;dbname=postgres",
|
||||
"admin",
|
||||
"38feaad2840ccfda0e71243a6faaecfd"
|
||||
);
|
||||
$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;
|
||||
}
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user