Coder Social home page Coder Social logo

php-taf-decoder's Introduction

License Build Status Coverage Status Latest Stable Version

PHP TAF decoder

A PHP library to decode TAF (Terminal Aerodrome Forecast) strings, fully unit tested (100% code coverage)

Try it on the demo website

They use php-taf-decoder in production:

  • Safran Cassiopée (private)
  • Your service here ? Submit a pull request or open an issue !

Introduction

This piece of software is a library package that provides a parser to decode raw TAF messages.

TAF is a format made for weather information forecast. It is predominantly used by in aviation, during flight preparation. Raw TAF format is highly standardized through the International Civil Aviation Organization (ICAO).

Requirements

This library package only requires PHP >= 5.3

It is currently tested automatically for PHP 5.3, 5.4 and 5.5.

If you want to integrate it easily in your project, you should consider installing composer on your system. It is not mandatory though.

Setup

  • With composer (recommended)

Add the following line to the composer.json of your project

{
    "require": {
        "safran-cassiopee/php-taf-decoder": "dev-master"
    }
}

Launch install from your project root with:

composer install --no-dev

Load the library thanks to composer autoloading:

<?php
require_once 'vendor/autoload.php';
  • By hand

Download the latest release from github

Extract it wherever you want in your project. The library itself is in the src/ directory, the other directories are not mandatory for the library to work.

Load the library with the static import file:

<?php
require_once 'path/to/TafDecoder/TafDecoder.inc.php';

Usage

Instantiate the decoder and launch it on a TAF string. The returned object is a DecodedTaf object from which you can retrieve all the weather properties that have been decoded.

All values who have a unit are based on the Value object which provides the methods getValue() and getUnit()

TODO: full documentation of the structure of the DecodedTaf object

TODO: Provide a PHP example

Contribute

If you find a valid TAF that is badly parsed by this library, please open a github issue with all possible details:

  • the full TAF causing problem
  • the parsing exception returned by the library
  • how you expected the decoder to behave
  • anything to support your proposal (links to official websites appreciated)

If you want to improve or enrich the test suite, fork the repository and submit your changes with a pull request.

If you have any other idea to improve the library, please use github issues or directly pull requests depending on what you're more comfortable with.

Tests and coverage

This library is fully unit tested, and uses PHPUnit to launch the tests.

Travis CI is used for continuous integration, which triggers tests for PHP 5.3, 5.4, 5.5 for each push to the repo.

To run the tests by yourself, you must first install the dev dependencies (composer needed)

composer install --dev
apt-get install php5-xdebug # only needed if you're interested in code coverage

Launch the test suite with the following command:

./vendor/bin/phpunit tests

You can also generate an html coverage report by adding the --coverage-html option:

./vendor/bin/phpunit --coverage-html ./report tests
``

php-taf-decoder's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.