{"id":15028857,"url":"https://github.com/ndunks/php-simple-protobuf","last_synced_at":"2025-05-14T01:31:18.478Z","repository":{"id":57024462,"uuid":"103773205","full_name":"ndunks/php-simple-protobuf","owner":"ndunks","description":"PHP Implementation of Google Protocol Buffers","archived":false,"fork":false,"pushed_at":"2018-05-11T02:38:57.000Z","size":50,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-13T13:03:49.660Z","etag":null,"topics":["google-protocol-buffers","php","playstore","protobuf"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ndunks.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-09-16T18:06:21.000Z","updated_at":"2020-11-27T04:34:13.000Z","dependencies_parsed_at":"2022-08-23T14:21:03.721Z","dependency_job_id":null,"html_url":"https://github.com/ndunks/php-simple-protobuf","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ndunks%2Fphp-simple-protobuf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ndunks%2Fphp-simple-protobuf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ndunks%2Fphp-simple-protobuf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ndunks%2Fphp-simple-protobuf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ndunks","download_url":"https://codeload.github.com/ndunks/php-simple-protobuf/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225269026,"owners_count":17447451,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["google-protocol-buffers","php","playstore","protobuf"],"created_at":"2024-09-24T20:09:12.177Z","updated_at":"2024-11-18T23:44:03.279Z","avatar_url":"https://github.com/ndunks.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# php-simple-protobuf\r\nPHP Implementation of Google Protocol Buffers\r\n- Simple Protobuf implementation for PHP without install/compile PHP extension\r\n- Support to compile proto 2 files without use any binary/executable\r\n- Support group type field\r\n\r\n## About Protobuf\r\nProtocol Buffers (a.k.a., protobuf) are Google's language-neutral,\r\nplatform-neutral, extensible mechanism for serializing structured data. You\r\ncan find [protobuf's documentation on the Google Developers site](https://developers.google.com/protocol-buffers/).\r\n\r\n## Getting started\r\n\r\n### Requirements\r\n* PHP 5.6 or above\r\n* php-json extension (for json serializer)\r\n\r\n### Installation\r\nInstall with composer.\r\n````\r\n# add ndunks/php-simple-protobuf entry to your composer.json\r\n{\r\n    \"require\": {\r\n        \"ndunks/php-simple-protobuf\": \"*\"\r\n    }\r\n}\r\n\r\n# install requirements composer\r\ncomposer install\r\n````\r\n## Usage\r\n\r\n## Compile proto 2 file to PHP Classes\r\nJust execute php code on console in your project root dir\r\n````\r\nvendor\\bin\\compiler.php.bat --out=\u003cout-dir\u003e --file=\u003cproto-file\u003e\r\n````\r\n## Run the code\r\n````\r\ninclude 'vendor/autoload.php';\r\n// Class Simple compiled from simple.proto (find on test/proto)\r\n$obj = new Simple();\r\n$obj-\u003esetName('user');\r\n$obj-\u003esetAddress('Indonesia');\r\n$obj-\u003esetAge(25);\r\n$obj-\u003etoArray(); // as PHP Array\r\n$obj-\u003etoJson(); // as JSON formated string\r\n````\r\n## Example on Linux\r\n\r\nExample Setup \u0026 installation on Linux\r\nmake sure your php.ini (cli) has `short_open_tag` is `On`\r\n\r\n```\r\ngit clone https://github.com/ndunks/php-simple-protobuf\r\ncd php-simple-protobuf\r\ncomposer dump-autoload\r\n```\r\nYou can skip `composer install` if you want to use it (not develop it) because this project not depend to any other composer library.\r\nRun this to compile example proto (on project dir)\r\n```\r\n# if output directory not exist, you must create it manualy\r\nmkdir result\r\n# Compile it\r\nphp bin/compiler.php --out=result --file=test/proto/simple.proto\r\n```\r\nCheck on result dir, you will get `Simple.php` file generated from `simple.proto`\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fndunks%2Fphp-simple-protobuf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fndunks%2Fphp-simple-protobuf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fndunks%2Fphp-simple-protobuf/lists"}