aboutsummaryrefslogtreecommitdiff
path: root/php/src/Google/Protobuf/descriptor.php
diff options
context:
space:
mode:
Diffstat (limited to 'php/src/Google/Protobuf/descriptor.php')
-rw-r--r--php/src/Google/Protobuf/descriptor.php13
1 files changed, 13 insertions, 0 deletions
diff --git a/php/src/Google/Protobuf/descriptor.php b/php/src/Google/Protobuf/descriptor.php
index 35e4929b..b7a3a550 100644
--- a/php/src/Google/Protobuf/descriptor.php
+++ b/php/src/Google/Protobuf/descriptor.php
@@ -282,6 +282,19 @@ function getFullClassName(
$class_name_without_package =
getClassNameWithoutPackage($message_name_without_package, $file_proto);
+
+ $option = $file_proto->getOptions();
+ if (!is_null($option) && $option->hasPhpNamespace()) {
+ $namespace = $option->getPhpNamespace();
+ if ($namespace !== "") {
+ $classname = $namespace . "\\" . $class_name_without_package;
+ return;
+ } else {
+ $classname = $class_name_without_package;
+ return;
+ }
+ }
+
if ($package === "") {
$classname = $class_name_without_package;
} else {