PHPackages                             zenlix/zenenv - 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. zenlix/zenenv

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

zenlix/zenenv
=============

A package for editing the .env file

1.4(9y ago)155MITPHPPHP &gt;=5.5.9

Since Jul 20Pushed 9y ago1 watchersCompare

[ Source](https://github.com/ZENLIX/ZenEnv)[ Packagist](https://packagist.org/packages/zenlix/zenenv)[ RSS](/packages/zenlix-zenenv/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (2)DependenciesVersions (4)Used By (0)

[![License](https://camo.githubusercontent.com/19209f3be81f44c95c018009b5ee54872d3666d71ccc44a0792b710a282b700b/68747470733a2f2f706f7365722e707567782e6f72672f7a656e6c69782f7a656e656e762f6c6963656e7365)](https://packagist.org/packages/zenlix/zenenv)[![Total Downloads](https://camo.githubusercontent.com/f0f081d3b21586df30e2b159a7a34a947ddb2530ad8e16a6f7c9d8a4afccadb4/68747470733a2f2f706f7365722e707567782e6f72672f7a656e6c69782f7a656e656e762f646f776e6c6f616473)](https://packagist.org/packages/zenlix/zenenv)

ZenEnv
======

[](#zenenv)

PHP class that helps work with .env
-----------------------------------

[](#php-class-that-helps-work-with-env)

Install

```
composer require zenlix/zenenv
```

Use

```
use ZenEnv\ZenEnv;
```

Initializing ZenEnv

```
$env = new ZenEnv('/home/rustem/web/public_html/.env');
```

Get array of key/values

```
$env->get();
```

Result:

```
print_r($env-get());
```

```
['PARAM1'=>'VALUE1','PARAM2'=>'VALUE2']
```

Delete by keys

```
$env->delete(['KEY1', 'KEY2']);
```

Before:

```
PARAM1=VALUE1
PARAM2=VALUE2
PARAM3=VALUE3
```

After:

```
PARAM3=VALUE3
```

Add key/value

```
$env->add([
'KEY'=>'VAL',
'KEY2'=>'VAL2'
]);
```

Before:

```
PARAM1=VALUE1
PARAM2=VALUE2
PARAM3=VALUE3
```

After:

```
PARAM1=VALUE1
PARAM2=VALUE2
PARAM3=VALUE3
KEY=VAL
KEY2=VAL2
```

Change key/value

```
$env->set([
'PARAM1'=>'VALUE',
'PARAM2'=>'VALUE'
]);
```

Before:

```
PARAM1=VALUE1
PARAM2=VALUE2
PARAM3=VALUE3
```

After:

```
PARAM1=VALUE
PARAM2=VALUE
PARAM3=VALUE3
```

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity60

Established project with proven stability

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 ~2 days

Total

3

Last Release

3581d ago

### Community

Maintainers

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

---

Tags

dotenvdotenv-editor

### Embed Badge

![Health badge](/badges/zenlix-zenenv/health.svg)

```
[![Health](https://phpackages.com/badges/zenlix-zenenv/health.svg)](https://phpackages.com/packages/zenlix-zenenv)
```

###  Alternatives

[vlucas/phpdotenv

Loads environment variables from `.env` to `getenv()`, `$\_ENV` and `$\_SERVER` automagically.

13.5k602.4M5.4k](/packages/vlucas-phpdotenv)[symfony/dotenv

Registers environment variables from a .env file

3.8k226.7M2.3k](/packages/symfony-dotenv)[jackiedo/dotenv-editor

The .env file editor tool for Laravel 5.8+

2041.2M31](/packages/jackiedo-dotenv-editor)[josegonzalez/dotenv

dotenv file parsing for PHP

2799.8M137](/packages/josegonzalez-dotenv)[sixlive/dotenv-editor

A tool to edit phpdotenv files

761.5M11](/packages/sixlive-dotenv-editor)[helhum/dotenv-connector

Makes it possible to set environment variables for composer projects.

1594.6M34](/packages/helhum-dotenv-connector)

PHPackages © 2026

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