diff options
-rw-r--r-- | lib/mysql.php | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/mysql.php b/lib/mysql.php index 9fa32cb..01fe58e 100644 --- a/lib/mysql.php +++ b/lib/mysql.php @@ -20,6 +20,15 @@ namespace { if ($new !== false) { trigger_error('Argument $new is no longer supported in PHP > 7', E_USER_WARNING); } + if (!$hostname) { + $hostname = ini_get("mysqli.default_host"); + } + if (!$username) { + $username = ini_get("mysqli.default_user"); + } + if (!$password) { + $password = ini_get("mysqli.default_pw"); + } $hash = sha1($hostname . $username . $flags); if ($hostname{1} != ':' && isset(\Dshafik\MySQL::$connections[$hash])) { |