walkor 9 rokov pred
rodič
commit
262dcc2169
1 zmenil súbory, kde vykonal 12 pridanie a 15 odobranie
  1. 12 15
      Worker.php

+ 12 - 15
Worker.php

@@ -1356,21 +1356,18 @@ class Worker
         list($scheme, $address) = explode(':', $this->_socketName, 2);
         // Check application layer protocol class.
         if (!isset(self::$_builtinTransports[$scheme])) {
-			
-			if(class_exists($scheme){
-				$this->protocol = $scheme;
-			} else {
-				$scheme         = ucfirst($scheme);
-				$this->protocol = '\\Protocols\\' . $scheme;
-				if (!class_exists($this->protocol)) {
-					$this->protocol = "\\Workerman\\Protocols\\$scheme";
-					if (!class_exists($this->protocol)) {
-						throw new Exception("class \\Protocols\\$scheme not exist");
-					}
-				}
-			}
-			
-            
+            if(class_exists($scheme)){
+                $this->protocol = $scheme;
+            } else {
+                $scheme         = ucfirst($scheme);
+                $this->protocol = '\\Protocols\\' . $scheme;
+                if (!class_exists($this->protocol)) {
+                    $this->protocol = "\\Workerman\\Protocols\\$scheme";
+                    if (!class_exists($this->protocol)) {
+                        throw new Exception("class \\Protocols\\$scheme not exist");
+                    }
+                }
+            }
             $local_socket = $this->transport . ":" . $address;
         } else {
             $this->transport = self::$_builtinTransports[$scheme];