Skip to content

Commit

Permalink
Merge pull request #8018 from tersmitten/fix-broken-memcached-socket-…
Browse files Browse the repository at this point in the history
…connection

Memcached can not connect using a socket
  • Loading branch information
markstory committed Jan 13, 2016
2 parents f3a990d + cbdf6b8 commit e62caa9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/Cache/Engine/MemcachedEngine.php
Expand Up @@ -241,8 +241,9 @@ protected function _setOptions()
*/
protected function _parseServerString($server)
{
if (strpos($server, 'unix://') === 0) {
return [$server, 0];
$socketTransport = 'unix://';
if (strpos($server, $socketTransport) === 0) {
return [substr($server, strlen($socketTransport)), 0];
}
if (substr($server, 0, 1) === '[') {
$position = strpos($server, ']:');
Expand Down
2 changes: 1 addition & 1 deletion tests/TestCase/Cache/Engine/MemcachedEngineTest.php
Expand Up @@ -481,7 +481,7 @@ public function testParseServerStringUnix()
{
$Memcached = new TestMemcachedEngine();
$result = $Memcached->parseServerString('unix:///path/to/memcachedd.sock');
$this->assertEquals(['unix:///path/to/memcachedd.sock', 0], $result);
$this->assertEquals(['/path/to/memcachedd.sock', 0], $result);
}

/**
Expand Down

0 comments on commit e62caa9

Please sign in to comment.