mirror of
https://github.com/e107inc/e107.git
synced 2025-03-14 01:19:44 +01:00
Optimized database connection time.
This commit is contained in:
parent
1ae3c6b315
commit
20e9f97bb0
@ -193,7 +193,12 @@ class e_db_mysql
|
||||
{
|
||||
list($this->mySQLserver,$this->mySQLport) = explode(':',$mySQLserver,2);
|
||||
}
|
||||
|
||||
|
||||
if($this->mySQLserver === 'localhost')
|
||||
{
|
||||
$this->mySQLserver = '127.0.0.1'; // faster by almost 1 second
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
$this->mySQLaccess = new PDO("mysql:host=".$this->mySQLserver."; port=".$this->mySQLport, $this->mySQLuser, $this->mySQLpassword, array(PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION));
|
||||
@ -284,7 +289,13 @@ class e_db_mysql
|
||||
{
|
||||
list($this->mySQLserver,$this->mySQLport) = explode(':',$mySQLserver,2);
|
||||
}
|
||||
|
||||
|
||||
if($this->mySQLserver === 'localhost')
|
||||
{
|
||||
$this->mySQLserver = '127.0.0.1'; // faster by almost 1 second.
|
||||
}
|
||||
|
||||
|
||||
if($this->pdo) // PDO
|
||||
{
|
||||
try
|
||||
|
Loading…
x
Reference in New Issue
Block a user