Showing
1 changed file
with
9 additions
and
1 deletions
@@ -47,6 +47,8 @@ class RpcSession extends Root implements SessionHandlerInterface | @@ -47,6 +47,8 @@ class RpcSession extends Root implements SessionHandlerInterface | ||
47 | 47 | ||
48 | private $serviceUrl = ''; | 48 | private $serviceUrl = ''; |
49 | 49 | ||
50 | + private $rpcType = 'yar'; | ||
51 | + | ||
50 | /** | 52 | /** |
51 | * 初始化 | 53 | * 初始化 |
52 | */ | 54 | */ |
@@ -70,6 +72,12 @@ class RpcSession extends Root implements SessionHandlerInterface | @@ -70,6 +72,12 @@ class RpcSession extends Root implements SessionHandlerInterface | ||
70 | $this->serviceUrl = $serviceUrl; | 72 | $this->serviceUrl = $serviceUrl; |
71 | } | 73 | } |
72 | 74 | ||
75 | + public function setRpcType($type) | ||
76 | + { | ||
77 | + $this->rpcType = $type; | ||
78 | + return $this; | ||
79 | + } | ||
80 | + | ||
73 | public function setSessionName($sessionName) | 81 | public function setSessionName($sessionName) |
74 | { | 82 | { |
75 | if (!empty($sessionName)) { | 83 | if (!empty($sessionName)) { |
@@ -120,7 +128,7 @@ class RpcSession extends Root implements SessionHandlerInterface | @@ -120,7 +128,7 @@ class RpcSession extends Root implements SessionHandlerInterface | ||
120 | } | 128 | } |
121 | $this->setOption(); | 129 | $this->setOption(); |
122 | if (empty($this->serviceClient)) { | 130 | if (empty($this->serviceClient)) { |
123 | - $this->serviceClient = Factory::getInstance($this->serviceUrl); | 131 | + $this->serviceClient = Factory::getInstance($this->serviceUrl, $this->rpcType); |
124 | } | 132 | } |
125 | return $this->serviceClient; | 133 | return $this->serviceClient; |
126 | } | 134 | } |
-
Please register or login to post a comment