定制 luracast/config 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

luracast/config

最新稳定版本:2.0.2

Composer 安装命令:

composer require luracast/config

包简介

lazy load configuration data from php files returning associative arrays

README 文档

README

Latest Stable Version Total Downloads Latest Unstable Version License Build Status

Config class for loading configuration arrays from various files and provide easy access to nested properties with dot syntax

Lazy loads configuration information when requested using Config::get('file.property','default_value') or $config['file.property']

For example :-

Config::get('database.connections.sqlite', [])

will load database.php which returns an array that contains connections property which contains the sqlite property value of which will be returned. $path given in the constructor is the path it will look for the file. If file does not exist or the property does not exist, then the default value (set by the second parameter) will be returned.

If there is no default value, null will be returned.

When an environment string is specified, it will look for a folder with that name inside the path and use the returned array to override the properties is original config file thus allowing some customization

Setting A Configuration Value

Notice that "dot" style syntax may be used to access values in the various files. You may also set configuration values at run-time:

Config::set('database.default', 'sqlite');

Configuration values that are set at run-time are only set for the current request, and will not be carried over to subsequent requests.

统计信息

  • 总下载量: 156.15k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 10
  • 点击次数: 1
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 7
  • Watchers: 2
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: LGPL-2.0-only
  • 更新时间: 2014-07-13