178inaba/tomload

This package is abandoned and no longer maintained. The author suggests using the 178inaba/toml-helper package instead.

helper for loading toml.

v1.1.0 2016-07-04 16:33 UTC

README

Build Status Total Downloads Latest Stable Version Latest Unstable Version License

helper for loading toml.

install

$ composer require 178inaba/tomload

env

TOML_DIR

default toml directory is ../tomls.
change toml directory to set TOML_DIR.

usage

directory structure is

app
|-- public
|    +-- index.php
|-- foo
|    +-- bar
|         +-- example.toml
...

example.toml is

[author]
PHP = "Rasmus Lerdorf"

index.php is

<?php

require __DIR__.'/../vendor/autoload.php';
putenv('TOML_DIR='.__DIR__.'/../foo/bar');

$phpAuthor = toml('example.author.PHP');
echo $phpAuthor."\n";

run

$ php index.php
Rasmus Lerdorf

licence

MIT