1
0
mirror of https://github.com/e107inc/e107.git synced 2025-07-31 20:00: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:
Cameron
2016-07-07 15:09:38 -07:00
parent 345bbc4ff8
commit 84d66979a4
2 changed files with 13 additions and 6 deletions

View File

@@ -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

View File

@@ -72,6 +72,7 @@ class e_db_mysql
public $mySQLuser;
protected $mySQLpassword;
protected $mySQLdefaultdb;
protected $mySQLport = 3306;
public $mySQLPrefix;
protected $mySQLaccess;
public $mySQLresult;
@@ -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
@@ -118,6 +120,11 @@ class e_db_mysql
$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)
{