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 today

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 31% 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

1305d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/34338274?v=4)[Legolabs srl](/maintainers/legolabs)[@legolabs](https://github.com/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

[drmonkeyninja/cakephp-social-share

CakePHP helper for creating social share/bookmark links

34103.6k](/packages/drmonkeyninja-cakephp-social-share)[nezhelskoy/yii2-highlight

Yii2 highlight.js extension

1532.2k](/packages/nezhelskoy-yii2-highlight)[frozzare/wp-autoload

Simple autoloader that will autoload classes or traits with namespace prefix

1618.8k4](/packages/frozzare-wp-autoload)[ezsystems/ezxmlinstaller-ls

The eZ XML Installer extension is a plattform to define proccesses for eZ Publish and execute them.

223.4k](/packages/ezsystems-ezxmlinstaller-ls)[deltasystems/dewdrop

121.0k](/packages/deltasystems-dewdrop)

PHPackages © 2026

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