PHPackages                             neilmcgibbon/php-open-rail-data - 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. [API Development](/categories/api)
4. /
5. neilmcgibbon/php-open-rail-data

ActiveLibrary[API Development](/categories/api)

neilmcgibbon/php-open-rail-data
===============================

A PHP libary for processing API events from the Open Rail Data initiative

0.1.0(11y ago)230PHPPHP &gt;=5.5.0

Since Jun 3Pushed 11y agoCompare

[ Source](https://github.com/neilmcgibbon/php-open-rail-data)[ Packagist](https://packagist.org/packages/neilmcgibbon/php-open-rail-data)[ RSS](/packages/neilmcgibbon-php-open-rail-data/feed)WikiDiscussions master Synced today

READMEChangelog (1)Dependencies (2)Versions (2)Used By (0)

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
------------

[](#installation)

This is done via composer (packagist). Add the following to your composer.json file:

```
{
  "require": {
     "neilmcgibbon/php-open-rail-data": "0.1.0"
  }
}
```

### Currently supported data feeds:

[](#currently-supported-data-feeds)

- **Network Rail**
    - ActiveMQ realtime feeds (via Stomp)
        - [**RTPPM**](http://nrodwiki.rockshore.net/index.php/RTPPM) - Real Time Passenger Performance Measurements
        - [**VSTP**](http://nrodwiki.rockshore.net/index.php/VSTP) - Very Short Term Planning
        - [**Train Movements**](http://nrodwiki.rockshore.net/index.php/Train_Movements) - Cancellations, Activations, Reinstatements, etc.
        - [**TD**](http://nrodwiki.rockshore.net/index.php/TD) - Train Describer events

\###Feeds not yet supported

- **Network Rail**

    - ActiveMQ realtime feeds (via Stomp)
        - [**TSR**](http://nrodwiki.rockshore.net/index.php/TSR) - Temporary Speed Restrictions
    - Static feeds (via HTTP)
        - [**Schedule**](http://nrodwiki.rockshore.net/index.php/SCHEDULE) - Schedule data
        - [**Reference Data**](http://nrodwiki.rockshore.net/index.php/Reference_Data) - Reference data
- **National Rail**

    - all feed types

Usage:
------

[](#usage)

### Stomp - Network Rail events

[](#stomp---network-rail-events)

Events are processed via the observer / event dispatcher pattern

##### Example:

[](#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**

```
class ExampleEventListener
{

  public function onEventReceived(RtppmEvent $event)
  {
    echo "Received event. National page late trains count: ";
    echo $event->getNationalPage()->getPerformance()->getLateCount() . PHP_EOL;
  }
}
```

**Create the connection and start listening**

```
$connection = new \OpenRailData\NetworkRail\Services\Stomp\Connection(
  "network_rail_username",
  "network_rail_password"
);

// Create the Topic.
$topic = new OpenRailData\NetworkRail\Services\Stomp\Topics\Rtppm\RtppmTopic();

// Add our event listener to the topic
$topic->addListener(new ExampleEventListener());

// Subscribe to the topic by adding the topic to the connection
$connection->addTopic($topic);

// Start listening for events, the rest is handled by our event listener :-)
$connection->listen();
```

And thats it!

More documentation and functionality to follow. Please also see the `/examples` dir for more examples.

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity48

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

Unknown

Total

1

Last Release

4049d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/aaf48a5b082bb79a9342eb128f147ef4f277e473bf893f53db973674dd1e855c?d=identicon)[neilmcgibbon](/maintainers/neilmcgibbon)

---

Top Contributors

[![neilmcgibbon](https://avatars.githubusercontent.com/u/3208382?v=4)](https://github.com/neilmcgibbon "neilmcgibbon (6 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/neilmcgibbon-php-open-rail-data/health.svg)

```
[![Health](https://phpackages.com/badges/neilmcgibbon-php-open-rail-data/health.svg)](https://phpackages.com/packages/neilmcgibbon-php-open-rail-data)
```

###  Alternatives

[symfony/http-kernel

Provides a structured process for converting a Request into a Response

8.1k869.4M8.8k](/packages/symfony-http-kernel)[symfony/framework-bundle

Provides a tight integration between Symfony components and the Symfony full-stack framework

3.6k251.7M11.6k](/packages/symfony-framework-bundle)[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.5k5.9M738](/packages/sylius-sylius)[easycorp/easyadmin-bundle

Admin generator for Symfony applications

4.3k17.9M388](/packages/easycorp-easyadmin-bundle)[symfony/security-bundle

Provides a tight integration of the Security component into the Symfony full-stack framework

2.5k185.6M2.4k](/packages/symfony-security-bundle)[matomo/matomo

Matomo is the leading Free/Libre open analytics platform

21.7k38.9k](/packages/matomo-matomo)

PHPackages © 2026

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