{"id":36976859,"url":"https://github.com/nowgoo/php-protobuf","last_synced_at":"2026-01-13T22:45:29.634Z","repository":{"id":57028805,"uuid":"318381693","full_name":"nowgoo/php-protobuf","owner":"nowgoo","description":"simple protobuf encoder and decoder without compiling a .proto file","archived":false,"fork":false,"pushed_at":"2020-12-13T16:46:24.000Z","size":12,"stargazers_count":15,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-03T03:35:09.923Z","etag":null,"topics":["grpc","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/nowgoo.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":"2020-12-04T02:38:40.000Z","updated_at":"2024-05-29T07:55:03.000Z","dependencies_parsed_at":"2022-08-23T18:50:13.383Z","dependency_job_id":null,"html_url":"https://github.com/nowgoo/php-protobuf","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/nowgoo/php-protobuf","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nowgoo%2Fphp-protobuf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nowgoo%2Fphp-protobuf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nowgoo%2Fphp-protobuf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nowgoo%2Fphp-protobuf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nowgoo","download_url":"https://codeload.github.com/nowgoo/php-protobuf/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nowgoo%2Fphp-protobuf/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28402253,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-13T14:36:09.778Z","status":"ssl_error","status_checked_at":"2026-01-13T14:35:19.697Z","response_time":56,"last_error":"SSL_read: 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":["grpc","php","protobuf"],"created_at":"2026-01-13T22:45:28.728Z","updated_at":"2026-01-13T22:45:29.629Z","avatar_url":"https://github.com/nowgoo.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# php-protobuf\nsimple protobuf encoder and decoder\n\n# features\n- no need to compile .proto files\n- decode \u0026 encode without a scheme definition\n- grpc client [wip]\n\n# install\n```\ncomposer require nowgoo/php-protobuf dev-master\n```\n\n# usage\n\nsay we have a .proto defined as:\n```\nmessage Example {\n    int32 foo = 1;\n    SubMessage bar = 2;\n    repeated baz = 3;\n}\n\nmessage SubMessage {\n    string bar_sub = 1;\n}\n```\ncode talks:\n\n``` php\nuse \\PhpProtobuf\\Scheme;\n$scheme = new Scheme([\n    // simple field\n    1 =\u003e ['name'=\u003e'foo', 'type'=\u003eScheme::TYPE_INT],\n    // embeded field\n    2 =\u003e ['name'=\u003e'bar', 'type'=\u003eScheme::TYPE_EMBEDED, 'fields'=\u003e[\n        1 =\u003e ['name'=\u003e'bar_sub', 'type'=\u003eScheme::TYPE_STRING]\n    ]],\n    // repeated field\n    3 =\u003e ['name'=\u003e'baz', 'type'=\u003eScheme::TYPE_INT, 'repeated'=\u003etrue],\n]);\n\n$binary = $scheme-\u003eencode([\n    'foo' =\u003e 123456,\n    'bar' =\u003e ['bar_sub' =\u003e 'hello, world'],\n    'baz' =\u003e [3, 270, 86942]\n]);\n// binary = [08 c0 c4 07 12 0e 0a 0c 68 65 6c 6c 6f 2c 20 77 6f 72 6c 64 1a 06 03 8e 02 9e a7 05]\n\n$decoded = $scheme-\u003edecode($binary);\n// $decoded == ['foo'=\u003e123456, 'bar'=\u003e['bar_sub'=\u003e'hello, world'], 'baz'=\u003e[3,270,86942]];\n```\n\n## decode/encode without a scheme definition\n``` php\n$scheme = new UniversalScheme();\n$binary = $scheme-\u003eencode([\n    'keys' =\u003e 123456,\n    'were' =\u003e 'hello',\n    'skipped' =\u003e [\n        'during' =\u003e [\n            'encoding' =\u003e 'level 3 value'\n        ],\n        'process' =\u003e 'level 2 value',\n    ],\n]);\n\n$decoded = $scheme-\u003edecode($binary);\n/*\n$decoded:\n[\n    1 =\u003e 123456,\n    2 =\u003e 'hello',\n    3 =\u003e [\n        1 =\u003e [\n            1 =\u003e 'level 3 value'\n        ],\n        2 =\u003e 'level 2 value',\n    ],\n]\n*/\n```\n\n## grpc\n[wip]\n\n# licence\nMIT License","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnowgoo%2Fphp-protobuf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnowgoo%2Fphp-protobuf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnowgoo%2Fphp-protobuf/lists"}