PHPackages                             ysc911/php-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. ysc911/php-env

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

ysc911/php-env
==============

php获取env环境变量

27PHP

Since Aug 4Pushed 2y ago1 watchersCompare

[ Source](https://github.com/ysc911/php-env)[ Packagist](https://packagist.org/packages/ysc911/php-env)[ RSS](/packages/ysc911-php-env/feed)WikiDiscussions main Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

php-env
=======

[](#php-env)

php获取.env文件环境变量
---------------

[](#php获取env文件环境变量)

### 安装命令

[](#安装命令)

composer require ysc911/php-env:dev-main

**默认路径在根目录下.env**

### 获取值

[](#获取值)

$env = new PhpEnv();

$env-&gt;get('APP\_DEBUG', false);

### 自定义文件路径

[](#自定义文件路径)

$env = new PhpEnv();

$env-&gt;load($\_SERVER\['DOCUMENT\_ROOT'\] . '/wwwroot/.env')

### 设置值

[](#设置值)

$env-&gt;set('APP\_DEBUG', false);

###  Health Score

15

—

LowBetter than 3% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity22

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/50165494?v=4)[chao ge](/maintainers/ysc911)[@ysc911](https://github.com/ysc911)

---

Top Contributors

[![ysc911](https://avatars.githubusercontent.com/u/50165494?v=4)](https://github.com/ysc911 "ysc911 (21 commits)")

### Embed Badge

![Health badge](/badges/ysc911-php-env/health.svg)

```
[![Health](https://phpackages.com/badges/ysc911-php-env/health.svg)](https://phpackages.com/packages/ysc911-php-env)
```

PHPackages © 2026

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