PHPackages                             partikus/protobuf-encoder - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. partikus/protobuf-encoder

ActiveProject[Parsing &amp; Serialization](/categories/parsing)

partikus/protobuf-encoder
=========================

v0.0.1(9y ago)58MITPHPPHP &gt;=5.5.9

Since Feb 26Pushed 7y ago2 watchersCompare

[ Source](https://github.com/partikus/php-protobuf-encoder)[ Packagist](https://packagist.org/packages/partikus/protobuf-encoder)[ RSS](/packages/partikus-protobuf-encoder/feed)WikiDiscussions master Synced yesterday

READMEChangelog (1)Dependencies (7)Versions (2)Used By (0)

PHP Protbuf Encode
==================

[](#php-protbuf-encode)

[![Build Status](https://camo.githubusercontent.com/b30e4e7e41d15489f65d4d0dcc40ba5a6906d2d3feca9e7bb768ea86b7255ff4/68747470733a2f2f7472617669732d63692e6f72672f70617274696b75732f7068702d70726f746f6275662d656e636f6465722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/partikus/php-protobuf-encoder)

Simple PHP library that allows you encode Protobuf Message to byte code. Additionally this library allows to encode/decode massage into single message. The implementation is based on [this article](http://eli.thegreenplace.net/2011/08/02/length-prefix-framing-for-protocol-buffers).

How to use it?
--------------

[](#how-to-use-it)

### Prepare Proto Message file

[](#prepare-proto-message-file)

```
syntax = "proto3";

package Your.Namespace;

message DummyMessage {
    string Title = 1;
    string Description = 2;
    string CreatedAt = 3;
    string UpdatedAt = 4;
}

```

### Generate PHP files

[](#generate-php-files)

```
vendor/bin/protobuf --include-descriptors -i . -o src/ DummyMessage.proto

```

### Create PHP objects

[](#create-php-objects)

```
$dummyMessage = Your\Namespace\DummyMessage::fromArray([
    'Title' => 'Test 123',
    'Description' => 'Description from the text',
    'CreatedAt' => '2016-12-12 12:00:00',
    'UpdatedAt' => '2016-12-12 13:00:00',
]);

$encoder = new ClearCode\Protobuf\ByteEncoder();
/** @var \Protobuf\Stream $stream */
$stream = $encoder->encode($dummyMessage);
file_put_contents(__DIR__ . '/dummyMessage.pb.bin', $stream);

```

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3412d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1732227?v=4)[Michał Kruczek](/maintainers/partikus)[@partikus](https://github.com/partikus)

---

Top Contributors

[![partikus](https://avatars.githubusercontent.com/u/1732227?v=4)](https://github.com/partikus "partikus (2 commits)")

---

Tags

encoderlibraryphpphp7protobufprotobuf3

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/partikus-protobuf-encoder/health.svg)

```
[![Health](https://phpackages.com/badges/partikus-protobuf-encoder/health.svg)](https://phpackages.com/packages/partikus-protobuf-encoder)
```

###  Alternatives

[mck89/peast

Peast is PHP library that generates AST for JavaScript code

19037.7M41](/packages/mck89-peast)[protobuf-php/protobuf-plugin

PHP Code generator plugin from Google's Protocol Buffers

57144.0k18](/packages/protobuf-php-protobuf-plugin)[sauladam/shipment-tracker

Parses tracking information for several carriers, like UPS, USPS, DHL and GLS by simply scraping the data. No need for any kind of API access.

9642.0k](/packages/sauladam-shipment-tracker)[moonshine/layouts-field

Field for repeating groups of fields for MoonShine

107.9k](/packages/moonshine-layouts-field)[tcds-io/php-jackson

A lightweight, flexible object serializer for PHP, inspired by FasterXML/jackson

112.9k10](/packages/tcds-io-php-jackson)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
