aboutsummaryrefslogtreecommitdiff
path: root/php/src/Google/Protobuf/Internal/Descriptor.php
diff options
context:
space:
mode:
authorPaul Yang <TeBoring@users.noreply.github.com>2018-06-07 18:16:44 -0700
committerGitHub <noreply@github.com>2018-06-07 18:16:44 -0700
commitce044817c7ba0aea27c3fd8e496635d94d20a755 (patch)
treef786537d923df55129a340480199859251ef2259 /php/src/Google/Protobuf/Internal/Descriptor.php
parentd6353b489e16c5ff7dde4aa648f142a0d0b24ceb (diff)
downloadprotobuf-3.6.0.1.tar.gz
protobuf-3.6.0.1.tar.bz2
protobuf-3.6.0.1.zip
Use legacy name in php runtime (#4741)v3.6.0.1
* Use legacy name in php runtime Old generated code cannot work with new runtime, because the new runtime assumes new class name for nested message. For details see #4738. * Remove unused method
Diffstat (limited to 'php/src/Google/Protobuf/Internal/Descriptor.php')
-rw-r--r--php/src/Google/Protobuf/Internal/Descriptor.php14
1 files changed, 14 insertions, 0 deletions
diff --git a/php/src/Google/Protobuf/Internal/Descriptor.php b/php/src/Google/Protobuf/Internal/Descriptor.php
index ee3a8bde..21ac5de3 100644
--- a/php/src/Google/Protobuf/Internal/Descriptor.php
+++ b/php/src/Google/Protobuf/Internal/Descriptor.php
@@ -44,6 +44,7 @@ class Descriptor
private $nested_type = [];
private $enum_type = [];
private $klass;
+ private $legacy_klass;
private $options;
private $oneof_decl = [];
@@ -151,6 +152,16 @@ class Descriptor
return $this->klass;
}
+ public function setLegacyClass($klass)
+ {
+ $this->legacy_klass = $klass;
+ }
+
+ public function getLegacyClass()
+ {
+ return $this->legacy_klass;
+ }
+
public function setOptions($options)
{
$this->options = $options;
@@ -167,16 +178,19 @@ class Descriptor
$message_name_without_package = "";
$classname = "";
+ $legacy_classname = "";
$fullname = "";
GPBUtil::getFullClassName(
$proto,
$containing,
$file_proto,
$message_name_without_package,
+ $legacy_classname,
$classname,
$fullname);
$desc->setFullName($fullname);
$desc->setClass($classname);
+ $desc->setLegacyClass($legacy_classname);
$desc->setOptions($proto->getOptions());
foreach ($proto->getField() as $field_proto) {