Skip to content

Commit ff4715d

Browse files
authored
Merge pull request #650 from Geolim4/master
Multiples fixes on Couchbaase and Predis
2 parents 0f57794 + 912f87e commit ff4715d

File tree

3 files changed

+26
-1
lines changed

3 files changed

+26
-1
lines changed

lib/Phpfastcache/Drivers/Couchbase/Config.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class Config extends ConfigurationOption
2828
/**
2929
* @var int
3030
*/
31-
protected $port;
31+
protected $port = 8091;// SSL: 18091
3232

3333
/**
3434
* @var string

lib/Phpfastcache/Drivers/Predis/Config.php

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,11 @@ class Config extends ConfigurationOption
5050
*/
5151
protected $optPrefix = '';
5252

53+
/**
54+
* @var int
55+
*/
56+
protected $timeout = 5;
57+
5358
/**
5459
* @return string
5560
*/
@@ -132,6 +137,7 @@ public function getPredisConfigArray(): array
132137
'port' => $this->getPort(),
133138
'password' => $this->getPassword() ?: null,
134139
'database' => $this->getDatabase(),
140+
'timeout' => $this->getTimeout(),
135141
];
136142
}
137143

@@ -172,4 +178,22 @@ public function setOptPrefix(string $optPrefix): Config
172178
$this->optPrefix = trim($optPrefix);
173179
return $this;
174180
}
181+
182+
/**
183+
* @return int
184+
*/
185+
public function getTimeout(): int
186+
{
187+
return $this->timeout;
188+
}
189+
190+
/**
191+
* @param int $timeout
192+
* @return self
193+
*/
194+
public function setTimeout(int $timeout): self
195+
{
196+
$this->timeout = $timeout;
197+
return $this;
198+
}
175199
}

lib/Phpfastcache/Drivers/Predis/Driver.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ protected function driverConnect(): bool
8282
if (!empty($this->getConfig()->getPath())) {
8383
$this->instance = new PredisClient([
8484
'scheme' => 'unix',
85+
'timeout' => $this->getConfig()->getTimeout(),
8586
'path' => $this->getConfig()->getPath(),
8687
], $options);
8788
} else {

0 commit comments

Comments
 (0)