https://github.com/thesis-php/protobuf
A modern strictly typed full-featured serializer for Google's protocol buffers
https://github.com/thesis-php/protobuf
Last synced: 4 months ago
JSON representation
A modern strictly typed full-featured serializer for Google's protocol buffers
- Host: GitHub
- URL: https://github.com/thesis-php/protobuf
- Owner: thesis-php
- License: mit
- Created: 2025-11-18T12:42:59.000Z (7 months ago)
- Default Branch: 0.1.x
- Last Pushed: 2026-01-03T06:00:17.000Z (5 months ago)
- Last Synced: 2026-01-04T13:54:37.141Z (5 months ago)
- Language: PHP
- Size: 295 KB
- Stars: 2
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Thesis Protobuf
## Installation
```shell
composer require thesis/protobuf
```
## Serialize protobuf message
```php
use Thesis\Protobuf;
$message = Protobuf\message(
Protobuf\fieldOf(1, Protobuf\stringOf('kafkiansky')),
Protobuf\fieldOf(2, Protobuf\stringT->list(['thesis', 'typhoon'])),
);
$serializer = new Protobuf\Serializer();
$buffer = $serializer->serialize($message);
echo bin2hex($buffer);
```
## Deserialize protobuf message
```php
use Thesis\Protobuf;
$messageT = Protobuf\messageT(
Protobuf\fieldT(1, Protobuf\stringT),
Protobuf\fieldT(2, Protobuf\listT(Protobuf\stringT)),
);
// TODO
```