{"id":37235206,"url":"https://github.com/liues1992/php-protobuf-generator","last_synced_at":"2026-01-16T04:46:42.230Z","repository":{"id":62517895,"uuid":"116252849","full_name":"liues1992/php-protobuf-generator","owner":"liues1992","description":"Generate php protobuf code using php","archived":false,"fork":false,"pushed_at":"2019-03-30T18:01:13.000Z","size":93,"stargazers_count":10,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-08-10T10:07:58.820Z","etag":null,"topics":["php","php-protobuf"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/liues1992.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-01-04T11:34:52.000Z","updated_at":"2021-07-24T13:19:32.000Z","dependencies_parsed_at":"2022-11-02T13:31:12.837Z","dependency_job_id":null,"html_url":"https://github.com/liues1992/php-protobuf-generator","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/liues1992/php-protobuf-generator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liues1992%2Fphp-protobuf-generator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liues1992%2Fphp-protobuf-generator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liues1992%2Fphp-protobuf-generator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liues1992%2Fphp-protobuf-generator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/liues1992","download_url":"https://codeload.github.com/liues1992/php-protobuf-generator/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liues1992%2Fphp-protobuf-generator/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28419947,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T10:47:48.104Z","status":"ssl_error","status_checked_at":"2026-01-14T10:46:19.031Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["php","php-protobuf"],"created_at":"2026-01-15T04:01:01.534Z","updated_at":"2026-01-15T04:01:01.750Z","avatar_url":"https://github.com/liues1992.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ca href=\"https://996.icu\"\u003e\u003cimg src=\"https://img.shields.io/badge/link-996.icu-red.svg\"\u003e\u003c/a\u003e\n# Introduction \nGenerate PHP protobuf code using PHP\n`./protoc-gen.php -o build tests/test3.proto`\n\nThe generated message code is meant to work with Google protobuf's official PHP implementation:\nhttps://github.com/google/protobuf/tree/master/php\n\nThe generated service client code is meant to  work with gRpc\nhttps://grpc.io/docs/quickstart/php.html#prerequisites\n\n# Requirements\n- Unix/Linux system\n- PHP \u003e= 7.0 and composer installed\n- Only support proto3 syntax proto file\n- protoc installed, version \u003e= 3.5\n\n# Usage\n- `composer require liues1992/php-protobuf-generator`\n- `./vendor/bin/protoc-gen.php --out=build --grpc_out=build tests/*.proto` or use directly as plugin:\n\n   `protoc --php-custom_out=build --plugin=protoc-gen-php-custom=./vendor/bin/protoc-gen-plugin.php \\\n   --grpc-php_out=build --plugin=protoc-gen-grpc-php=./vendor/bin/protoc-gen-grpc-plugin.php tests/*.proto` \n\n- See the [example](./example) folder for the generated code \n   \n### Run test\n`composer test`\n\n# TODO\n- [ ] More test case\n- [ ] Pack to phar\n- [ ] Support proto2\n- [ ] Custom generator support (write your own code generators by require this package)\n\n# Why do I need this instead of Google's default implementation?\n- Sometimes you wish to customize the generated code,\nwhich is complicated to do if you modify google/protobuf source code(c++) and recompile the protoc binary.\nThink about above situations:\n    - Add convenience methods in message class..\n    - Support proto2\n    - Generate custom rpc code (if you are not using gRpc or you want it to use in PHP server side) \n- Some bug in Google's generated code.\n```\n    public function setEnum($var)\n    {\n        // GPBUtil::checkEnum accepts only on param\n        GPBUtil::checkEnum($var, \\Gary\\Test\\Foo_Enum::class); \n        $this-\u003eenum = $var;\n        \n        return $this;\n    }\n```\n- Cool to generate PHP code using PHP (easy for PHP developers to join).\n\n# How does it work\nThat's a secret. Find out yourself.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fliues1992%2Fphp-protobuf-generator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fliues1992%2Fphp-protobuf-generator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fliues1992%2Fphp-protobuf-generator/lists"}