178inaba / toml-helper
加载toml的辅助工具。
v2.0.0
2016-08-02 02:43 UTC
Requires
- yosymfony/toml: ^0.3.3
Requires (Dev)
- phpunit/phpunit: ^5.4
This package is not auto-updated.
Last update: 2024-09-24 21:31:33 UTC
README
加载 toml 的辅助工具。
安装
$ composer require 178inaba/toml-helper
环境
TOML_DIR
默认的toml目录是 ../tomls
。
要更改toml目录,请设置 TOML_DIR
。
用法
目录结构是
app
|-- public
| +-- index.php
|-- foo
| +-- bar
| +-- example.toml
...
example.toml 是
[author] PHP = "Rasmus Lerdorf"
index.php 是
<?php require __DIR__.'/../vendor/autoload.php'; putenv('TOML_DIR='.__DIR__.'/../foo/bar'); $phpAuthor = toml('example.author.PHP'); echo $phpAuthor."\n";
运行
$ php index.php Rasmus Lerdorf