aboutsummaryrefslogtreecommitdiff
path: root/php
diff options
context:
space:
mode:
authorPaul Yang <TeBoring@users.noreply.github.com>2018-05-11 13:57:06 -0700
committerGitHub <noreply@github.com>2018-05-11 13:57:06 -0700
commitb61dd9d9a229c5a82788fdeefa344aa65affae09 (patch)
tree094efbee31fe6bda8d4aa6f47efd652c8576a990 /php
parent2213c1c1f6bae29513729b7285462b24df20d687 (diff)
downloadprotobuf-b61dd9d9a229c5a82788fdeefa344aa65affae09.tar.gz
protobuf-b61dd9d9a229c5a82788fdeefa344aa65affae09.tar.bz2
protobuf-b61dd9d9a229c5a82788fdeefa344aa65affae09.zip
Add file option php_metadata_namespace and ruby_package (#4609)
Diffstat (limited to 'php')
-rw-r--r--php/src/GPBMetadata/Google/Protobuf/Internal/Descriptor.php2
-rw-r--r--php/src/Google/Protobuf/Internal/FileOptions.php90
2 files changed, 92 insertions, 0 deletions
diff --git a/php/src/GPBMetadata/Google/Protobuf/Internal/Descriptor.php b/php/src/GPBMetadata/Google/Protobuf/Internal/Descriptor.php
index b0ca8da0..7057384b 100644
--- a/php/src/GPBMetadata/Google/Protobuf/Internal/Descriptor.php
+++ b/php/src/GPBMetadata/Google/Protobuf/Internal/Descriptor.php
@@ -159,6 +159,8 @@ class Descriptor
->optional('swift_prefix', \Google\Protobuf\Internal\GPBType::STRING, 39)
->optional('php_class_prefix', \Google\Protobuf\Internal\GPBType::STRING, 40)
->optional('php_namespace', \Google\Protobuf\Internal\GPBType::STRING, 41)
+ ->optional('php_metadata_namespace', \Google\Protobuf\Internal\GPBType::STRING, 44)
+ ->optional('ruby_package', \Google\Protobuf\Internal\GPBType::STRING, 45)
->repeated('uninterpreted_option', \Google\Protobuf\Internal\GPBType::MESSAGE, 999, 'google.protobuf.internal.UninterpretedOption')
->finalizeToPool();
diff --git a/php/src/Google/Protobuf/Internal/FileOptions.php b/php/src/Google/Protobuf/Internal/FileOptions.php
index f3bacad6..18e9455c 100644
--- a/php/src/Google/Protobuf/Internal/FileOptions.php
+++ b/php/src/Google/Protobuf/Internal/FileOptions.php
@@ -174,6 +174,24 @@ class FileOptions extends \Google\Protobuf\Internal\Message
private $php_namespace = '';
private $has_php_namespace = false;
/**
+ * Use this option to change the namespace of php generated metadata classes.
+ * Default is empty. When this option is empty, the proto file name will be used
+ * for determining the namespace.
+ *
+ * Generated from protobuf field <code>optional string php_metadata_namespace = 44;</code>
+ */
+ private $php_metadata_namespace = '';
+ private $has_php_metadata_namespace = false;
+ /**
+ * Use this option to change the package of ruby generated classes. Default
+ * is empty. When this option is not set, the package name will be used for
+ * determining the ruby package.
+ *
+ * Generated from protobuf field <code>optional string ruby_package = 45;</code>
+ */
+ private $ruby_package = '';
+ private $has_ruby_package = false;
+ /**
* The parser stores options it doesn't recognize here.
* See the documentation for the "Options" section above.
*
@@ -828,6 +846,78 @@ class FileOptions extends \Google\Protobuf\Internal\Message
}
/**
+ * Use this option to change the namespace of php generated metadata classes.
+ * Default is empty. When this option is empty, the proto file name will be used
+ * for determining the namespace.
+ *
+ * Generated from protobuf field <code>optional string php_metadata_namespace = 44;</code>
+ * @return string
+ */
+ public function getPhpMetadataNamespace()
+ {
+ return $this->php_metadata_namespace;
+ }
+
+ /**
+ * Use this option to change the namespace of php generated metadata classes.
+ * Default is empty. When this option is empty, the proto file name will be used
+ * for determining the namespace.
+ *
+ * Generated from protobuf field <code>optional string php_metadata_namespace = 44;</code>
+ * @param string $var
+ * @return $this
+ */
+ public function setPhpMetadataNamespace($var)
+ {
+ GPBUtil::checkString($var, True);
+ $this->php_metadata_namespace = $var;
+ $this->has_php_metadata_namespace = true;
+
+ return $this;
+ }
+
+ public function hasPhpMetadataNamespace()
+ {
+ return $this->has_php_metadata_namespace;
+ }
+
+ /**
+ * Use this option to change the package of ruby generated classes. Default
+ * is empty. When this option is not set, the package name will be used for
+ * determining the ruby package.
+ *
+ * Generated from protobuf field <code>optional string ruby_package = 45;</code>
+ * @return string
+ */
+ public function getRubyPackage()
+ {
+ return $this->ruby_package;
+ }
+
+ /**
+ * Use this option to change the package of ruby generated classes. Default
+ * is empty. When this option is not set, the package name will be used for
+ * determining the ruby package.
+ *
+ * Generated from protobuf field <code>optional string ruby_package = 45;</code>
+ * @param string $var
+ * @return $this
+ */
+ public function setRubyPackage($var)
+ {
+ GPBUtil::checkString($var, True);
+ $this->ruby_package = $var;
+ $this->has_ruby_package = true;
+
+ return $this;
+ }
+
+ public function hasRubyPackage()
+ {
+ return $this->has_ruby_package;
+ }
+
+ /**
* The parser stores options it doesn't recognize here.
* See the documentation for the "Options" section above.
*