From da10b3780bb5398a8c737bd8999c269d92f93f46 Mon Sep 17 00:00:00 2001 From: fengchenghao Date: Wed, 18 Oct 2017 14:52:18 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E5=87=A0=E4=B8=AAnew=20?= =?UTF-8?q?=E7=9A=84=E8=AF=AD=E6=B3=95=EF=BC=8C=E5=A2=9E=E5=8A=A0=E5=91=BD?= =?UTF-8?q?=E5=90=8D=E7=A9=BA=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Handlers/ProtoBufferDecoder.php | 16 ---------------- src/ProtoBuffer/pb_message.php | 6 ++++-- 2 files changed, 4 insertions(+), 18 deletions(-) diff --git a/src/Handlers/ProtoBufferDecoder.php b/src/Handlers/ProtoBufferDecoder.php index a8bb4a8..74e0440 100755 --- a/src/Handlers/ProtoBufferDecoder.php +++ b/src/Handlers/ProtoBufferDecoder.php @@ -1,22 +1,6 @@ values[$messtypes['field']] = new $this->fields[$messtypes['field']]($this->reader); + $method = 'Aliyun\\OTS\\Handlers\\'.$this->fields[$messtypes['field']]; + $this->values[$messtypes['field']] = new $method($this->reader); if ($messtypes['wired'] != $this->values[$messtypes['field']]->wired_type) { throw new Exception('Expected type:' . $messtypes['wired'] . ' but had ' . $this->fields[$messtypes['field']]->wired_type); @@ -273,7 +274,8 @@ protected function _set_value($index, $value) } else { - $this->values[$index] = new $this->fields[$index](); + $method = 'Aliyun\\OTS\\Handlers\\' . $this->fields[$index]; + $this->values[$index] = new $method(); $this->values[$index]->value = $value; } }