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 2mo ago

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 27% 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

3365d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9d129d599d9237602b13dde8e74969f19c77425ee01508edfe54f7a6f5d4587c?d=identicon)[partikus](/maintainers/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

[mtdowling/jmespath.php

Declaratively specify how to extract elements from a JSON document

2.0k472.8M135](/packages/mtdowling-jmespathphp)[opis/closure

A library that can be used to serialize closures (anonymous functions) and arbitrary data.

2.6k230.0M284](/packages/opis-closure)[masterminds/html5

An HTML5 parser and serializer.

1.8k242.8M229](/packages/masterminds-html5)[sabberworm/php-css-parser

Parser for CSS Files written in PHP

1.8k191.2M65](/packages/sabberworm-php-css-parser)[michelf/php-markdown

PHP Markdown

3.5k52.4M345](/packages/michelf-php-markdown)[jms/metadata

Class/method/property metadata management in PHP

1.8k152.8M88](/packages/jms-metadata)

PHPackages © 2026

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