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(10y ago)230PHPPHP &gt;=5.5.0

Since Jun 3Pushed 10y 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 1mo ago

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

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

[sylius/sylius

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

8.4k5.6M651](/packages/sylius-sylius)[phpdocumentor/phpdocumentor

Documentation Generator for PHP

4.4k3.1M878](/packages/phpdocumentor-phpdocumentor)[freshcells/soap-client-bundle

SoapClientBundle for symfony

35151.0k](/packages/freshcells-soap-client-bundle)[currency-cloud/client

A PHP library which implements the complete functionality of v2 of the The Currency Cloud API.

17327.2k](/packages/currency-cloud-client)

PHPackages © 2026

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