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

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

xervice/config
==============

Config environment to xervice components

3.1.0(7y ago)148.9k↓66.7%11MITPHP

Since Jul 5Pushed 7y ago1 watchersCompare

[ Source](https://github.com/xervice/config)[ Packagist](https://packagist.org/packages/xervice/config)[ RSS](/packages/xervice-config/feed)WikiDiscussions master Synced 5d ago

READMEChangelogDependencies (3)Versions (7)Used By (1)

Xervice: Config
===============

[](#xervice-config)

[![Scrutinizer Code Quality](https://camo.githubusercontent.com/ab3b4bd473caae02a31413c40a59ac2c143126524f204584813309f1cada2846/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f786572766963652f636f6e6669672f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/xervice/config/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/93844a6e56a737658175377b6410cfc49ac3a9a3ef769d2bd37b6918fb697a97/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f786572766963652f636f6e6669672f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/xervice/config/?branch=master)[![Build Status](https://camo.githubusercontent.com/47607ac7103c39415e165759b56c37da49bede252f6b46a61e761a0a98c5cfb0/68747470733a2f2f7472617669732d63692e6f72672f786572766963652f636f6e6669672e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/xervice/config)

Config loader for Xervice services.

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

[](#installation)

```
composer require xervice/config

```

Configuration
-------------

[](#configuration)

1. Add a config directory to your root path
2. In there you have different config files parsed in this order:
    - config\_default.php
    - config\_&lt;APPLICATION\_ENV&gt;.php
    - config\_&lt;APPLICATION\_ENV&gt;\_&lt;APPLICATION\_SCOPE&gt;.php
    - config\_local.php
    - (additional config files defined in previous config file)

***APPLICATION\_ENV*** is a environment variable. The default value is "production". ***APPLICATION\_SCOPE*** is a environment variable. The default value is "main".

To add additional config files you can add them to your config\_default:

```
$config[\Xervice\Config\XerviceConfig::ADDITIONAL_CONFIG_FILES] = [
    __DIR__ . '/addition_config.php'
];
```

If you want to change the config-directory, you can set the environment variable ***CONFIG\_PATH***. If no CONFIG\_PATH is defined, it will look under the environment variable &lt;APPLICATION\_PATH&gt;/config. If no APPLICATION\_PATH is defined, it will look in the current workdir.

Usage
-----

[](#usage)

```
$configProvider = new XerviceConfig(new XerviceConfigFactory());
$config = $configProvider->getConfig();

$value = $config->get('CONFIG_KEY');

$valueWithDefault = $config->get('CONFIG_KEY', 'defaultvalue');

// Or with the static method way
$configProvider = XerviceConfig::getInstance();
$config = $configProvider->getConfig();

...

// Or direct static access
XerviceConfig::set('key', 'value');
XerviceConfig::get('key'); // value
```

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity26

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity67

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

Total

6

Last Release

2826d ago

Major Versions

1.0.1 → 2.0.02018-07-13

2.1.0 → 3.0.02018-08-20

### Community

Maintainers

![](https://www.gravatar.com/avatar/9ba15174c6a847524e2118ff1b34670252159fa2bee234292381e090e3f1b3a1?d=identicon)[mibexx](/maintainers/mibexx)

---

Top Contributors

[![mibexx](https://avatars.githubusercontent.com/u/12134020?v=4)](https://github.com/mibexx "mibexx (38 commits)")

###  Code Quality

TestsCodeception

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

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

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

PHPackages © 2026

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