janisto/env
Composer 安装命令:
composer require janisto/env
包简介
Environment class, used to set configuration depending on the server environment.
README 文档
README
Environment class, used to set configuration depending on the server environment.
Installation
If you do not have Composer, you may install it by following the instructions at getcomposer.org.
You can then install this package using the following command:
php composer.phar require "janisto/env" "*"
or add
"janisto/env": "*"
to the require section of your application's composer.json file.
Usage
web index.php
<?php require(dirname(__DIR__) . '/vendor/autoload.php'); $env = new \janisto\env\Environment(dirname(__DIR__) . '/config'); // $env->config // environment configuration array
or if you have multiple configuration locations
<?php require(dirname(__DIR__) . '/vendor/autoload.php'); $env = new \janisto\env\Environment([ dirname(__DIR__) . '/common/config', dirname(__DIR__) . '/backend/config' ]); // $env->config // environment configuration array
console cli.php
#!/usr/bin/env php <?php require(__DIR__ . '/vendor/autoload.php'); $env = new \janisto\env\Environment(__DIR__ . '/config'); // $env->config // environment configuration array
Use cli.php
export APP_ENV='dev' && ./cli.php
Documentation
See examples/.
Contributing
Please see CONTRIBUTING for details.
Credits
License
Public domain. Please see License File for more information.
统计信息
- 总下载量: 24
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: public
- 更新时间: 2016-05-13