Download the PHP package neilmcgibbon/php-open-rail-data without Composer
On this page you can find all versions of the php package neilmcgibbon/php-open-rail-data. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download neilmcgibbon/php-open-rail-data
More information about neilmcgibbon/php-open-rail-data
Files in neilmcgibbon/php-open-rail-data
Package php-open-rail-data
Short Description A PHP libary for processing API events from the Open Rail Data initiative
License
Informations about the package php-open-rail-data
php-open-rail-data
A PHP library to consume data from the Open Rail Data initiative.
At present only Stomp (ActiveMQ) data for Network Rail is supported, but I will be adding support for Static Network Rail data (such as Schedule) and Stomp support for National Rail in the near future.
Installation
This is done via composer (packagist). Add the following to your composer.json file:
Currently supported data feeds:
- Network Rail
- ActiveMQ realtime feeds (via Stomp)
- RTPPM - Real Time Passenger Performance Measurements
- VSTP - Very Short Term Planning
- Train Movements - Cancellations, Activations, Reinstatements, etc.
- TD - Train Describer events
- ActiveMQ realtime feeds (via Stomp)
Feeds not yet supported
-
Network Rail
- ActiveMQ realtime feeds (via Stomp)
- TSR - Temporary Speed Restrictions
- Static feeds (via HTTP)
- Schedule - Schedule data
- Reference Data - Reference data
- ActiveMQ realtime feeds (via Stomp)
- National Rail
- all feed types
Usage:
Stomp - Network Rail events
Events are processed via the observer / event dispatcher pattern
Example:
To listen for Real Time Passenger Performance Measurements (RTPPM events), and then dump out the number of late trains on the "National Page" level:
Create the event listener
Create the connection and start listening
And thats it!
More documentation and functionality to follow. Please also see the /examples
dir for more examples.