mirror of
https://github.com/e107inc/e107.git
synced 2025-07-31 03:40:37 +02:00
Issue #1768 Partial fix for running on non-standard MySQL port. Added $mySQLport = 3306; to e107_config.php and modify as required.
This commit is contained in:
@@ -226,7 +226,7 @@ e107_require_once($tmp.'/e107_class.php');
|
||||
unset($tmp);
|
||||
|
||||
$e107_paths = compact('ADMIN_DIRECTORY', 'FILES_DIRECTORY', 'IMAGES_DIRECTORY', 'THEMES_DIRECTORY', 'PLUGINS_DIRECTORY', 'HANDLERS_DIRECTORY', 'LANGUAGES_DIRECTORY', 'HELP_DIRECTORY', 'DOWNLOADS_DIRECTORY','UPLOADS_DIRECTORY','SYSTEM_DIRECTORY', 'MEDIA_DIRECTORY','CACHE_DIRECTORY','LOGS_DIRECTORY', 'CORE_DIRECTORY', 'WEB_DIRECTORY');
|
||||
$sql_info = compact('mySQLserver', 'mySQLuser', 'mySQLpassword', 'mySQLdefaultdb', 'mySQLprefix');
|
||||
$sql_info = compact('mySQLserver', 'mySQLuser', 'mySQLpassword', 'mySQLdefaultdb', 'mySQLprefix', 'mySQLport');
|
||||
$e107 = e107::getInstance()->initCore($e107_paths, realpath(dirname(__FILE__)), $sql_info, varset($E107_CONFIG, array()));
|
||||
|
||||
e107::getSingleton('eIPHandler'); // This auto-handles bans etc
|
||||
|
@@ -69,9 +69,10 @@ class e_db_mysql
|
||||
{
|
||||
// TODO switch to protected vars where needed
|
||||
public $mySQLserver;
|
||||
public $mySQLuser;
|
||||
public $mySQLuser;
|
||||
protected $mySQLpassword;
|
||||
protected $mySQLdefaultdb;
|
||||
protected $mySQLport = 3306;
|
||||
public $mySQLPrefix;
|
||||
protected $mySQLaccess;
|
||||
public $mySQLresult;
|
||||
@@ -83,7 +84,7 @@ class e_db_mysql
|
||||
protected $mySQLlastQuery = '';
|
||||
|
||||
public $mySQLcurTable;
|
||||
public $mySQLlanguage;
|
||||
public $mySQLlanguage;
|
||||
public $mySQLinfo;
|
||||
public $tabset;
|
||||
public $mySQLtableList = array(); // list of all Db tables.
|
||||
@@ -99,6 +100,7 @@ class e_db_mysql
|
||||
|
||||
private $pdo = false; // using PDO or not.
|
||||
|
||||
|
||||
/**
|
||||
* Constructor - gets language options from the cookie or session
|
||||
* @access public
|
||||
@@ -113,11 +115,16 @@ class e_db_mysql
|
||||
{
|
||||
$this->pdo = true;
|
||||
}
|
||||
|
||||
|
||||
e107::getSingleton('e107_traffic')->BumpWho('Create db object', 1);
|
||||
|
||||
$this->mySQLPrefix = MPREFIX; // Set the default prefix - may be overridden
|
||||
|
||||
if($port = e107::getMySQLConfig('port'))
|
||||
{
|
||||
$this->mySQLport = intval($port);
|
||||
}
|
||||
|
||||
/*$langid = (isset($pref['cookie_name'])) ? 'e107language_'.$pref['cookie_name'] : 'e107language_temp';
|
||||
if (isset($pref['user_tracking']) && ($pref['user_tracking'] == 'session'))
|
||||
{
|
||||
@@ -182,7 +189,7 @@ class e_db_mysql
|
||||
{
|
||||
try
|
||||
{
|
||||
$this->mySQLaccess = new PDO("mysql:host=".$this->mySQLserver."; port=3306", $this->mySQLuser, $this->mySQLpassword, array(PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION));
|
||||
$this->mySQLaccess = new PDO("mysql:host=".$this->mySQLserver."; port=".$this->mySQLport, $this->mySQLuser, $this->mySQLpassword, array(PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION));
|
||||
|
||||
}
|
||||
catch(PDOException $ex)
|
||||
@@ -271,7 +278,7 @@ class e_db_mysql
|
||||
{
|
||||
try
|
||||
{
|
||||
$this->mySQLaccess = new PDO("mysql:host=".$this->mySQLserver."; port=3306", $this->mySQLuser, $this->mySQLpassword, array(PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION));
|
||||
$this->mySQLaccess = new PDO("mysql:host=".$this->mySQLserver."; port=".$this->mySQLport, $this->mySQLuser, $this->mySQLpassword, array(PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION));
|
||||
}
|
||||
catch(PDOException $ex)
|
||||
{
|
||||
|
Reference in New Issue
Block a user