pdo connection string: properly check for DB_PORT

This commit is contained in:
Andrew Dolgov 2017-12-03 13:37:43 +03:00
parent 1f16f9b8ae
commit 28040002f3

View file

@ -25,7 +25,7 @@ class Db implements IDb {
exit(100);
}
$db_port = defined(DB_PORT) ? ';port='.DB_PORT : '';
$db_port = defined('DB_PORT') && DB_PORT ? ';port='.DB_PORT : '';
$this->pdo = new PDO(DB_TYPE . ':dbname='.DB_NAME.';host='.DB_HOST.$db_port,
DB_USER,