PHPackages                             google/gtfs-realtime-bindings - 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. google/gtfs-realtime-bindings

AbandonedLibrary

google/gtfs-realtime-bindings
=============================

PHP classes generated from the GTFS-realtime protocol buffer specification.

0.0.2(11y ago)36130.7k↓36.9%27Apache-2.0PHPPHP &gt;=5.3.0CI passing

Since Feb 18Pushed 6y ago17 watchersCompare

[ Source](https://github.com/google/gtfs-realtime-bindings-php)[ Packagist](https://packagist.org/packages/google/gtfs-realtime-bindings)[ Docs](https://github.com/google/gtfs-realtime-bindings-php)[ RSS](/packages/google-gtfs-realtime-bindings/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (2)Versions (4)Used By (0)

PHP GTFS-realtime Language Bindings
===================================

[](#php-gtfs-realtime-language-bindings)

[![PHP version](https://camo.githubusercontent.com/573200e936000e26caafbbece88776fb1ebdf8ea60106799c60fb294bbdd917f/68747470733a2f2f62616467652e667572792e696f2f70682f676f6f676c65253246677466732d7265616c74696d652d62696e64696e67732e737667)](http://badge.fury.io/ph/google%2Fgtfs-realtime-bindings)

Provides PHP classes generated from the [GTFS-realtime](https://developers.google.com/transit/gtfs-realtime/) Protocol Buffer specification. These classes will allow you to parse a binary Protocol Buffer GTFS-realtime data feed into PHP objects.

For bindings in other languages, see the [gtfs-realtime-bindings](https://github.com/google/gtfs-realtime-bindings)project.

**Deprecated:** *As of February 2019, the official `google-protobuf` Google protoc tool [doesn't support proto2 files](https://github.com/protocolbuffers/protobuf/issues/3623). As a result we are deprecating the PHP bindings until official support for proto2 files is implemented in the Google protocol buffer tools.*

Add the Dependency
------------------

[](#add-the-dependency)

To use the `gtfs-realtime-bindings-php` classes in your own project, you need to first install the [Packagist Composer package](https://packagist.org/packages/google/gtfs-realtime-bindings). To do so, add a dependency in your `composer.json` file:

```
"require": {
  "google/gtfs-realtime-bindings": "x.y.z"
}

```

Where `x.y.z` is the latest release version:

[![PHP version](https://camo.githubusercontent.com/573200e936000e26caafbbece88776fb1ebdf8ea60106799c60fb294bbdd917f/68747470733a2f2f62616467652e667572792e696f2f70682f676f6f676c65253246677466732d7265616c74696d652d62696e64696e67732e737667)](http://badge.fury.io/ph/google%2Fgtfs-realtime-bindings)

Then update your Composer dependencies:

```
composer update

```

Example Code
------------

[](#example-code)

The following code snippet demonstrates downloading a GTFS-realtime data feed from a particular URL, parsing it as a FeedMessage (the root type of the GTFS-realtime schema), and iterating over the results.

```
require_once 'vendor/autoload.php';

use transit_realtime\FeedMessage;

$data = file_get_contents("URL OF YOUR GTFS-REALTIME SOURCE GOES HERE");
$feed = new FeedMessage();
$feed->parse($data);
foreach ($feed->getEntityList() as $entity) {
  if ($entity->hasTripUpdate()) {
    error_log("trip: " . $entity->getId());
  }
}
```

For more details on the naming conventions for the PHP classes generated from the [gtfs-realtime.proto](https://developers.google.com/transit/gtfs-realtime/gtfs-realtime-proto), check out the [the gtfs-realtime.php source file](https://github.com/google/gtfs-realtime-bindings-php/blob/master/src/gtfs-realtime.php).

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity45

Moderate usage in the ecosystem

Community21

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 77.8% 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 ~9 days

Total

2

Last Release

4099d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7ff2b4fd437041354c5584ced15b061ced32ee64be1105ee720a3ed2391806ab?d=identicon)[bdferris](/maintainers/bdferris)

![](https://www.gravatar.com/avatar/57d53e968177977ab5c1f4b2eaa1a32f73a69b316b7068f07225cb4eea44112a?d=identicon)[barbeau](/maintainers/barbeau)

---

Top Contributors

[![bdferris](https://avatars.githubusercontent.com/u/630674?v=4)](https://github.com/bdferris "bdferris (7 commits)")[![barbeau](https://avatars.githubusercontent.com/u/928045?v=4)](https://github.com/barbeau "barbeau (1 commits)")[![cookieguru](https://avatars.githubusercontent.com/u/1888809?v=4)](https://github.com/cookieguru "cookieguru (1 commits)")

---

Tags

gtfs-realtime

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/google-gtfs-realtime-bindings/health.svg)

```
[![Health](https://phpackages.com/badges/google-gtfs-realtime-bindings/health.svg)](https://phpackages.com/packages/google-gtfs-realtime-bindings)
```

PHPackages © 2026

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