PHPackages                             microparts/configuration-php - 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. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. microparts/configuration-php

AbandonedArchivedLibrary[Parsing &amp; Serialization](/categories/parsing)

microparts/configuration-php
============================

A configuration module for PHP microservices.

2.2.2(6y ago)11.3k12GPL-3.0-onlyPHP

Since Oct 31Pushed 6y ago1 watchersCompare

[ Source](https://github.com/microparts/configuration-php)[ Packagist](https://packagist.org/packages/microparts/configuration-php)[ RSS](/packages/microparts-configuration-php/feed)WikiDiscussions master Synced 4d ago

READMEChangelog (10)Dependencies (7)Versions (20)Used By (2)

PHP Microservice configuration module
-------------------------------------

[](#php-microservice-configuration-module)

[![CircleCI](https://camo.githubusercontent.com/13caf89bb43876af46af85870a5d0d2a6c5a9c4f2ff1a341bd346d8bc91aaca7/68747470733a2f2f636972636c6563692e636f6d2f67682f6d6963726f70617274732f636f6e66696775726174696f6e2d7068702f747265652f6d61737465722e7376673f7374796c653d737667)](https://circleci.com/gh/microparts/configuration-php/tree/master)[![codecov](https://camo.githubusercontent.com/4a013b331b1d45257eaded1e0e4fd0b06c319d4f1ae4810f34a5cb3a06b82e0e/68747470733a2f2f636f6465636f762e696f2f67682f6d6963726f70617274732f636f6e66696775726174696f6e2d7068702f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/microparts/configuration-php)

THIS PACKAGE PERMANENTLY MOVED TO

---

Configuration module for microservices written on PHP. Specially created for follow up corporate standards of application configuration.

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

[](#installation)

```
composer require microparts/configuration-php
```

Usage
-----

[](#usage)

By default path to configuration directory and application stage loading from `/app/configuration` with `local` stage.

1. Simple

```
use Microparts\Configuration\Configuration;

$conf = new Configuration();
$conf->load();

var_dump($conf->all()); // get all config
echo $conf->get('foo.bar'); // get nested key use dot notation
echo $conf['foo.bar']; // thie same, but use ArrayAccess interface.
```

2. If u would like override default values, you can pass 2 arguments to class constructor or set up use setters.

```
use Microparts\Configuration\Configuration;

$conf = new Configuration(__DIR__ . '/configuration', 'test');
$conf->load();

$conf->get('key'); // full example on the top
```

3. If the operating system has an env variables `CONFIG_PATH` and `STAGE`, then values for the package will be taken from there.

```
export CONFIG_PATH=/configuration
export STAGE=prod
```

```
use Microparts\Configuration\Configuration;

$conf = new Configuration();
$conf->load(); // loaded files from /configuration for prod stage.

$conf->get('key'); // full example on the top
```

4. If u want to see logs and see how load process working, pass you application logger to the following method:

```
use Microparts\Configuration\Configuration;

$conf = new Configuration();
$conf->setLogger($monolog); // PSR compatible logger.
$conf->load();

$conf->get('key'); // full example on the top
```

That all.

CLI utility
-----------

[](#cli-utility)

Also, you can install simple small cli-utility to dump total results of merged config. It possible with multiple ways:

1. Install to `/usr/local/bin` as global binary

```
L=/usr/local/bin/st-conf && sudo curl -L https://github.com/microparts/configuration-php/releases/download/2.2.0/st-conf.phar -o $L && sudo chmod +x $L
```

2. Install library as global composer requirements

First step:

```
composer global require microparts/configuration-php
```

It will be installed to `~/.composer` directory.

If you have `~/.composer/vendor/bin` in globals path, you can try run command:

```
st-conf help dump
```

Otherwise you can be register that directory:

```
echo 'export PATH=~/.composer/vendor/bin:$PATH' >> ~/.bash_profile
source ~/.bash_profile
```

### CLI Usage

[](#cli-usage)

```
Description:
  Dump loaded configuration

Usage:
  dump [options] [--] [ []]

Arguments:
  path                   Configuration directory path
  stage                  Configuration $STAGE

Options:
  -l, --inline[=INLINE]  The level where you switch to inline YAML [default: 10]
  -s, --indent[=INDENT]  The amount of spaces to use for indentation of nested nodes [default: 2]
  -d, --debug            Debug
  -h, --help             Display this help message
  -q, --quiet            Do not output any message
  -V, --version          Display this application version
      --ansi             Force ANSI output
      --no-ansi          Disable ANSI output
  -n, --no-interaction   Do not ask any interactive question
  -v|vv|vvv, --verbose   Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

Help:
  Example of usage: `st-conf dump`. Options --inline=10 (nesting level) and --indent=2. If [path] and [stage] arguments not passed will be used global env variables CONFIG_PATH and STAGE.
```

Depends
-------

[](#depends)

- &gt;= PHP 7.1
- Composer for install package

License
-------

[](#license)

The MIT License

Copyright © 2020 spacetab.io, Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity70

Established project with proven stability

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

Recently: every ~85 days

Total

18

Last Release

2231d ago

Major Versions

1.0.1 → 2.0.02018-11-06

### Community

Maintainers

![](https://www.gravatar.com/avatar/35d8eff4a3e66b58f3e2af56fe948035469de1e19ac29c532d65c681955bbd18?d=identicon)[Roquie](/maintainers/Roquie)

---

Top Contributors

[![roquie](https://avatars.githubusercontent.com/u/3214290?v=4)](https://github.com/roquie "roquie (62 commits)")

---

Tags

configurationcorporatemicroservicesphpphp7standardsyaml

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/microparts-configuration-php/health.svg)

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

###  Alternatives

[simplesamlphp/simplesamlphp

A PHP implementation of a SAML 2.0 service provider and identity provider.

1.1k12.4M193](/packages/simplesamlphp-simplesamlphp)[drupal/core

Drupal is an open source content management platform powering millions of websites and applications.

19462.3M1.3k](/packages/drupal-core)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.3M152](/packages/sulu-sulu)[drupal/core-recommended

Locked core dependencies; require this project INSTEAD OF drupal/core.

6939.5M343](/packages/drupal-core-recommended)[kimai/kimai

Kimai - Time Tracking

4.6k7.4k1](/packages/kimai-kimai)[goetas-webservices/xsd2php

Convert XSD (XML Schema) definitions into PHP classes and JMS metadata

2411.6M37](/packages/goetas-webservices-xsd2php)

PHPackages © 2026

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