mirror of
https://github.com/getnamingo/registry.git
synced 2025-08-05 17:18:04 +02:00
PgSQL updates in other components
This commit is contained in:
parent
ba05bd618c
commit
274760f2c5
7 changed files with 36 additions and 13 deletions
|
@ -34,7 +34,8 @@ $server->on('connect', function ($server, $fd) {
|
|||
$server->on('receive', function ($server, $fd, $reactorId, $data) {
|
||||
// Connect to the database
|
||||
try {
|
||||
$pdo = new PDO('mysql:host=localhost;dbname=registry', 'registry-select', 'EPPRegistrySELECT');
|
||||
$c = require_once 'config.php';
|
||||
$pdo = new PDO("{$c['db_type']}:host={$c['db_host']};dbname={$c['db_database']}", $c['db_username'], $c['db_password']);
|
||||
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
||||
} catch (PDOException $e) {
|
||||
$server->send($fd, "Error connecting to database");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue