From b61dd9d9a229c5a82788fdeefa344aa65affae09 Mon Sep 17 00:00:00 2001 From: Paul Yang Date: Fri, 11 May 2018 13:57:06 -0700 Subject: Add file option php_metadata_namespace and ruby_package (#4609) --- .../Google/Protobuf/Internal/Descriptor.php | 2 + php/src/Google/Protobuf/Internal/FileOptions.php | 90 ++++++++++++++++++++++ 2 files changed, 92 insertions(+) (limited to 'php') 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 @@ -173,6 +173,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 optional string php_metadata_namespace = 44; + */ + 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 optional string ruby_package = 45; + */ + 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. @@ -827,6 +845,78 @@ class FileOptions extends \Google\Protobuf\Internal\Message return $this->has_php_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 optional string php_metadata_namespace = 44; + * @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 optional string php_metadata_namespace = 44; + * @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 optional string ruby_package = 45; + * @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 optional string ruby_package = 45; + * @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. -- cgit v1.2.3