178inaba / zf1-tomload
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: 2022-02-01 12:58:57 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