{"id":28120798,"url":"https://github.com/mobilitydata/gtfs-realtime-bindings-php","last_synced_at":"2025-12-13T01:45:02.131Z","repository":{"id":27466031,"uuid":"30945179","full_name":"MobilityData/gtfs-realtime-bindings-php","owner":"MobilityData","description":null,"archived":false,"fork":false,"pushed_at":"2019-06-19T14:34:40.000Z","size":21,"stargazers_count":36,"open_issues_count":0,"forks_count":27,"subscribers_count":18,"default_branch":"master","last_synced_at":"2025-05-08T10:13:02.956Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MobilityData.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-02-18T00:21:53.000Z","updated_at":"2024-04-06T09:19:35.000Z","dependencies_parsed_at":"2022-09-02T07:51:03.346Z","dependency_job_id":null,"html_url":"https://github.com/MobilityData/gtfs-realtime-bindings-php","commit_stats":null,"previous_names":["google/gtfs-realtime-bindings-php"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MobilityData%2Fgtfs-realtime-bindings-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MobilityData%2Fgtfs-realtime-bindings-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MobilityData%2Fgtfs-realtime-bindings-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MobilityData%2Fgtfs-realtime-bindings-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MobilityData","download_url":"https://codeload.github.com/MobilityData/gtfs-realtime-bindings-php/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254096797,"owners_count":22014098,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-05-14T07:41:46.653Z","updated_at":"2025-12-13T01:45:02.086Z","avatar_url":"https://github.com/MobilityData.png","language":"PHP","readme":"# PHP GTFS-realtime Language Bindings\n\n[![PHP version](https://badge.fury.io/ph/google%2Fgtfs-realtime-bindings.svg)](http://badge.fury.io/ph/google%2Fgtfs-realtime-bindings)\n\nProvides PHP classes generated from the\n[GTFS-realtime](https://developers.google.com/transit/gtfs-realtime/) Protocol\nBuffer specification.  These classes will allow you to parse a binary Protocol\nBuffer GTFS-realtime data feed into PHP objects.\n\nFor bindings in other languages, see the\n[gtfs-realtime-bindings](https://github.com/google/gtfs-realtime-bindings)\nproject.\n\n**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.*\n\n## Add the Dependency\n\nTo use the `gtfs-realtime-bindings-php` classes in your own project, you need\nto first install the [Packagist Composer\npackage](https://packagist.org/packages/google/gtfs-realtime-bindings).  To do\nso, add a dependency in your `composer.json` file:\n\n```\n\"require\": {\n  \"google/gtfs-realtime-bindings\": \"x.y.z\"\n}\n```\n\nWhere `x.y.z` is the latest release version:\n\n[![PHP version](https://badge.fury.io/ph/google%2Fgtfs-realtime-bindings.svg)](http://badge.fury.io/ph/google%2Fgtfs-realtime-bindings)\n\nThen update your Composer dependencies:\n\n```\ncomposer update\n```\n\n## Example Code\n\nThe following code snippet demonstrates downloading a GTFS-realtime data feed\nfrom a particular URL, parsing it as a FeedMessage (the root type of the\nGTFS-realtime schema), and iterating over the results.\n\n```php\nrequire_once 'vendor/autoload.php';\n\nuse transit_realtime\\FeedMessage;\n\n$data = file_get_contents(\"URL OF YOUR GTFS-REALTIME SOURCE GOES HERE\");\n$feed = new FeedMessage();\n$feed-\u003eparse($data);\nforeach ($feed-\u003egetEntityList() as $entity) {\n  if ($entity-\u003ehasTripUpdate()) {\n    error_log(\"trip: \" . $entity-\u003egetId());\n  }\n}\n```\n\nFor more details on the naming conventions for the PHP classes generated from\nthe [gtfs-realtime.proto](https://developers.google.com/transit/gtfs-realtime/gtfs-realtime-proto),\ncheck out the [the gtfs-realtime.php source file](https://github.com/google/gtfs-realtime-bindings-php/blob/master/src/gtfs-realtime.php).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmobilitydata%2Fgtfs-realtime-bindings-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmobilitydata%2Fgtfs-realtime-bindings-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmobilitydata%2Fgtfs-realtime-bindings-php/lists"}