PHPackages                             codebot/phpenv - 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. codebot/phpenv

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

codebot/phpenv
==============

Class for storing and reading environment variables from .env file stored in document root.

1.0.4(5y ago)055211MITPHP

Since Feb 9Pushed 5y agoCompare

[ Source](https://github.com/hakobyansen/phpenv)[ Packagist](https://packagist.org/packages/codebot/phpenv)[ RSS](/packages/codebot-phpenv/feed)WikiDiscussions master Synced 4d ago

READMEChangelogDependencies (1)Versions (7)Used By (1)

phpenv
======

[](#phpenv)

Class for storing and reading environment variables from ".env" file.

Installation
------------

[](#installation)

To install the package using composer run `composer require codebot/phpenv:1.0.*`

Usage
-----

[](#usage)

You need to create the ".env" file in your project root and define your environment variables there.
Project root is the directory returned by `$_SERVER['DOCUMENT_ROOT']` variable.
If you want to store the .env file somewhere else, you can pass the full path of your .env file as a first argument of `getInstance()` method, e.g. `Env\Core\Env::getInstance( '/path/to/.env' )`.

Example of the .env file:

```
# Test .env file
APP_NAME=The Phpenv Package
APP_ENV=local

```

Example of the usage:

```
$env = Env\Env::getInstance();

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

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 88.2% 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 ~162 days

Total

5

Last Release

2003d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/46efdc41146809a879b858eb0fa5bbf94c34f931866a1237e7467eeaa5f752e1?d=identicon)[sen.hakobyan](/maintainers/sen.hakobyan)

---

Top Contributors

[![hakobyansen](https://avatars.githubusercontent.com/u/43189667?v=4)](https://github.com/hakobyansen "hakobyansen (30 commits)")[![ljonesfl](https://avatars.githubusercontent.com/u/1099983?v=4)](https://github.com/ljonesfl "ljonesfl (4 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/codebot-phpenv/health.svg)

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

###  Alternatives

[crankycyclops/m2-module-discount-code-url

Allows discount codes to be applied to a browser session automatically via a query string or URL path.

4112.3k](/packages/crankycyclops-m2-module-discount-code-url)[fritzmg/contao-news-related

Simple Contao 4+ bundle for setting related news directly.

113.8k](/packages/fritzmg-contao-news-related)[terabin/flarum-ext-sitemap

Generate a Sitemap for Flarum automatically

103.0k1](/packages/terabin-flarum-ext-sitemap)

PHPackages © 2026

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