modus/config
最新稳定版本:1.0
Composer 安装命令:
composer require modus/config
包简介
The Modus Configuration class, supporting various local and global configuration settings for the Modus framework.
README 文档
README
#Modus/Config
The Modus/Config package is designed to provide a simple, basic configuration layer and DI container setup mechanism for any project.
##Installing
To install this package, run the following command:
composer require modus/config
##Dependencies This module depends on the phpdotenv project. No other dependencies are installed.
##Usage Using the configuration package is simple.
The package will automatically attempt to load up to three configuration files on each instantiation, based on the following rules:
- config.php
- The specific environment specified
- local.php
For example, if the environment specified is "production", then Modus/Config will load config.php, then production.php, then local.php.
Modus/Config is smart enough to override the early files with later configuration files. So for example, if you load a file with an array key of 'database' set to null, and in a later configuration set that value to the name of your MySQL database, Modus/Config will compile a configuration that contains the correct value.
For example, imagine the two following configuration files:
# config.php return [ 'database' => null, 'useMysql' => false, 'userEmail' => 'user@example.com', ];
#local.php
return [
'database' => 'myDb',
'useMysql' => true,
'storeEmail' => 'user2@example.com',
];
When Modus/Config evaluates them together, it will create the following configuration:
#evaluated config return [ 'database' => 'myDb', 'useMysql' => true, 'storeEmail' => 'user2@example.com', 'userEmail' => 'user@example.com', ];
In addition, Modus/Config is recursive, so multidimensional arrays will be merged correctly.
##Environment Variables Modus/Config allows you to optionally include the PHP Dotenv project, and define environment variables. This is useful for setting server-specific settings like passwords, keys, database names and server locations.
modus/config 适用场景与选型建议
modus/config 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 297 次下载、GitHub Stars 达 0, 最近一次更新时间为 2015 年 10 月 10 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 modus/config 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 modus/config 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 297
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 21
- 依赖项目数: 2
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-10-10