PHPackages                             jun/jconfig - 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. jun/jconfig

ActiveProject

jun/jconfig
===========

config class

08PHP

Since Jul 20Pushed 8y agoCompare

[ Source](https://github.com/szjun/xconfig)[ Packagist](https://packagist.org/packages/jun/jconfig)[ RSS](/packages/jun-jconfig/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependenciesVersions (1)Used By (0)

配置层
===

[](#配置层)

> 封装此类库是为了实现功能与配置的分离 接口参考yaf的config接口

使用示例:

```
//-----------------------通过文件------------------------
//配置文件 :dome/config/aa.php
use LSYS\Config\File;
$c=File::instance("aa.a");
var_dump($c->get('fasd'));

```

```
//-----------------------可写的文件------------------------
//配置文件 :dome/config/aa.php
use LSYS\Config\FileRW;
$c = new FileRW("aa");
$c->set("a",array("fasd"=>"fasdf","faasdsd"=>"fadafdssdf"));
var_dump($c->get("a"));

```

```
//-----------------------INI文件------------------------
//配置文件 :dome/config/application.ini
//此方式跟yaf的config的ini类似
use LSYS\Config\INI;
//选择区段,区段间可继承,方便各种环境切换
INI::$section='cccc';
$c=INI::instance("application.application");
print_r($c->get('dispatcher'));

```

```
//-----------------------Redis------------------------
//使用此适配需先链接redis
//方式1
//你有存在一个已链接的redis对象
$redis= new Redis();//your redis obj
$redis->connect();//
LSYS\Config\Redis::set_redis($redis);
//方式2,redis配置存放文件或其他..
LSYS\Config\Redis::set_config(File::instance("redis.default"));

//使用
$config =LSYS\Config\Redis::instance("database.default");
var_dump($config->get("host"));

```

```
//---------------------数组配置----------------------------
//通过数组生成配置对象,方便你已有配置,需转换成config接口对象时使用
$config=new LSYS\Config\Arr("name",array(
'dome'=>'domevalue'
/*示例数组*/
));

```

> 如果你的配置需求上面的还不能满足,你实现下config接口吧...

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

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

### Community

Maintainers

![](https://www.gravatar.com/avatar/9aeff23dd40d765a77b40af6b530af00689d6588ea73c1778187abdb4110f377?d=identicon)[szjun](/maintainers/szjun)

---

Top Contributors

[![ltz168](https://avatars.githubusercontent.com/u/36126434?v=4)](https://github.com/ltz168 "ltz168 (2 commits)")[![szjun](https://avatars.githubusercontent.com/u/26957320?v=4)](https://github.com/szjun "szjun (2 commits)")

### Embed Badge

![Health badge](/badges/jun-jconfig/health.svg)

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

PHPackages © 2026

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