PHPackages                             ikelutra/php-swarmed - 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. ikelutra/php-swarmed

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

ikelutra/php-swarmed
====================

v1.0.2(7y ago)017MITPHPPHP ^7.0

Since Mar 14Pushed 7y agoCompare

[ Source](https://github.com/IkeLutra/php-swarmed)[ Packagist](https://packagist.org/packages/ikelutra/php-swarmed)[ RSS](/packages/ikelutra-php-swarmed/feed)WikiDiscussions master Synced yesterday

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

PHP-Swarmed
===========

[](#php-swarmed)

Loads docker secrets into PHP environment variables.

This is a PHP version of [go-swarmed](https://github.com/blaskovicz/go-swarmed). It was also inspired by [phpdotenv](https://github.com/vlucas/phpdotenv).

Why?
----

[](#why)

Because most frameworks, e.g. Symfony and Laravel, expect configuration variables as environment variables. Docker correctly recommends not setting sensitive environment variables as other applications can read these and instead recommend [secrets](https://docs.docker.com/engine/swarm/secrets/). For ease of use this library lets you import these secrets files into environment variables to allow you to use them as you usually would.

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

[](#installation)

```
composer require ikelutra\php-swarmed

```

Usage
-----

[](#usage)

It is fairly simple and will convert the filename of the secret into the uppercase version as the key e.g. `/run/secrets/my_simple_secret` to `MY_SIMPLE_SECRET`. The value is the is the contents of the file minus any trailing whitespace.

```
$swarmed = new IkeLutra\Swarmed\Swarmed;
$swarmed->load();

```

By default it won't overwrite existing variables, for example set at runtime or by the Dockerfile. If you would like to overwrite these use:

```
$swarmed = new IkeLutra\Swarmed\Swarmed;
$swarmed->overload();

```

Testing
-------

[](#testing)

The tests use docker-compose. To run them simply do:

```
docker-compose up

```

Contributing
------------

[](#contributing)

1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Make your changes
4. Run the tests, adding new ones for your own code if necessary (`docker-compose up`)
5. Commit your changes (`git commit -am 'Added some feature'`)
6. Push to the branch (`git push origin my-new-feature`)
7. Create new Pull Request

###  Health Score

25

—

LowBetter than 35% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity61

Established project with proven stability

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 ~165 days

Total

3

Last Release

2700d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/fc974ea965cfac72c3fa69786ceea9a98cd53398ecfb7556891bb74d8713bb95?d=identicon)[willotter](/maintainers/willotter)

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/ikelutra-php-swarmed/health.svg)

```
[![Health](https://phpackages.com/badges/ikelutra-php-swarmed/health.svg)](https://phpackages.com/packages/ikelutra-php-swarmed)
```

###  Alternatives

[roots/bedrock

WordPress boilerplate with Composer, easier configuration, and an improved folder structure

6.5k456.5k2](/packages/roots-bedrock)[tempest/framework

The PHP framework that gets out of your way.

2.2k31.1k12](/packages/tempest-framework)[vinkla/wordplate

The WordPlate boilerplate

2.2k5.3k](/packages/vinkla-wordplate)[phlak/directory-lister

PHP directory lister

2.5k1.4k](/packages/phlak-directory-lister)[lullabot/drainpipe

An automated build tool to allow projects to have a set standardized operations scripts.

41759.2k3](/packages/lullabot-drainpipe)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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