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

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

assertis/config-lib
===================

Simple configuration library

4.7.0(4y ago)115.7k[5 PRs](https://github.com/assertis/config-lib/pulls)MITPHPPHP ^7.0

Since Oct 12Pushed 4y ago2 watchersCompare

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

READMEChangelog (10)Dependencies (7)Versions (57)Used By (0)

Simple configuration library
============================

[](#simple-configuration-library)

Design
------

[](#design)

Configuration library enables you to load configurations into application from different source, it give you way to validate configuration on developer environment.

We are providing 5 base type of configurations.

- `Assertis\Configuration\Drivers\SourceDriver` : simple driver, you can set array with configuration into constructor.
- `Assertis\Configuration\Drivers\DatabaseDriver` : driver is using PDO connection to gain access to configuration from database. This driver is returning `LazyConfiguration`.
- `Assertis\Configuration\Drivers\File\IniDriver` : configuration provided from `.ini` file
- `Assertis\Configuration\Drivers\File\JsonDriver` : configuration provided from `.json` file
- `Assertis\Configuration\Drivers\File\PhpDriver` : configuration provided from `.php` file. File should return array
- `Assertis\Configuration\Drivers\File\YmlDriver` : configuration provided from `.yml` file. File should return array
- `Assertis\Configuration\Drivers\File\XmlDriver` : configuration provided from `.xml` file. File should return array with configuration. Ex:

```

```

We are returning configuration in 2 type of objects:

- `Assertis\Configuration\Collection\ConfigurationArray` is array type object with some extra methods. More detail below.
- `Assertis\Configuration\Collection\LazyConfiguration` is simple array type object but with many limitations. Basically you can only use `get` method, others will throw `Exception`.

Library is also providing `Assertis\Configuration\ConfigurationFactory` to create configuration easily.

Extras
------

[](#extras)

- Configuration will load "common" file if exists. File extension depends of driver type. If we are using `IniDriver` for test env then `common.ini` will be loaded if exists.
- Environment is read from `$_SERVER['ENV']` or `getenv('ENV')`
- When environment is default (dev) or test, configuration structure will be tested
- You can get value using path, for example: `rdis.db.user`
- When you are asking for key when value is array, this value will be changed to `Assertis\Configuration\Collection\ConfigurationArray`
- You can add easily extra drivers

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

[](#installation)

To install this library add the following to your `composer.json` file and run `composer update`:

```
  "repositories": [
    {
      "type": "vcs",
      "url": "https://github.com/assertis/config-lib"
    }
  ],
  "require": {
    "assertis/config-lib": "dev-master"
  }
```

Usage
-----

[](#usage)

To use this library add the following to your Silex application:

```
$app->register(new ConfigurationProvider(), [
    'config.driver' => new IniDriver($app['dir.root'] . '/configs'),
    'config.validator' => $app['validator'],
    'config.validator.constraints' => null
]);
```

Add new tenant to configuration
-------------------------------

[](#add-new-tenant-to-configuration)

1. First of all your service should have something called tenant schema.
2. Put your regular tenant body into `config/schema/tenant.json`e.g.

```
{
  "database": {
    "order": {
      "dsn": "mysql:host=127.0.0.1;dbname=",
      "username": "root",
      "password": ""
    }
  },
  "nlc": "",
  "barcode_key": "",
  "issuer_id": ""
}
```

3. Now in your service you should be able to add tenant to specific config file

```
php vendor/assertis/config-lib/src/Scripts/AddTenant.php {tenantName} {configFileName}  [tenantSchemaFile]
```

If tenantSchemaFile is in different localization than `config/schema/tenant.json` please provide it as a last parameter. E.g. of usage

```
php vendor/assertis/config-lib/src/Scripts/AddTenant.php hex-qa-b2b stage.json
```

###  Health Score

35

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity72

Established project with proven stability

 Bus Factor1

Top contributor holds 52.1% 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 ~47 days

Recently: every ~205 days

Total

48

Last Release

1699d ago

Major Versions

v1.4.1 → 2.0.02016-02-24

1.5.0 → 2.1.02016-06-03

2.1.0 → 3.0.02016-06-08

3.2.3 → 4.0.02016-11-07

PHP version history (6 changes)1.0.0PHP ~5.5.0

2.0.0PHP ^5.6

1.4.3PHP ^5.5.9

1.5.0PHP ^5.5

3.0.0PHP ^5.5 | ^7.0

3.2.0PHP ^7.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/683300?v=4)[Linus Norton](/maintainers/linusnorton)[@linusnorton](https://github.com/linusnorton)

---

Top Contributors

[![pies](https://avatars.githubusercontent.com/u/37940?v=4)](https://github.com/pies "pies (38 commits)")[![plmuninn](https://avatars.githubusercontent.com/u/1395388?v=4)](https://github.com/plmuninn "plmuninn (20 commits)")[![dyktus](https://avatars.githubusercontent.com/u/6807392?v=4)](https://github.com/dyktus "dyktus (7 commits)")[![orzeuek](https://avatars.githubusercontent.com/u/9573323?v=4)](https://github.com/orzeuek "orzeuek (5 commits)")[![yezooz](https://avatars.githubusercontent.com/u/192779?v=4)](https://github.com/yezooz "yezooz (2 commits)")[![linusnorton](https://avatars.githubusercontent.com/u/683300?v=4)](https://github.com/linusnorton "linusnorton (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[rcsofttech/audit-trail-bundle

Enterprise-grade, high-performance Symfony audit trail bundle. Automatically track Doctrine entity changes with split-phase architecture, multiple transports (HTTP, Queue, Doctrine), and sensitive data masking.

1189.8k](/packages/rcsofttech-audit-trail-bundle)[pimcore/pimcore

Content &amp; Product Management Framework (CMS/PIM/E-Commerce)

3.8k3.8M508](/packages/pimcore-pimcore)[craftcms/cms

Craft CMS

3.6k3.6M3.1k](/packages/craftcms-cms)[shopware/platform

The Shopware e-commerce core

3.4k1.5M3](/packages/shopware-platform)[tempest/framework

The PHP framework that gets out of your way.

2.2k34.4k15](/packages/tempest-framework)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

585.6M574](/packages/shopware-core)

PHPackages © 2026

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