PHPackages                             jiyang/hyperf-multi-env - 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. jiyang/hyperf-multi-env

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

jiyang/hyperf-multi-env
=======================

hyperf 多环境变量共存

v3.1(2y ago)041PHPPHP &gt;=8.0

Since Nov 28Pushed 2y agoCompare

[ Source](https://github.com/jiyang666/hyperf-multi-env)[ Packagist](https://packagist.org/packages/jiyang/hyperf-multi-env)[ RSS](/packages/jiyang-hyperf-multi-env/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (4)Versions (2)Used By (0)

hyperf-multi-env
================

[](#hyperf-multi-env)

hyperf 多环境变量共存 支持hyperf3.0

安装
==

[](#安装)

```
composer require zyimm/hyperf-multi-env

```

使用
==

[](#使用)

1. 同级.env 指定APP\_ENV环境变量 比如APP\_ENV=test
2. 同级.env 建立与之匹配.env.test
3. 程序通过env()获取

注意
==

[](#注意)

组件原理本质是监听框架BootApplication事件后触发指定env加载，该事件触发之前框架本身的.env和config已经被加载，所以要再次替换config中所用env相关配置。因而如下建议&amp;须知：

1. .env 保存公共环境变量
2. .env.xx 避免与.env冲突
3. 即使指定APP\_ENV=test .env.test不存在亦不会报错影响程序运行

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor1

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

902d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/879371eda09d70f6881d45c9c6c38001d9ec896a1cf76f948ce19eb6f16812fa?d=identicon)[jiyang](/maintainers/jiyang)

---

Top Contributors

[![zyimm](https://avatars.githubusercontent.com/u/13979159?v=4)](https://github.com/zyimm "zyimm (26 commits)")[![jiyang666](https://avatars.githubusercontent.com/u/20931112?v=4)](https://github.com/jiyang666 "jiyang666 (1 commits)")

###  Code Quality

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/jiyang-hyperf-multi-env/health.svg)

```
[![Health](https://phpackages.com/badges/jiyang-hyperf-multi-env/health.svg)](https://phpackages.com/packages/jiyang-hyperf-multi-env)
```

###  Alternatives

[xmo/mine-core

mineadmin core package

1684.2k1](/packages/xmo-mine-core)

PHPackages © 2026

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