Fix the bug that message without namespace is not found in the descriptor pool. (#2240)
parent
0321baf9e8
commit
60d95f36c0
6 changed files with 83 additions and 23 deletions
@ -0,0 +1,34 @@ |
||||
<?php |
||||
# Generated by the protocol buffer compiler. DO NOT EDIT! |
||||
# source: test_no_namespace.proto |
||||
|
||||
use Google\Protobuf\Internal\DescriptorPool; |
||||
use Google\Protobuf\Internal\GPBType; |
||||
use Google\Protobuf\Internal\RepeatedField; |
||||
use Google\Protobuf\Internal\GPBUtil; |
||||
|
||||
class NoNameSpace extends \Google\Protobuf\Internal\Message |
||||
{ |
||||
private $a = 0; |
||||
|
||||
public function getA() |
||||
{ |
||||
return $this->a; |
||||
} |
||||
|
||||
public function setA($var) |
||||
{ |
||||
GPBUtil::checkInt32($var); |
||||
$this->a = $var; |
||||
} |
||||
|
||||
} |
||||
|
||||
$pool = DescriptorPool::getGeneratedPool(); |
||||
|
||||
$pool->internalAddGeneratedFile(hex2bin( |
||||
"0a3b0a17746573745f6e6f5f6e616d6573706163652e70726f746f22180a" . |
||||
"0b4e6f4e616d65537061636512090a0161180120012805620670726f746f" . |
||||
"33" |
||||
)); |
||||
|
@ -0,0 +1,5 @@ |
||||
syntax = "proto3"; |
||||
|
||||
message NoNameSpace { |
||||
int32 a = 1; |
||||
} |
Loading…
Reference in new issue