178inaba/zf1-tomload

此包已被放弃,不再维护。作者建议使用178inaba/toml-helper包。

加载toml的辅助工具。

资助包维护!
178inaba

v2.0.0 2016-08-02 02:43 UTC

This package is not auto-updated.

Last update: 2022-02-01 12:58:57 UTC


README

Build Status Total Downloads Latest Stable Version Latest Unstable Version License

加载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

许可

MIT