Unverified Commit b61dd9d9 authored by Paul Yang's avatar Paul Yang Committed by GitHub

Add file option php_metadata_namespace and ruby_package (#4609)

parent 2213c1c1
......@@ -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();
......
......@@ -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 <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.
......@@ -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 <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.
......
This diff is collapsed.
This diff is collapsed.
......@@ -417,6 +417,17 @@ message FileOptions {
// determining the namespace.
optional string php_namespace = 41;
// 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.
optional string php_metadata_namespace = 44;
// 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.
optional string ruby_package = 45;
// The parser stores options it doesn't recognize here.
// See the documentation for the "Options" section above.
repeated UninterpretedOption uninterpreted_option = 999;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment