Navigation Menu

Skip to content

Commit

Permalink
Memcached can not connect using a socket
Browse files Browse the repository at this point in the history
Fixes #8018
  • Loading branch information
tersmitten committed Jan 12, 2016
1 parent 4de9212 commit 8d472a5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions lib/Cake/Cache/Engine/MemcachedEngine.php
Expand Up @@ -185,8 +185,9 @@ protected function _setOptions() {
* @return array Array containing host, port
*/
protected function _parseServerString($server) {
if (strpos($server, 'unix://') === 0) {
return array($server, 0);
$socketTransport = 'unix://';
if (strpos($server, $socketTransport) === 0) {
return array(substr($server, strlen($socketTransport)), 0);
}
if (substr($server, 0, 1) === '[') {
$position = strpos($server, ']:');
Expand Down
2 changes: 1 addition & 1 deletion lib/Cake/Test/Case/Cache/Engine/MemcachedEngineTest.php
Expand Up @@ -433,7 +433,7 @@ public function testParseServerStringNonLatin() {
public function testParseServerStringUnix() {
$Memcached = new TestMemcachedEngine();
$result = $Memcached->parseServerString('unix:///path/to/memcachedd.sock');
$this->assertEquals(array('unix:///path/to/memcachedd.sock', 0), $result);
$this->assertEquals(array('/path/to/memcachedd.sock', 0), $result);
}

/**
Expand Down

0 comments on commit 8d472a5

Please sign in to comment.