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

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

apollo11/env-analyzer
=====================

Analyzes environment files

v1.0.1(7y ago)5481PHP

Since Apr 24Pushed 7y ago3 watchersCompare

[ Source](https://github.com/apolloeleven/env-analyzer)[ Packagist](https://packagist.org/packages/apollo11/env-analyzer)[ Docs](https://github.com/apolloeleven/env-analyzer)[ RSS](/packages/apollo11-env-analyzer/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (2)Dependencies (1)Versions (3)Used By (0)

Env / PHP analyzer
==================

[](#env--php-analyzer)

Analyzes env dist file and allows to insert missing variables to env file through the console

Installation
============

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
php composer.phar require --prefer-dist apollo11/env-analyzer "~1.0"

```

or add

```
"apollo11/env-analyzer": "~1.0"

```

to the require section of your `composer.json` file and run `php composer.phar update` command.

The package offers:

1. [Env](https://github.com/apolloeleven/env-analyzer/blob/master/Env.php) class which can store `.env` and `.env.dist` file path, as well as, getting the difference between those files.
2. [Php](https://github.com/apolloeleven/env-analyzer/blob/master/Php.php) class which can store `env.php` and `env.dist.php` file path, as well as, getting the difference between those files. Note: both `php` files should return Associative array either strings or integers.
3. [Analyzer](https://github.com/apolloeleven/env-analyzer/blob/master/Analyzer.php) class which is used for getting the difference of files through the console

Basic Usage
-----------

[](#basic-usage)

Generally, the best use case is to call [Analyzer](https://github.com/apolloeleven/env-analyzer/blob/master/Analyzer.php) from console, because it gives the ability to insert the value of the missing data, as well.

Add the following code to your console command

```
Analyzer::analyzeEnv($pathToEnv, $pathToEnvDist);

```

or add

```
Analyzer::analyzePhp($pathToPhp, $pathToDistPhp);

```

Usage from Composer
-------------------

[](#usage-from-composer)

You can also run [Analyzer](https://github.com/apolloeleven/env-analyzer/blob/master/Analyzer.php) on [Composer Scripts](https://getcomposer.org/doc/articles/scripts.md)

Add the following code to the `extra` in project's `composer.json` file

```
"apollo11-parameters": {
            //env-path and env-dist-path for analyzing env files
            "env-path": ".env",
            "env-dist-path": ".env.dist",
            //php-env-path and php-env-dist-path for analyzing php files
            "php-env-path": "env.php",
            "php-env-dist-path": "env.dist.php"
  },

```

You should also call the analyzer method from composer script. In this example, I call it from `post-install-cmd`, which is triggered after `composer install` is finished. Just add the following code to script in `composer.json` file

```
"post-install-cmd": [
            //Analyzer for env files
            "\\apollo11\\envAnalyzer\\Analyzer::analyzeEnvComposer",
            //Analyzer for php files
            "\\apollo11\\envAnalyzer\\Analyzer::analyzePhpComposer"
 ],

```

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 95.7% 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 ~111 days

Total

2

Last Release

2831d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/47417401?v=4)[Zura Sekhniashvili](/maintainers/arboshiki)[@arboshiki](https://github.com/arboshiki)

---

Top Contributors

[![saiat3](https://avatars.githubusercontent.com/u/17884566?v=4)](https://github.com/saiat3 "saiat3 (22 commits)")[![thecodeholic](https://avatars.githubusercontent.com/u/4627922?v=4)](https://github.com/thecodeholic "thecodeholic (1 commits)")

---

Tags

analyzercomposer-scriptsenv-analyzerphpyii2-extensionyii2-frameworkyii2-packageenvironmentenvenv-checkerenv-analyzer

### Embed Badge

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

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

###  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)[imliam/laravel-env-set-command

Set a .env file variable from the command line

118352.4k10](/packages/imliam-laravel-env-set-command)[msztorc/laravel-env

Laravel env helper commands

7855.4k](/packages/msztorc-laravel-env)[cekurte/environment

A library to get the values from environment variables and process to php data types

5884.0k7](/packages/cekurte-environment)[mirazmac/dotenvwriter

A PHP library to write values to .env (DotEnv) files

19129.3k7](/packages/mirazmac-dotenvwriter)

PHPackages © 2026

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