1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-13 15:45:56 +00:00

finalize config:: migration; make config.php optional

This commit is contained in:
Andrew Dolgov
2021-02-22 22:51:12 +03:00
parent 6b7af973b2
commit 445ac1213c
3 changed files with 9 additions and 4 deletions

View File

@@ -17,8 +17,8 @@ class Db
// normal usage is Db::pdo()->prepare(...) etc
public function pdo_connect() {
$db_port = defined('DB_PORT') && DB_PORT ? ';port=' . DB_PORT : '';
$db_host = defined('DB_HOST') && DB_HOST ? ';host=' . DB_HOST : '';
$db_port = Config::get(Config::DB_PORT) ? ';port=' . Config::get(Config::DB_PORT) : '';
$db_host = Config::get(Config::DB_HOST) ? ';host=' . Config::get(Config::DB_HOST) : '';
try {
$pdo = new PDO(Config::get(Config::DB_TYPE) . ':dbname=' . Config::get(Config::DB_NAME) . $db_host . $db_port,