tgrj/tweb_config
最新稳定版本:v2.0.0
Composer 安装命令:
composer require tgrj/tweb_config
包简介
minimalistic config system
README 文档
README
minimalistic config system
About
This is part of the core of my tweb micro framework. It serves as the config for certain other aspects of the modules / package.
Usage
- tweb_config_get(string $key)
- This will get the config value of the given key. This key can be some better readable array-depth like for
[ 'a' => [ 'aa' => 1, 'ab' => 2 ] ]you could use'a.ab'as a key to get the config value2. There is a default config (tweb.conf.php) in the modules src folder, By default you can createconfig/tweb.conf.phprelative from the project path. It should return an array. This is able to overwrite the default values, but you can also have your own config keys and values. By overwriting the global variables$TWEB_CONFIG_PATHand$TWEB_CONFIG_FILEyou can define in which folder the user config is stored. You should change these values before callingtweb_config()for the first time.
- This will get the config value of the given key. This key can be some better readable array-depth like for
- tweb_config_set(string $key, mixed $value)
- Normally not to use during runtime, but tests only. But maybe there are situations where you want to alter the config during runtime. The config won't be saved, though.
By default the path getcwd() . '/src/config/tweb.conf.php' is searched for user conf overwrites. You could overwrite it during runtime with tweb_config_set() ... eh, so maybe this function can be usefull during runtime, I guess. Just use it like you want. Hope this will help.
统计信息
- 总下载量: 114
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 4
- 依赖项目数: 9
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-03-06