protocolbuffers.github.io icon indicating copy to clipboard operation
protocolbuffers.github.io copied to clipboard

Undocumented PHP Options

Open nigelhough opened this issue 2 years ago • 6 comments

The following two Pull Requests to the protocolbuffers/protobuf project add additional functionality for PHP Namespace when generating code with the Protocol Compiler.

  • https://github.com/protocolbuffers/protobuf/pull/3162
  • https://github.com/protocolbuffers/protobuf/pull/4609

This functionality is not documented in the PHP Generated Code Guide (https://protobuf.dev/reference/php/php-generated/)

nigelhough avatar Apr 11 '23 15:04 nigelhough

Brent, can you take a look at this and let me know if there's anything I need to do to help?

Logofile avatar Apr 14 '23 18:04 Logofile

On the Java page, there's documentation regarding the protobuf options java_package and java_outer_classname: https://protobuf.dev/getting-started/javatutorial/

But PHP has no such documentation for php_namespace and php_metadata_namespace

bshaffer avatar Apr 14 '23 18:04 bshaffer

Thanks for the help, Brent! I'll take a look at this, Nigel. Thanks for bringing it to my attention.

Logofile avatar Apr 14 '23 18:04 Logofile

Thanks @Logofile,

Did you see the linked pull request?

I updated the "PHP Generated Code Guide" with the extra details. As somebody new to Protobuf a few weeks ago that section would have been the most useful for me.

I hadn't thought to compare it to other languages like Java Getting Started page (per comments above). PHP currently doesn't have a Getting Started page. I would be happy to raise a separate PR to introduce one, but I think both changes would still be valuable.

nigelhough avatar Apr 19 '23 09:04 nigelhough

Thank you for providing the PRs. I wanted to check with Brent before merging them, because PHP is a special case with our process for maintaining consistency between our internal docs and external, in that PHP is available only in the external docs. I wanted to make sure that accepting the PRs wasn't going to cause things to get out of sync and lead to the new content getting overwritten in a later publish.

I'll work to get the PRs reviewed and incorporated (probably next week).

Logofile avatar Apr 19 '23 12:04 Logofile

Thanks @Logofile, no rush on my end, I just wanted to check if there would be a preference for it to be in a PHP Getting Started section.

nigelhough avatar Apr 19 '23 13:04 nigelhough

I lost track of this issue. The updates were made in this commit a couple of years ago.

Logofile avatar Mar 20 '25 17:03 Logofile