PHPackages                             josegarcia/nexus - 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. josegarcia/nexus

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

josegarcia/nexus
================

Helps to read and inject all the variables from the .env file into the global variables $\_env and $-\_server

1.0.3(2y ago)2791MITPHP

Since Feb 26Pushed 1y ago1 watchersCompare

[ Source](https://github.com/jgarc186/nexus)[ Packagist](https://packagist.org/packages/josegarcia/nexus)[ RSS](/packages/josegarcia-nexus/feed)WikiDiscussions main Synced 3w ago

READMEChangelog (3)Dependencies (4)Versions (4)Used By (0)

Nexus
=====

[](#nexus)

- A utility package designed to read .env files and inject environment variables into your PHP application.

Description
-----------

[](#description)

- Nexus provides an easy and configuration-free method for loading environment variables from a .env file. It’s a lightweight and user-friendly solution to manage environment settings in your application.

Features
--------

[](#features)

- Load environment variables from a `.env` file into your application.
- Access environment variables using `getenv()`, `$_ENV`, or `$GLOBALS`.
- No configuration required.
- No dependencies.
- Lightweight.
- Easy to use.
- Works with PHP 7.4 and above.
- Works with any PHP framework, library, or application.

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

[](#installation)

```
composer require josegarcia/nexus
```

Usage
-----

[](#usage)

```
use Garcia\Nexus;

$filePath = __DIR__ . '/.env.test'; // Assuming .env is present for testing purposes

// Create a temporary .env file for testing
file_put_contents($filePath, "TEST_VAR=123\nANOTHER_VAR=abc");

// Load the .env file
Nexus::load($filePath);

// Check if environment variables are set
echo getenv('TEST_VAR') . "\n";
echo $_ENV['ANOTHER_VAR'] . "\n";
echo $GLOBALS['TEST_VAR'] . "\n";
echo getenv('ANOTHER_VAR') . "\n";
```

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance36

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity44

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

Total

3

Last Release

851d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0f0f8f85662a8467675c7031213752ffa8bf9ccaee9d5d18d0b3ead05b42f908?d=identicon)[josegarcia](/maintainers/josegarcia)

---

Top Contributors

[![jgarc186](https://avatars.githubusercontent.com/u/34318951?v=4)](https://github.com/jgarc186 "jgarc186 (5 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/josegarcia-nexus/health.svg)

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

###  Alternatives

[typhoon/type

Typhoon Type System

6459.4k11](/packages/typhoon-type)

PHPackages © 2026

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