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

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

tina4stack/tina4php-env
=======================

Tina4 PHP Environment Functionality

v2.0.9(2mo ago)37.4k↓40.9%12MITPHPPHP &gt;=8.1CI passing

Since Jul 4Pushed 2mo ago2 watchersCompare

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

READMEChangelog (9)Dependencies (4)Versions (11)Used By (2)

tina4php-env
============

[](#tina4php-env)

Environment variable loader for the Tina4 PHP framework, reading `.env` files and exposing values as PHP constants and `$_ENV` entries.

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

[](#installation)

```
composer require tina4stack/tina4php-env
```

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

[](#requirements)

- PHP &gt;= 8.1

Usage
-----

[](#usage)

### Basic .env File

[](#basic-env-file)

Create a `.env` file in your project root:

```
[Database]
DB_HOST=localhost
DB_PORT=3306
DB_NAME=myapp

[App]
APP_DEBUG=true
VERSION=1.0.0
```

### Loading the Environment

[](#loading-the-environment)

```
use Tina4\Env;

// Loads .env from the project root
new Env();

// Access variables as constants or via $_ENV
echo DB_HOST;          // "localhost"
echo $_ENV["DB_NAME"]; // "myapp"
```

### Environment-Specific Files

[](#environment-specific-files)

Set an `ENVIRONMENT` OS variable to load `.env.{ENVIRONMENT}` instead:

```
// If ENVIRONMENT=staging, loads .env.staging
new Env();

// Or force a specific environment
new Env("production"); // loads .env.production
```

Testing
-------

[](#testing)

```
composer test
```

License
-------

[](#license)

MIT - see [LICENSE](LICENSE)

---

Our Sponsors
------------

[](#our-sponsors)

**Sponsored with 🩵 by Code Infinity**

[![Code Infinity](https://camo.githubusercontent.com/1516fb1662e3486bce77822177a5ea199edc32ea109369812592ec9bca38159a/68747470733a2f2f636f6465696e66696e6974792e636f2e7a612f77702d636f6e74656e742f75706c6f6164732f323032352f30392f6338652d6c6f676f2d6769746875622e706e67)](https://codeinfinity.co.za/about-open-source-policy?utm_source=github&utm_medium=website&utm_campaign=opensource_campaign&utm_id=opensource)

*Supporting open source communities • Innovate • Code • Empower*

###  Health Score

52

—

FairBetter than 96% of packages

Maintenance87

Actively maintained with recent releases

Popularity28

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 89.5% 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 ~190 days

Recently: every ~330 days

Total

10

Last Release

65d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/82961293?v=4)[Tina4](/maintainers/tina4stack)[@tina4stack](https://github.com/tina4stack)

---

Top Contributors

[![andrevanzuydam](https://avatars.githubusercontent.com/u/6102941?v=4)](https://github.com/andrevanzuydam "andrevanzuydam (17 commits)")[![tina4stack](https://avatars.githubusercontent.com/u/82961293?v=4)](https://github.com/tina4stack "tina4stack (2 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[robertmarney/lara-hierarchial-collections

Transforms flat collections to a nested hierarchy

342.2k](/packages/robertmarney-lara-hierarchial-collections)

PHPackages © 2026

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