PHPackages                             ndunks/php-simple-protobuf - 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. ndunks/php-simple-protobuf

ActiveLibrary

ndunks/php-simple-protobuf
==========================

v1.2(8y ago)3321MITPHPPHP &gt;=5.6

Since Oct 7Pushed 8y ago1 watchersCompare

[ Source](https://github.com/ndunks/php-simple-protobuf)[ Packagist](https://packagist.org/packages/ndunks/php-simple-protobuf)[ RSS](/packages/ndunks-php-simple-protobuf/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependencies (1)Versions (3)Used By (0)

php-simple-protobuf
===================

[](#php-simple-protobuf)

PHP Implementation of Google Protocol Buffers

- Simple Protobuf implementation for PHP without install/compile PHP extension
- Support to compile proto 2 files without use any binary/executable
- Support group type field

About Protobuf
--------------

[](#about-protobuf)

Protocol Buffers (a.k.a., protobuf) are Google's language-neutral, platform-neutral, extensible mechanism for serializing structured data. You can find [protobuf's documentation on the Google Developers site](https://developers.google.com/protocol-buffers/).

Getting started
---------------

[](#getting-started)

### Requirements

[](#requirements)

- PHP 5.6 or above
- php-json extension (for json serializer)

### Installation

[](#installation)

Install with composer.

```
# add ndunks/php-simple-protobuf entry to your composer.json
{
    "require": {
        "ndunks/php-simple-protobuf": "*"
    }
}

# install requirements composer
composer install

```

Usage
-----

[](#usage)

Compile proto 2 file to PHP Classes
-----------------------------------

[](#compile-proto-2-file-to-php-classes)

Just execute php code on console in your project root dir

```
vendor\bin\compiler.php.bat --out= --file=

```

Run the code
------------

[](#run-the-code)

```
include 'vendor/autoload.php';
// Class Simple compiled from simple.proto (find on test/proto)
$obj = new Simple();
$obj->setName('user');
$obj->setAddress('Indonesia');
$obj->setAge(25);
$obj->toArray(); // as PHP Array
$obj->toJson(); // as JSON formated string

```

Example on Linux
----------------

[](#example-on-linux)

Example Setup &amp; installation on Linux make sure your php.ini (cli) has `short_open_tag` is `On`

```
git clone https://github.com/ndunks/php-simple-protobuf
cd php-simple-protobuf
composer dump-autoload

```

You can skip `composer install` if you want to use it (not develop it) because this project not depend to any other composer library. Run this to compile example proto (on project dir)

```
# if output directory not exist, you must create it manualy
mkdir result
# Compile it
php bin/compiler.php --out=result --file=test/proto/simple.proto

```

Check on result dir, you will get `Simple.php` file generated from `simple.proto`

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity59

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

Every ~160 days

Total

2

Last Release

2980d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/615fe91d3b334c698035299fa4b3d3e98d1a9b186132162fb80904f9c5c22dea?d=identicon)[ndunks](/maintainers/ndunks)

---

Top Contributors

[![ndunks](https://avatars.githubusercontent.com/u/5500313?v=4)](https://github.com/ndunks "ndunks (5 commits)")

---

Tags

google-protocol-buffersphpplaystoreprotobuf

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/ndunks-php-simple-protobuf/health.svg)

```
[![Health](https://phpackages.com/badges/ndunks-php-simple-protobuf/health.svg)](https://phpackages.com/packages/ndunks-php-simple-protobuf)
```

PHPackages © 2026

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