-
Notifications
You must be signed in to change notification settings - Fork 15.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add new file option php_namespace. #3162
Conversation
Use this option to change the namespace of php generated classes. Default is empty. When this option is empty, the package name will be used for determining the namespace.
Can one of the admins verify this patch? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot, this is great! I did not try to review as I am not familiar with the codebase, but did notice some commented tests.
php/tests/array_test.php
Outdated
$end = memory_get_usage(); | ||
$this->assertLessThan($start, $end); | ||
} | ||
# /** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these tests supposed to be commented out?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
Thanks for the catch. |
Testing locally, I am finding that this does not change the namespace of the GPBMetadata files. Is that intentional? I do not know of strong arguments either for changing it or not. |
I don't think we need to change the namespace of GPBMetadata files. These files are transparent to users. |
BTW, the namespace of GPBMetadata files are decided by the path of proto file instead of the package name. |
* Add new file option php_namespace. Use this option to change the namespace of php generated classes. Default is empty. When this option is empty, the package name will be used for determining the namespace. * Uncomment commented tests * Revert gdb test change * Update csharp descriptor. * Add test for empty php_namespace.
@TeBoring What time php_namespace. protoc 3.4? |
ETA end of July. |
* Add new file option php_namespace. Use this option to change the namespace of php generated classes. Default is empty. When this option is empty, the package name will be used for determining the namespace. * Uncomment commented tests * Revert gdb test change * Update csharp descriptor. * Add test for empty php_namespace.
Use this option to change the namespace of php generated classes.
Default is empty. When this option is empty, the package name will be
used for determining the namespace.