PHPackages                             yiiplus/yii2-app-devhosts - 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. yiiplus/yii2-app-devhosts

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

yiiplus/yii2-app-devhosts
=========================

使用yii2封装 app devhosts 扩展

1.0.5(7y ago)101Apache-2.0PHP

Since Nov 23Pushed 7y ago3 watchersCompare

[ Source](https://github.com/yiiplus/yii2-app-devhosts)[ Packagist](https://packagist.org/packages/yiiplus/yii2-app-devhosts)[ RSS](/packages/yiiplus-yii2-app-devhosts/feed)WikiDiscussions master Synced yesterday

READMEChangelog (6)Dependencies (2)Versions (10)Used By (0)

yii2-app-devhosts
=================

[](#yii2-app-devhosts)

使用yii2封装的 app devhosts 扩展，提供了灵活可编辑的 app hosts 数据。主要应用于app中环境的切换，比如从生产切换到测试，它能更加安全和敏捷的提供环境的host数据。

1.安装
----

[](#1安装)

安装此扩展程序的首选方法是通过 [composer](http://getcomposer.org/download/).

编辑运行

```
php composer.phar require --prefer-dist yiiplus/yii2-app-devhosts "^1.0.0"
```

或添加配置到项目目录下的composer.json文件的require部分

```
"yiiplus/yii2-app-devhosts": "^1.0.0"

```

2.配置
----

[](#2配置)

> 配置后台对数据的增删改查模块

```
'modules' => [
    ...
    'app-devhosts' => [
        'class' => 'yiiplus\appDevhosts\Module',
    ],
    ...
],

'components' => [
    ...
    'i18n' => [
        'translations' => [
            '*' => [
                'class' => 'yii\i18n\PhpMessageSource'
            ],
        ],
    ],
    ...
]
```

3.创建数据库
-------

[](#3创建数据库)

```
./yii migrate --migrationPath=@yiiplus/appDevhosts/migrations
```

4.使用
----

[](#4使用)

> 定义app访问接口

```
//Controller
Class AppDevhostsController extends Controller
{
    function actions(){
       return [
            ...
            'index' => [
            	'class' => 'yiiplus\appDevhosts\actions\ApiActions'
            ],
            ...
        ];
    }
}
```

- 如需操作数据，则访问后台页面：`xxx.com/app-devhosts`
- app接口地址：`xxx.com/xxx/app-devhosts?token=xxx`

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity67

Established project with proven stability

 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

Every ~13 days

Total

6

Last Release

2659d ago

### Community

Maintainers

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

---

Top Contributors

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

---

Tags

yii2extension

### Embed Badge

![Health badge](/badges/yiiplus-yii2-app-devhosts/health.svg)

```
[![Health](https://phpackages.com/badges/yiiplus-yii2-app-devhosts/health.svg)](https://phpackages.com/packages/yiiplus-yii2-app-devhosts)
```

###  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)
