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

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

kpacha/config
=============

Resilent configuration system for service discovering

v0.1.2(11y ago)0692MITPHPPHP &gt;=5.3.3

Since Apr 4Pushed 11y ago1 watchersCompare

[ Source](https://github.com/kpacha/config)[ Packagist](https://packagist.org/packages/kpacha/config)[ RSS](/packages/kpacha-config/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (4)Versions (3)Used By (2)

config
======

[](#config)

A simple config module integrated with some service discovery system clients for php

[![Build Status](https://camo.githubusercontent.com/fb35616f1d528f97c7a6d1330b0d7249a3974cf2f5762f87a38446d0cd24d87c/68747470733a2f2f7472617669732d63692e6f72672f6b70616368612f636f6e6669672e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/kpacha/config)

This project is an abstraction of the initial versions of [suricate-config](https://github.com/kpacha/suricate-config).

\#Requirements

- git
- PHP &gt;=5.3.3

\##Optional dependencies (depending on your service discovering flavour)

- [suricate-config](https://github.com/kpacha/suricate-config)
- [consul-config](https://github.com/kpacha/consul-config)

(so check their dependencies!)

\#Installation

\##Standalone

\##As a library (recomended)

Include the `kpacha/sconfig` package in your compose.json with all the dependencies of your project

```
"require":{
    "kpacha/config": "~0.1"
}

```

\###Git installation

Clone the repo

```
$ git clone https://github.com/kpacha/config.git

```

Install the php dependencies

```
$ cd config
$ curl -sS https://getcomposer.org/installer | php
$ php composer.phar install

```

and add one of the recommended dependencies

```
$ php composer.phar require kpacha/suricate-config

```

\###Composer installation

Create a project with composer

```
$ curl -sS https://getcomposer.org/installer | php
$ php composer.phar create-project kpacha/config [directory]

```

and add one of the recommended dependencies

```
$ cd [directory]
$ php composer.phar require kpacha/suricate-config

```

Remeber to set the \[directory\] parameter or composer will create the project in your current path.

\#Config files

Note that `config` expects to find all your config files in a single dir. Currently, yaml is the only supported format for config files.

Also, you should keep in mind those rules:

- All parsed config files will be cached in a single native php config file called `config_file.php`.
- Every parsed config file will be stored in an array, indexed by its basename.
- The `config` module uses the `Symfony\Component\Config\ConfigCache` class to manage the cached configuration, so it will create a `.meta` file with some info about the cached files.
- The `config` module expects to find a config file called `suricate_services.yml` with some required info (check the [tests/fixtures](https://github.com/kpacha/config/tree/master/tests/fixtures) dir for an example)
- The service manager will create a config file called `services_solved.yml`file. Please, do not play with it.

\##services.yml

The required fields are:

- *service-manager*: the class of the service manager to handle the discovering tool (suricate or consul)
- *server*: the url of the suricate server or the consul agent
- *service-names*: the list of services to watch
- *default*: the default configuration to use when the suricate server is not reachable

\#Usage

\##Config module

Create a `Kpacha\Config\Configuration` object.

```
use Kpacha\Config\Configuration;
$configuration = new Configuration('/path/to/your/config/folder', true);

```

And you're ready to go! Just ask for your config data whenever you need it.

```
$someModuleConfig = $configuration->get('some-module');

try{
    $configuration->get('unknown-module'); // unknown-module.yml does not exist
} catch(\Exception $e){
   // do something
}

```

\##Console

The `config` packages exposes a clean CLI interface so you could add a cron to update the service info querying the service discovering server/agent for the services listed in the `service-name` area of your `services.yml` file with

```
$ bin/config c:u /path/to/config/dir

```

Run the `config` script to trigger any console command.

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity49

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

2

Last Release

4062d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1307694?v=4)[Daniel López](/maintainers/kpacha)[@kpacha](https://github.com/kpacha)

---

Top Contributors

[![kpacha](https://avatars.githubusercontent.com/u/1307694?v=4)](https://github.com/kpacha "kpacha (3 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[symfony/maker-bundle

Symfony Maker helps you create empty commands, controllers, form classes, tests and more so you can forget about writing boilerplate code.

3.4k111.1M568](/packages/symfony-maker-bundle)[symplify/monorepo-builder

Not only Composer tools to build a Monorepo.

5205.3M82](/packages/symplify-monorepo-builder)[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

728272.9k20](/packages/civicrm-civicrm-core)[shyim/danger-php

Port of danger to PHP

8544.9k](/packages/shyim-danger-php)[symfony/ai-bundle

Integration bundle for Symfony AI components

30282.3k6](/packages/symfony-ai-bundle)[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)
