Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
P
protobuf
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
protobuf
Commits
857a0216
Unverified
Commit
857a0216
authored
Nov 15, 2017
by
Paul Yang
Committed by
GitHub
Nov 15, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use fully qualifed name for DescriptorPool in Any.php to avoid name (#3886)
conflict
parent
0cd2ad11
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
4 deletions
+3
-4
Any.php
php/src/Google/Protobuf/Any.php
+3
-4
No files found.
php/src/Google/Protobuf/Any.php
View file @
857a0216
...
...
@@ -4,7 +4,6 @@
namespace
Google\Protobuf
;
use
Google\Protobuf\Internal\DescriptorPool
;
use
Google\Protobuf\Internal\GPBType
;
use
Google\Protobuf\Internal\GPBUtil
;
use
Google\Protobuf\Internal\Message
;
...
...
@@ -217,7 +216,7 @@ class Any extends \Google\Protobuf\Internal\Message
substr
(
$this
->
type_url
,
$url_prifix_len
);
// Create message according to fully qualified name.
$pool
=
DescriptorPool
::
getGeneratedPool
();
$pool
=
\Google\Protobuf\Internal\
DescriptorPool
::
getGeneratedPool
();
$desc
=
$pool
->
getDescriptorByProtoName
(
"."
.
$fully_qualifed_name
);
if
(
is_null
(
$desc
))
{
throw
new
\Exception
(
"Class "
.
$fully_qualifed_name
...
...
@@ -248,7 +247,7 @@ class Any extends \Google\Protobuf\Internal\Message
$this
->
value
=
$msg
->
serializeToString
();
// Set type url.
$pool
=
DescriptorPool
::
getGeneratedPool
();
$pool
=
\Google\Protobuf\Internal\
DescriptorPool
::
getGeneratedPool
();
$desc
=
$pool
->
getDescriptorByClassName
(
get_class
(
$msg
));
$fully_qualifed_name
=
$desc
->
getFullName
();
$this
->
type_url
=
GPBUtil
::
TYPE_URL_PREFIX
.
substr
(
...
...
@@ -262,7 +261,7 @@ class Any extends \Google\Protobuf\Internal\Message
*/
public
function
is
(
$klass
)
{
$pool
=
DescriptorPool
::
getGeneratedPool
();
$pool
=
\Google\Protobuf\Internal\
DescriptorPool
::
getGeneratedPool
();
$desc
=
$pool
->
getDescriptorByClassName
(
$klass
);
$fully_qualifed_name
=
$desc
->
getFullName
();
$type_url
=
GPBUtil
::
TYPE_URL_PREFIX
.
substr
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment