PHPackages                             piotrkreft/config - 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. piotrkreft/config

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

piotrkreft/config
=================

Component for fetching, merging, and validating configuration from various sources

v0.7.0(2y ago)0170.2k↓39.5%MITPHPPHP &gt;=7.2.5CI failing

Since Jun 11Pushed 2y ago1 watchersCompare

[ Source](https://github.com/piotrkreft/config)[ Packagist](https://packagist.org/packages/piotrkreft/config)[ RSS](/packages/piotrkreft-config/feed)WikiDiscussions master Synced today

READMEChangelog (10)Dependencies (10)Versions (11)Used By (0)

Config
======

[](#config)

[![Tests](https://github.com/piotrkreft/config/workflows/Tests/badge.svg)](https://github.com/piotrkreft/config/workflows/Tests/badge.svg)[![Coverage Status](https://camo.githubusercontent.com/f119b0af2157ce47aa2ce9a892635e1e9e02e8b29a7c5fb4c65e3d16b3b5a347/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f70696f74726b726566742f636f6e6669672f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/piotrkreft/config?branch=master)[![Mutation testing badge](https://camo.githubusercontent.com/175f7417370085cb69ac4bdb14e7518a139a9cc0021ced56f1df66f25ea75274/68747470733a2f2f696d672e736869656c64732e696f2f656e64706f696e743f7374796c653d666c61742675726c3d687474707325334125324625324662616467652d6170692e737472796b65722d6d757461746f722e696f2532466769746875622e636f6d25324670696f74726b72656674253246636f6e6669672532466d6173746572)](https://infection.github.io)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/d3159c1055e9efef86dd1e939c15ebdcc9076ed1704827c0f87e7bd6337baf56/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f70696f74726b726566742f636f6e6669672f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/piotrkreft/config/?branch=master)

Component for fetching, merging, and validating configuration from various sources.

Introduction
------------

[](#introduction)

Whenever you have various environments for multiple purposes: production, staging, test, local and more the need arises to keep the configuration of those consistent across possibly different platforms like local environments and some external storage like AWS Simple Systems Manager and not to fail during critical deploy.

This component allows you to keep it tight in one source with a predefined yaml solution.

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

[](#installation)

```
composer require piotrkreft/config
```

Usage
-----

[](#usage)

### Configuration

[](#configuration)

[example configuration](tests/Fixtures/Resources/config/config.yaml)

ℹ️ Variables declared within envs scope take the precedence over global ones.

ℹ️ Global variables can be disabled in specific env with the `disable` flag.

### CLI

[](#cli)

Validation of entries:

```
vendor/bin/pk-config -c config.yaml validate dev
```

Displaying of entries:

```
vendor/bin/pk-config -c config.yaml display dev
```

### PHP

[](#php)

```
use PK\Config\ConfigFactory;

$config = ConfigFactory::create(realpath('config.yaml'));

$config->validate('dev');

$config->fetch('dev');
```

### Symfony Bundle

[](#symfony-bundle)

It's possible to use the component as a Symfony Bundle. Just make sure you have `symfony/http-kernel` installed and add `PK\Config\PKConfigBundle` to your application Kernel.

If used as such commands will receive `pk:config:` and can be used like:

```
bin/console pk:config:validate dev
```

### Adapters

[](#adapters)

To be able to use a different configuration sources adapters are needed. By default, package provides:

- aws\_ssm (multiple)(`PK\Config\StorageAdapter\{AwsSsm, AwsSsmByPath}`) - for AWS Simple Systems Manager parameters
- local\_env (`PK\Config\StorageAdapter\LocalEnv`) - for local environment variables

and each of those is available to be instantiated via component configuration.

If needed a new adapter can be easily created. Just remember to interface it with `PK\Config\StorageAdapterInterface` and to instantiate it.

ℹ️ Order of the adapters in each environment is also a priority. If the first adapter provides value, the following will be ignored.

ℹ️ If adapter has multiple option assigned it can be configured with multiple different instances. If so each can be referenced in env.adapters like {adapter}.{name} (i.e. aws\_ssm.default)

### Testing

[](#testing)

```
composer test
```

Static checks issues fix

```
composer fix
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

License
-------

[](#license)

The MIT License (MIT). Please see [LICENSE](LICENSE) for more information.

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity32

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

Recently: every ~337 days

Total

10

Last Release

855d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/49146985?v=4)[Piotr Kreft](/maintainers/piotrkreft)[@piotrkreft](https://github.com/piotrkreft)

---

Top Contributors

[![piotrkreft](https://avatars.githubusercontent.com/u/49146985?v=4)](https://github.com/piotrkreft "piotrkreft (24 commits)")

---

Tags

configconfig-managementconfigurationconfiguration-loaderconfiguration-management

### Embed Badge

![Health badge](/badges/piotrkreft-config/health.svg)

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

###  Alternatives

[friendsoftypo3/content-blocks

TYPO3 CMS Content Blocks - Content Types API | Define reusable components via YAML

103519.9k53](/packages/friendsoftypo3-content-blocks)[aeliot/todo-registrar

Register TODOs from source code in issue tracker

153.0k](/packages/aeliot-todo-registrar)

PHPackages © 2026

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