PHPackages                             yarco/phpdotenv-generator - 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. yarco/phpdotenv-generator

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

yarco/phpdotenv-generator
=========================

a tool for managing .env file which is a common config solution nowadays

0.1.0(9y ago)04[1 issues](https://github.com/yarcowang/phpdotenv-generator.php/issues)MITPHPPHP ^7.1

Since Jul 13Pushed 9y ago1 watchersCompare

[ Source](https://github.com/yarcowang/phpdotenv-generator.php)[ Packagist](https://packagist.org/packages/yarco/phpdotenv-generator)[ RSS](/packages/yarco-phpdotenv-generator/feed)WikiDiscussions master Synced 2w ago

READMEChangelogDependencies (2)Versions (3)Used By (0)

PHP DotEnv Generator
====================

[](#php-dotenv-generator)

This is a tool for generating `.env` file which is a very common solution for configuration. [What's phpdotenv?](https://github.com/vlucas/phpdotenv)

Phpdotenv package is used in several php frameworks. Ex.:*laravel*. When dotenv is working, it requires a config file `.env` (or you can set those shell constants by hand, but it is obviously not handy enough, ex.: if you are going to add `API_PREFIX=api` which is a common situation you are doing REST app).

And also, in nowadays, everything is working in an automatic way. So this repository is taking care of those `.env` files.

Use Case
--------

[](#use-case)

There is a `laravel` project you've done. And now you are going to deploy it into several cloud servers. Of course, it is easy by pulling down the source through git...Then what about the `.env` files?
Of cause you can copy and modify your local one then upload it, but it is not very handy, no?

So you add some config in your project's `composer.json` file like this:

```
  "extra": {
    "phpdotenv-parameters": {
      "warning": "false",
      "project": {
        "source": "./.env.ini",
        "dist": "./"
      }
    }
  }

```

Then you add a `.env.ini` like normal `ini` file. (Whether you put the `.env.ini` into git repository is controlled by you).
The `ini` file's content may be as the following:

```
[default]
APP_ENV=local
APP_DEBUG=true
APP_KEY=
APP_TIMEZONE=UTC

[dev]
APP_KEY=dev

[test]
APP_KEY=test

[prod]
APP_KEY=prod

```

So, if you want to generate `dev` environment config, you just type `PHPDOTENV=dev phpdotenv .`. And even handy, you can also config composer to run the install for you.

```
  "scripts": {
    "post-install-cmd": [
      "Yarco\\PHPDotEnvGenerator\\ScriptHandler::generate"
    ],
    "post-update-cmd": [
      "Yarco\\PHPDotEnvGenerator\\ScriptHandler::generate"
    ]
  }

```

Of cause, in this case, you should `composer require yarco/phpdotenv-generator` this package first.

Extra Features
--------------

[](#extra-features)

- if `"warning":true`, it will generate warning messages into sys log
- you can use `projects` to deal with lots projects

###  Health Score

22

—

LowBetter than 21% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity49

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

Unknown

Total

1

Last Release

3319d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1576504?v=4)[Yarco](/maintainers/yarcowang)[@yarcowang](https://github.com/yarcowang)

---

Top Contributors

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

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/yarco-phpdotenv-generator/health.svg)

```
[![Health](https://phpackages.com/badges/yarco-phpdotenv-generator/health.svg)](https://phpackages.com/packages/yarco-phpdotenv-generator)
```

PHPackages © 2026

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