mirror of
https://github.com/e107inc/e107.git
synced 2025-08-03 05:07:27 +02:00
Optimized database connection time.
This commit is contained in:
@@ -194,6 +194,11 @@ class e_db_mysql
|
|||||||
list($this->mySQLserver,$this->mySQLport) = explode(':',$mySQLserver,2);
|
list($this->mySQLserver,$this->mySQLport) = explode(':',$mySQLserver,2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if($this->mySQLserver === 'localhost')
|
||||||
|
{
|
||||||
|
$this->mySQLserver = '127.0.0.1'; // faster by almost 1 second
|
||||||
|
}
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
$this->mySQLaccess = new PDO("mysql:host=".$this->mySQLserver."; port=".$this->mySQLport, $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));
|
||||||
@@ -285,6 +290,12 @@ class e_db_mysql
|
|||||||
list($this->mySQLserver,$this->mySQLport) = explode(':',$mySQLserver,2);
|
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
|
if($this->pdo) // PDO
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
|
Reference in New Issue
Block a user