定制 tgrj/tweb_config 二次开发

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

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

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 value 2. There is a default config (tweb.conf.php) in the modules src folder, By default you can create config/tweb.conf.php relative 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_PATH and $TWEB_CONFIG_FILE you can define in which folder the user config is stored. You should change these values before calling tweb_config() for the first time.
  • 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
  • 点击次数: 6
  • 依赖项目数: 9
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-03-06