zidizei/toml-php

This package is abandoned and no longer maintained. No replacement package was suggested.

Parsing TOML with PHP.

0.3.0 2014-04-27 18:07 UTC

This package is not auto-updated.

Last update: 2020-02-07 15:09:18 UTC


README

Parsing TOML with PHP. Supports TOML Specs 0.2.0.

Build Status

Installation

Use Composer and add this to your composer.json:

"require": {
    "zidizei/toml-php", "~0.3.0"
}

If you want you can just download/clone the source code from GitHub as well. Just include the src/Toml/Toml.php file in your application and you should be good to go.

Usage

The following will parse a TOML formatted String:

$array = \Toml\parse('title = "TOML Example"');

To parse a TOML file, you can just use the same helper function:

$array = \Toml\parse('tests/example.toml');

Tests

Tests are done using PHPUnit and Composer's autoloader (vendor/autoload.php is bootstrapped by phpunit to include the TOML parser class to be tested):

composer install
phpunit