Renamed source file and help for special environments

This commit is contained in:
Leonel Quinteros 2014-11-11 12:07:14 -02:00
parent f805a8a68a
commit b2e3bf551c
2 changed files with 32 additions and 2 deletions

View File

@ -19,7 +19,37 @@ Requirements
Installation Installation
------------ ------------
Grab src/toml.php and put it where you need it. Grab src/Toml.php and use it where you need it.
This library intends to stay simple and support older versions of PHP down to 5.2.
Common autoloaders would work for standard use as long as the file Toml.php is in the include path.
If you need to use it into namespaced environments or with a certain autoloader struct,
you can wrap it up to your own taste creating a simple file like:
##### /some/project/namespace/path/My/Own/Toml.php
```
<?php
namespace My\Own
require("/path/to/github/cloned/repo/php-toml/src/Toml.php");
```
##### /some/project/autoloader/class/My/Own/Toml.php
```
<?php
require("/path/to/github/cloned/repo/php-toml/src/Toml.php");
class My_Own_Toml extends Toml {}
```
Usage Usage
@ -27,7 +57,7 @@ Usage
``` ```
<?php <?php
require("../src/toml.php"); require("../src/Toml.php");
// Parse TOML string // Parse TOML string
$tomlStr = file_get_contents('example.toml'); $tomlStr = file_get_contents('example.toml');