2017 © Pedro Peláez
 

library gtfs-realtime-bindings

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

image

jkapron/gtfs-realtime-bindings

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

  • Sunday, February 25, 2018
  • by jkapron
  • Repository
  • 0 Watchers
  • 0 Stars
  • 138 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 16 Forks
  • 0 Open issues
  • 4 Versions
  • 13700 % Grown

The README.md

PHP GTFS-realtime Language Bindings

PHP version, (*1)

Provides PHP classes generated from the GTFS-realtime Protocol Buffer specification. These classes will allow you to parse a binary Protocol Buffer GTFS-realtime data feed into PHP objects., (*2)

For bindings in other languages, see the gtfs-realtime-bindings project., (*3)

Add the Dependency

To use the gtfs-realtime-bindings-php classes in your own project, you need to first install the Packagist Composer package. To do so, add a dependency in your composer.json file:, (*4)

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

Where x.y.z is the latest release version:, (*5)

PHP version, (*6)

Then update your Composer dependencies:, (*7)

composer update

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., (*8)

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, check out the the gtfs-realtime.php source file., (*9)

The Versions

25/02 2018

dev-master

9999999-dev https://github.com/jkapron/gtfs-realtime-bindings-php

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

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

gtfs-realtime

25/02 2018

0.0.3

0.0.3.0 https://github.com/jkapron/gtfs-realtime-bindings-php

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

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

gtfs-realtime

27/02 2015

0.0.2

0.0.2.0 https://github.com/google/gtfs-realtime-bindings-php

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

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

gtfs-realtime

18/02 2015

0.0.1

0.0.1.0 https://github.com/google/gtfs-realtime-bindings

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

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

gtfs-realtime