Fixed mysqli availability checker

This commit is contained in:
fbsanchez 2017-02-16 10:18:08 +01:00
parent 8dbd12eac7
commit 8a2bd0f087
2 changed files with 6 additions and 5 deletions

View File

@ -68,6 +68,9 @@ else {
ini_set("error_log", $config["homedir"]."/pandora_console.log");
}
// Check if mysqli is available
$config["mysqli"] = extension_loaded(mysqli);
$config['start_time'] = microtime (true);
$ownDir = dirname(__FILE__) . '/';

View File

@ -28,11 +28,9 @@ function mysql_connect_db($host = null, $db = null, $user = null, $pass = null,
if ($port === null)
$port = $config["dbport"];
if ($config["mysqli"] === null && extension_loaded(mysqli)) {
$config["mysqli"] = true;
}
else {
$config["mysqli"] = false;
// Check if mysqli is available
if (!isset($config["mysqli"])) {
$config["mysqli"] = extension_loaded(mysqli);
}
// Non-persistent connection: This will help to avoid mysql errors like "has gone away" or locking problems