From cbef7dccaf076218470267a2739aa0f3b49511f1 Mon Sep 17 00:00:00 2001 From: Bob Weinand Date: Tue, 10 Dec 2019 12:02:12 +0100 Subject: [PATCH] Interpret a filesystem path host as an unix domain socket --- src/ConnectionConfig.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ConnectionConfig.php b/src/ConnectionConfig.php index 125ff7c..181bd4f 100644 --- a/src/ConnectionConfig.php +++ b/src/ConnectionConfig.php @@ -85,7 +85,7 @@ public function __construct( public function getConnectionString(): string { - return 'tcp://' . $this->getHost() . ':' . $this->getPort(); + return $this->getHost()[0] == "/" ? 'unix://' . $this->getHost() : 'tcp://' . $this->getHost() . ':' . $this->getPort(); } public function isCompressionEnabled(): bool