This commit is contained in:
Roman Kelesidis 2024-01-19 01:28:24 +07:00
parent 20c06a4beb
commit 0517e27f5a
3 changed files with 18 additions and 2 deletions

View File

@ -91,6 +91,13 @@ class sql_db
{
global $DBS;
// Check MySQL installed
if (!function_exists('mysql_connect') || !extension_loaded('mysql'))
{
$this->log_error();
error_exit("Error: {$this->engine} extension not installed");
}
$this->cfg = array_combine($this->cfg_keys, $cfg_values);
$this->slow_time = SQL_SLOW_QUERY_TIME;

View File

@ -12,8 +12,6 @@ if (PHP_VERSION_ID < 50304) die('TorrentPier II requires PHP version 5.3.4+. You
if (PHP_VERSION_ID >= 70000) die('TorrentPier II requires PHP version lower than PHP 7. Your PHP version ' . PHP_VERSION);
// Magic quotes
if (function_exists('get_magic_quotes_gpc') && @get_magic_quotes_gpc()) die('Set: magic_quotes_gpc = Off');
// MySQL
if (!function_exists('mysql_connect') || !extension_loaded('mysql')) die('MySQL extension not installed');
// JSON
if (!function_exists('json_encode')) die('json_encode() function not exists');
// getmypid

View File

@ -44,6 +44,17 @@ class sql_db
{
global $DBS;
// Check MySQL installed
if (!function_exists('mysql_connect') || !extension_loaded('mysql'))
{
$init_error = "Error: {$this->engine} extension not installed";
if (DBG_LOG)
{
dbg_log($init_error, "{$this->engine}-DB-INIT-FAIL_" . TIMENOW);
}
die($init_error);
}
$this->cfg = array_combine($this->cfg_keys, $cfg_values);
$this->dbg_enabled = (sql_dbg_enabled() || !empty($_COOKIE['explain']));
$this->do_explain = ($this->dbg_enabled && !empty($_COOKIE['explain']));