aboutsummaryrefslogtreecommitdiffhomepage
path: root/php/src
diff options
context:
space:
mode:
authorGravatar Bo Yang <teboring@google.com>2017-08-21 13:39:15 -0700
committerGravatar Bo Yang <teboring@google.com>2017-08-21 13:39:15 -0700
commitdd5190980b8a9205eaf292f0cd947c3657daaeb1 (patch)
tree1c924ac0485bf23939fc6a4c3d9ce9bf4ff99418 /php/src
parent26ac3e8e242f1cd6de15291a9973905a14b546ba (diff)
Use message name as defined in php runtime.
Diffstat (limited to 'php/src')
-rw-r--r--php/src/Google/Protobuf/Internal/GPBUtil.php2
-rw-r--r--php/src/Google/Protobuf/Internal/Message.php3
2 files changed, 4 insertions, 1 deletions
diff --git a/php/src/Google/Protobuf/Internal/GPBUtil.php b/php/src/Google/Protobuf/Internal/GPBUtil.php
index 6fe36068..84e8ecf0 100644
--- a/php/src/Google/Protobuf/Internal/GPBUtil.php
+++ b/php/src/Google/Protobuf/Internal/GPBUtil.php
@@ -270,7 +270,7 @@ class GPBUtil
$name,
$file_proto)
{
- $classname = implode('_', array_map('ucwords', explode('.', $name)));
+ $classname = implode('_', explode('.', $name));
return static::getClassNamePrefix($classname, $file_proto) . $classname;
}
diff --git a/php/src/Google/Protobuf/Internal/Message.php b/php/src/Google/Protobuf/Internal/Message.php
index e1009f2f..8886e61a 100644
--- a/php/src/Google/Protobuf/Internal/Message.php
+++ b/php/src/Google/Protobuf/Internal/Message.php
@@ -76,6 +76,9 @@ class Message
}
$pool = DescriptorPool::getGeneratedPool();
$this->desc = $pool->getDescriptorByClassName(get_class($this));
+ if (is_null($this->desc)) {
+ user_error(get_class($this) . "is not found in descriptor pool.");
+ }
foreach ($this->desc->getField() as $field) {
$setter = $field->getSetter();
if ($field->isMap()) {