Browse Source

Support Fully qualified name for Protocols

sm2017 7 năm trước cách đây
mục cha
commit
09a0edb939
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      Worker.php

+ 1 - 1
Worker.php

@@ -1928,7 +1928,7 @@ class Worker
             // Check application layer protocol class.
             if (!isset(static::$_builtinTransports[$scheme])) {
                 $scheme         = ucfirst($scheme);
-                $this->protocol = '\\Protocols\\' . $scheme;
+                $this->protocol = substr($scheme,0,1)==='\\'?$scheme:'\\Protocols\\' . $scheme;
                 if (!class_exists($this->protocol)) {
                     $this->protocol = "\\Workerman\\Protocols\\$scheme";
                     if (!class_exists($this->protocol)) {