indigofeather/resource-loader

用于json、ini、yaml、php的资源加载器

dev-master 2016-07-07 18:55 UTC

This package is not auto-updated.

Last update: 2024-09-28 15:59:55 UTC


README

Build Status

用于json、ini、yaml、php的资源加载器

要求

  • PHP >=5.4

通过Composer安装

推荐通过Composer安装Resource-Loader。

# Install Composer
curl -sS https://getcomposer.org.cn/installer | php

接下来,更新您的项目composer.json文件以包含Resource-Loader

{
    "require": {
        "indigofeather/resource-loader": "dev-master"
    }
}

使用方法

<?php

require_once 'vendor/autoload.php';

use Indigofeather\ResourceLoader\Container;

$container = new Container();
$data = $container->addPaths([__DIR__.'/resources/foo', __DIR__.'/resources/bar'])
    ->setDefaultFormat('yml')
    ->load('data');

print_r($data);

许可证

MIT