PHPackages                             gongzhiyang/config - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. gongzhiyang/config

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

gongzhiyang/config
==================

v1.0(4y ago)1142PHPPHP &gt;=7.1.0

Since Jul 13Pushed 4y ago1 watchersCompare

[ Source](https://github.com/mengqingyuni/config)[ Packagist](https://packagist.org/packages/gongzhiyang/config)[ RSS](/packages/gongzhiyang-config/feed)WikiDiscussions main Synced yesterday

READMEChangelog (1)DependenciesVersions (2)Used By (2)

**config(暂)是一个配置模块。主要的场景是帮助第三方模块或框架进行配置数据的加载。**

1. git安装

```
https://github.com/mengqingyuni/config.git

```

2.compose

```
 composer require gongzhiyang/config

```

**获取参数**

1. 一般是有set设置好参数或在配置文件配置好。然后由get获取

[![](images/screenshot_1630390848996.png)](images/screenshot_1630390848996.png)

```
/**

     * 获取配置参数

     * @param $name 配置名称

     * @paramnull $default 默认参数

     * @returnarray

     */

```

```
(new config\Config())->set(['name1' => 'value1', 'name2' => 'value2'], 'default');
(new config\Config())->get('default')

```

**获取数组中某个值**

```
$confs = (new config\\Config())->get('stores.file.type');

```

**检测配置参数**`检测配置项是否存在`

```
/**

     * 检测配置参数

     * @paramnull $name 配置名称

     * @returnbool

     */

```

```
（new config\Config())->has('default');

```

`返回值 成功 true  失败 false`

**手动加载配置项**`适用于加载配置指定地址的配置文件`[![](images/screenshot_1630390848996.png)](images/screenshot_1630390848996.png)

```
  //目录配置文件路径

 define('CONFIG_PATH',__DIR__.'/config/');
 $conf = (new config\Config())->load(CONFIG_PATH,'cache');

 (new config\Config())->set(['name1' => 'value1', 'name2' => 'value2'], 'default');

 $confs = (new config\\Config())->get('default');
if((new config\Config())->has('defaults')) {

echo"true";

}

```

**设置配置**

```
/**

     * 设置配置参数

     * Config::set(\['name1' => 'value1', 'name2' => 'value2'\], 'config');

     * @paramarray $config 配置参数

     * @paramstring $name 配置名称

     * @returnarray

     */

```

**示例**

```
(new config\Config())->set(['name1' => 'value1', 'name2' => 'value2'], 'default');

```

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

1763d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/914797b9af8bd94cd1d8e122055d77e32c24a7c72418f911537c7c97ba607fd0?d=identicon)[mengqingyuni](/maintainers/mengqingyuni)

---

Top Contributors

[![mengqingyuni](https://avatars.githubusercontent.com/u/15793152?v=4)](https://github.com/mengqingyuni "mengqingyuni (4 commits)")

### Embed Badge

![Health badge](/badges/gongzhiyang-config/health.svg)

```
[![Health](https://phpackages.com/badges/gongzhiyang-config/health.svg)](https://phpackages.com/packages/gongzhiyang-config)
```

###  Alternatives

[wbl/magento-minify

Simply enables js and css minification.

602.2k](/packages/wbl-magento-minify)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
