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

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

lcloss/env
==========

Simple PHP environment package

055PHP

Since Oct 22Pushed 5y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (3)Used By (0)

php-env
=======

[](#php-env)

Simple Environment package

Requirements
------------

[](#requirements)

On root folder, create a .env file with information you need:

```
[database]
driver = mysql
server = localhost
port   = 3306
dbname = testdb
user   = root
password =

[some_section]
key1    = value1
key2 = "value3"

[other_section]
key1    = value2
key2 = "value6"

```

Usage
-----

[](#usage)

### Retrieving a section

[](#retrieving-a-section)

```
use LCloss\Env\Environment;

$path_from = '.' . DIRECTORY_SEPARATOR;

$env = Environment::getInstance('.env', $path_from);
$database = $env->database;
echo $database['dbname'];

// Or...
$datbase = $env->getSection('database');
echo $database['dbname'];
```

### Retrieving a property

[](#retrieving-a-property)

```
use LCloss\Env\Environment;

$env = Environment::getInstance();  // Will retrieve .env file from current path
$key1 = $env->key1; // Will retrive first property with this 'key1': value1
echo $key1;

// Or...
$key1 = $env->getKey('other_section', 'key1');  // Retrieve: value2
echo $key1;
```

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity35

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://www.gravatar.com/avatar/e3338044b423a7d652c1788cb6a2247ac01877258d3c16362ac2645ff4de4707?d=identicon)[lcloss](/maintainers/lcloss)

---

Top Contributors

[![lcloss](https://avatars.githubusercontent.com/u/10761341?v=4)](https://github.com/lcloss "lcloss (16 commits)")

### Embed Badge

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

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

PHPackages © 2026

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