panda/config
最新稳定版本:v3.0.0
Composer 安装命令:
composer require panda/config
包简介
The Panda Config Package.
README 文档
README
[READ-ONLY] Subtree split of the Panda Config Package
Introduction
All of the configuration files for the Panda framework are stored in the config directory. The main configuration file is named config-default followed by the extension according to the configuration type.
The main configuration file should include all the necessary config values for all the different services or features of your application.
Shared Configuration
The configuration values are being loaded in a common/shared configuration that is accessible during runtime at any time without the access to the configuration object.
Shared configuration is a sub-set of the shared registry and it can keep its values during runtime across different objects.
Configuration parsers
The default configuration parser for the configuration files is the \Panda\Config\Parsers\JsonParser which support json files.
The job of the parsers (from the config package) is to parse the configuration files and return an array of their values.
Accessing Configuration Values
You may easily access your configuration values using the SharedConfiguration object.
The configuration values may be accessed using "dot" syntax, which is being translated in encapsulated groups of values.
A default value may also be specified and will be returned if the configuration option does not exist:
use \Panda\Config\SharedConfiguration; $config = new SharedConfiguration(); $value = $config->get('routes.base_dir', $default = null);
You can also set configuration values at runtime:
use \Panda\Config\SharedConfiguration; $config = new SharedConfiguration(); $config->set('logger.enabled', false);
统计信息
- 总下载量: 2.4k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-06-28