PHPackages                             toshcn/yii2-configurator - 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. toshcn/yii2-configurator

ActiveYii2-extension[Utility &amp; Helpers](/categories/utility)

toshcn/yii2-configurator
========================

一个简单的配置管理组件

1.0.x-dev(7y ago)010MITPHP

Since Jul 27Pushed 7y ago1 watchersCompare

[ Source](https://github.com/toshcn/yii2-configurator)[ Packagist](https://packagist.org/packages/toshcn/yii2-configurator)[ RSS](/packages/toshcn-yii2-configurator/feed)WikiDiscussions master Synced 4d ago

READMEChangelogDependencies (1)Versions (3)Used By (0)

yii2-configurator
=================

[](#yii2-configurator)

一个简单的配置管理组件

Installation
------------

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
php composer.phar require --prefer-dist toshcn/yii2-configurator "*"

```

or add

```
"toshcn/yii2-configurator": "*"

```

to the require section of your `composer.json` file.

Usage
-----

[](#usage)

配置组件:

```
'components' => [
    'config' => [
        'class' => 'toshcn\yii2\configurator\Configurator',
    ],
]
```

运行数据迁移：

```
php yii migrate --migrationPath=@vendor/toshcn/yii2-configurator/src/migrations

```

添加配置：基础模板在config-&gt;console.php，高级模板在console-&gt;config-&gt;main.php

```
Yii::$app->config->createConfig('myconfig', json_encode(['key' => 'value']), 'my first config');
```

获取配置项:

```
Yii::$app->config->getConfigItem('myconfig', 'key', 'defaultValue');
//返回 key对应的值 value, 如果key不存在，返回 'defaultValue'
```

获取全部配置项:

```
Yii::$app->config->getConfigItemAll('myconfig', ['key' => 'defaultValue']);
//返回 myconfig 配置的全部项, 可以指定配置项的默认值，如果key不存在，key的值会设为'defaultValue'
```

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity49

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

2850d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ff2775d85643b4be333e4f95833159ccf609e0dfd568a530437d08bf09d8018d?d=identicon)[toshcn](/maintainers/toshcn)

---

Top Contributors

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

---

Tags

configuratoryii2extension

### Embed Badge

![Health badge](/badges/toshcn-yii2-configurator/health.svg)

```
[![Health](https://phpackages.com/badges/toshcn-yii2-configurator/health.svg)](https://phpackages.com/packages/toshcn-yii2-configurator)
```

###  Alternatives

[vyants/yii2-daemon

Extension provides functionality for simple daemons creation and control

7859.0k](/packages/vyants-yii2-daemon)[dmstr/yii2-cookie-consent

Yii2 Cookie Consent Widget

1452.6k](/packages/dmstr-yii2-cookie-consent)[richardfan1126/yii2-js-register

Yii2 widget to register JS into view

1357.2k7](/packages/richardfan1126-yii2-js-register)

PHPackages © 2026

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