mirror of
https://github.com/getnamingo/registry.git
synced 2025-08-04 00:31:50 +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
10
rdap/config.php
Normal file
10
rdap/config.php
Normal file
|
@ -0,0 +1,10 @@
|
|||
<?php
|
||||
|
||||
return [
|
||||
'db_type' => 'mysql',
|
||||
'db_host' => 'localhost',
|
||||
'db_port' => 3306,
|
||||
'db_database' => 'your_database_name',
|
||||
'db_username' => 'your_username',
|
||||
'db_password' => 'your_password'
|
||||
];
|
|
@ -55,7 +55,8 @@ $http->set([
|
|||
$http->on('request', function ($request, $response) {
|
||||
// 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) {
|
||||
$response->header('Content-Type', 'application/json');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue