Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvipsoft <vipsoft@59fd770c-687e-43c8-a1e3-f5a4ff64c105>2009-07-19 19:09:27 +0400
committervipsoft <vipsoft@59fd770c-687e-43c8-a1e3-f5a4ff64c105>2009-07-19 19:09:27 +0400
commitbf17c797020c65c3ca54dd73a20b5afb99257b20 (patch)
tree6009cd1b37b9db22605530695951c7a5babddfb7 /core/Tracker/Db.php
parentd66ae23d10f3d6325e654ec59d255452368c4270 (diff)
fixes #865 - unix_socket support
Diffstat (limited to 'core/Tracker/Db.php')
-rw-r--r--core/Tracker/Db.php17
1 files changed, 12 insertions, 5 deletions
diff --git a/core/Tracker/Db.php b/core/Tracker/Db.php
index 7dd85c8c38..6fa7544183 100644
--- a/core/Tracker/Db.php
+++ b/core/Tracker/Db.php
@@ -25,15 +25,22 @@ class Piwik_Tracker_Db
static private $profiling = false;
protected $queriesProfiling = array();
-
+
/**
* Builds the DB object
*/
- public function __construct( $host, $username, $password, $dbname, $port, $driverName = 'mysql')
+ public function __construct( $dbInfo, $driverName = 'mysql')
{
- $this->dsn = $driverName.":dbname=$dbname;host=$host;port=$port";
- $this->username = $username;
- $this->password = $password;
+ if(isset($dbInfo['unix_socket']) && $dbInfo['unix_socket'][0] == '/')
+ {
+ $this->dsn = $driverName.":dbname=${dbInfo['dbname']};unix_socket=${dbInfo['unix_socket']}";
+ }
+ else
+ {
+ $this->dsn = $driverName.":dbname=${dbInfo['dbname']};host=${dbInfo['host']};port=${dbInfo['port']}";
+ }
+ $this->username = $dbInfo['username'];
+ $this->password = $dbInfo['password'];
}
public function __destruct()