PHPackages                             legolabs/phputils - 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. legolabs/phputils

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

legolabs/phputils
=================

Useful PHP classes, matching various purposes

v0.3(3y ago)0507GPL-2.0-onlyPHPPHP &gt;=8.1

Since Dec 7Pushed 3y ago1 watchersCompare

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

READMEChangelog (3)DependenciesVersions (4)Used By (0)

phputils
========

[](#phputils)

Useful PHP classes, matching various purposes

EnvReplacer
===========

[](#envreplacer)

Replaces markers in selected files with matching environment variable values.

It's very useful into docker containers, when you pass a lot of environment variables to be inserted into local configuration files.

Markers must be compliant with the regular expression `/__[A-Z0-9_]{5,30}__/` and corresponding environment variable must be the same without the delimiters (`__`)

Example
-------

[](#example)

Marker: `__MARKER__`
Env: `MARKER`

Usage
-----

[](#usage)

Sample file containing markers, e.g php.ini:

```
...
upload_max_filesize = __UPLOAD_MAX_FILESIZE__
max_file_uploads = __MAX_FILE_UPLOADS__
...
```

Setting environment variables:

```
export UPLOAD_MAX_FILESIZE=64M
export MAX_FILE_UPLOADS=20
```

PHP Script:

```
use Legolabs\Utils\EnvReplacer\EnvReplacer;

$replacer = new EnvReplacer('/etc/php/8.1/apache/php.ini');
$replacer->apply();
```

Resulting file:

```
...
upload_max_filesize = 64M
max_file_uploads = 20
...
```

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity47

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

1257d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/39db02a5833e7c97182cf32c3d9d5269386a0d32e394c4bf9d02661a16f16db4?d=identicon)[legolabs](/maintainers/legolabs)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/legolabs-phputils/health.svg)

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

###  Alternatives

[eecli/addon-templates

Templates for the eecli generate:addon command.

386.2k1](/packages/eecli-addon-templates)

PHPackages © 2026

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