diff --git a/lib/Cake/Cache/Engine/MemcachedEngine.php b/lib/Cake/Cache/Engine/MemcachedEngine.php index 331b8a352..d14b5344f 100644 --- a/lib/Cake/Cache/Engine/MemcachedEngine.php +++ b/lib/Cake/Cache/Engine/MemcachedEngine.php @@ -185,8 +185,9 @@ class MemcachedEngine extends CacheEngine { * @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, ']:'); diff --git a/lib/Cake/Test/Case/Cache/Engine/MemcachedEngineTest.php b/lib/Cake/Test/Case/Cache/Engine/MemcachedEngineTest.php index 17f1f9972..823c67f44 100644 --- a/lib/Cake/Test/Case/Cache/Engine/MemcachedEngineTest.php +++ b/lib/Cake/Test/Case/Cache/Engine/MemcachedEngineTest.php @@ -433,7 +433,7 @@ class MemcachedEngineTest extends CakeTestCase { 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); } /**