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:
authorrobocoder <anthon.pang@gmail.com>2009-07-19 19:09:27 +0400
committerrobocoder <anthon.pang@gmail.com>2009-07-19 19:09:27 +0400
commit83de7e6852c40646ae246074167d4b4ce876b0c7 (patch)
tree6009cd1b37b9db22605530695951c7a5babddfb7 /core/Tracker/Db.php
parentdbc5840d9715d5195a9f00aadee05600715f4a6f (diff)
fixes #865 - unix_socket support
git-svn-id: http://dev.piwik.org/svn/trunk@1311 59fd770c-687e-43c8-a1e3-f5a4ff64c105
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()