$pass = trim($this->configCache->get('database', 'password'));
$db = trim($this->configCache->get('database', 'database'));
$charset = trim($this->configCache->get('database', 'charset'));
+ $socket = trim($this->configCache->get('database', 'socket'));
if (!(strlen($server) && strlen($user))) {
return false;
if (!$this->configCache->get('database', 'disable_pdo') && class_exists('\PDO') && in_array('mysql', PDO::getAvailableDrivers())) {
$this->driver = self::PDO;
- $connect = "mysql:host=" . $server . ";dbname=" . $db;
+ $connect = "mysql:host=" . $server . ";dbname=" . $db . ";unix_socket=" . $socket;
if ($port > 0) {
$connect .= ";port=" . $port;
$this->driver = self::MYSQLI;
if ($port > 0) {
- $this->connection = @new mysqli($server, $user, $pass, $db, $port);
+ $this->connection = @new mysqli($server, $user, $pass, $db, $port, $socket);
} else {
- $this->connection = @new mysqli($server, $user, $pass, $db);
+ $this->connection = @new mysqli($server, $user, $pass, $db, $socket);
}
if (!mysqli_connect_errno()) {