PHPackages                             dcrphp/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. dcrphp/config

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

dcrphp/config
=============

配置文件解析类，目前只支持php配置

1.0.3(5y ago)01.2k6MITPHPPHP ^7.0

Since Jun 5Pushed 5y ago1 watchersCompare

[ Source](https://github.com/dcrphp/config)[ Packagist](https://packagist.org/packages/dcrphp/config)[ RSS](/packages/dcrphp-config/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (5)DependenciesVersions (6)Used By (6)

DcrPHP/Config配置类
================

[](#dcrphpconfig配置类)

1、安装
----

[](#1安装)

 composer install dcrphp/config

2、初始化
-----

[](#2初始化)

```
　　$clsConfig = new Config();
　　$clsConfig->addDirectory(__DIR__ . '\config');
　　//$clsConfig->addFile(__DIR__ . '\config\app.php');
　　//$clsConfig = new Config(__DIR__ . '\config');
　　//$clsConfig = new Config(__DIR__ . '\config\app.php');
　　$clsConfig->setDriver('php');//解析php格式的
　　$clsConfig->set('my', array('email'=>'junqing124@126.com'));
　　$clsConfig->init();

```

3、使用
----

[](#3使用)

```
　　$clsConfig->get(); //获取全部
　　$clsConfig->get('app.debug'); //获取app文件下的debug配置
　　$clsConfig->get('my.email'); //获取自定义配置

```

4、扩展
----

[](#4扩展)

 请在src/Driver/目录下以Php.php为例加类，比如想加实别ini，添加Ini.php,调用时setDriver('ini')即可

5、说明
----

[](#5说明)

 配置读取的以文件名为item名，比如app.php里的配置会读取成:

```
　　$config['app']['default_timezone'] = 'PRC';
　　$config['app']['debug'] = 1;

```

6、更新
----

[](#6更新)

 1.0.3-alpha1(20200918)
 1、只读配置目录的文件，不再读取目录

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 93.8% 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

Every ~26 days

Total

5

Last Release

2068d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5a3b371e27394bd968db9fe1df3d767971f67df3b9fc34aa18273da2792b7e3d?d=identicon)[dcrphp](/maintainers/dcrphp)

---

Top Contributors

[![junqing124](https://avatars.githubusercontent.com/u/6613893?v=4)](https://github.com/junqing124 "junqing124 (15 commits)")[![dcrphp](https://avatars.githubusercontent.com/u/65381497?v=4)](https://github.com/dcrphp "dcrphp (1 commits)")

### Embed Badge

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

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

###  Alternatives

[horstoeko/zugferdvisualizer

A library

33198.3k2](/packages/horstoeko-zugferdvisualizer)

PHPackages © 2026

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