浏览代码

Do not check for the existence of a UNIX domain socket file in userland.

Now Predis throws an instance of Predis\ConnectionException when trying to
connect to an instance of Redis on a non-existent UNIX domain socket file.
Daniele Alessandri 14 年之前
父节点
当前提交
101fffbabe
共有 1 个文件被更改,包括 1 次插入5 次删除
  1. 1 5
      lib/Predis/Network/ConnectionBase.php

+ 1 - 5
lib/Predis/Network/ConnectionBase.php

@@ -30,13 +30,9 @@ abstract class ConnectionBase implements IConnectionSingle {
     protected function checkParameters(IConnectionParameters $parameters) {
         switch ($parameters->scheme) {
             case 'unix':
-                $pathToSocket = $parameters->path;
-                if (!isset($pathToSocket)) {
+                if (!isset($parameters->path)) {
                     throw new InvalidArgumentException('Missing UNIX domain socket path');
                 }
-                if (!file_exists($pathToSocket)) {
-                    throw new InvalidArgumentException("Could not find $pathToSocket");
-                }
             case 'tcp':
                 return $parameters;
             default: