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

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

zyimm/hyperf-multi-env
======================

hyperf 多环境变量共存

2.1.1(2y ago)41.0k2PHPPHP &gt;=8.0

Since Jul 4Pushed 2y ago1 watchersCompare

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

READMEChangelog (5)Dependencies (5)Versions (11)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不存在亦不会报错影响程序运行

版本约定
====

[](#版本约定)

⚠️Hyperf 框架版本在3.0及以下，请安装1.x版本。（已不维护）

⚠️Hyperf 框架版本在3.0，请安装2.0.x版本。（已不维护）

Hyperf 框架版本在3.1及以上，请安装2.1.x版本。（维护中）

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity59

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

Every ~97 days

Total

7

Last Release

831d ago

Major Versions

1.0.2 → v2.0.02023-01-04

### Community

Maintainers

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

---

Top Contributors

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

###  Code Quality

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[akaunting/laravel-money

Currency formatting and conversion package for Laravel

7825.3M18](/packages/akaunting-laravel-money)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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