Skip to content

Commit 2e4d211

Browse files
committed
Attempting to fix issue #445 (with more logic)
1 parent 54f71ea commit 2e4d211

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/phpFastCache/Drivers/Memcache/Driver.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,10 +133,10 @@ protected function driverConnect()
133133
if (count($servers) < 1) {
134134
$servers = [
135135
[
136-
'host' =>'127.0.0.1',
137-
'port' => 11211,
138-
'sasl_user' => false,
139-
'sasl_password' => false
136+
'host' => !empty($this->config[ 'host' ]) ? $this->config[ 'host' ] : '127.0.0.1',
137+
'port' => !empty($this->config[ 'port' ]) ? $this->config[ 'port' ] : 11211,
138+
'sasl_user' => !empty($this->config[ 'sasl_user' ]) ? $this->config[ 'sasl_user' ] : false,
139+
'sasl_password' => !empty($this->config[ 'sasl_password' ]) ? $this->config[ 'sasl_password' ] : false,
140140
],
141141
];
142142
}

src/phpFastCache/Drivers/Memcached/Driver.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,10 +132,10 @@ protected function driverConnect()
132132
if (count($servers) < 1) {
133133
$servers = [
134134
[
135-
'host' =>'127.0.0.1',
136-
'port' => 11211,
137-
'sasl_user' => false,
138-
'sasl_password' => false
135+
'host' => !empty($this->config[ 'host' ]) ? $this->config[ 'host' ] : '127.0.0.1',
136+
'port' => !empty($this->config[ 'port' ]) ? $this->config[ 'port' ] : 11211,
137+
'sasl_user' => !empty($this->config[ 'sasl_user' ]) ? $this->config[ 'sasl_user' ] : false,
138+
'sasl_password' => !empty($this->config[ 'sasl_password' ]) ? $this->config[ 'sasl_password' ] : false,
139139
],
140140
];
141141
}

0 commit comments

Comments
 (0)