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

ActiveLibrary

simplon/config
==============

Simple Config Reader

0.6.0(12y ago)0416MITPHPPHP &gt;=5.4

Since Oct 18Pushed 12y agoCompare

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

READMEChangelogDependenciesVersions (5)Used By (0)

```
     _                 _                                __ _
 ___(_)_ __ ___  _ __ | | ___  _ __     ___ ___  _ __  / _(_) __ _
/ __| | '_ ` _ \| '_ \| |/ _ \| '_ \   / __/ _ \| '_ \| |_| |/ _` |
\__ \ | | | | | | |_) | | (_) | | | | | (_| (_) | | | |  _| | (_| |
|___/_|_| |_| |_| .__/|_|\___/|_| |_|  \___\___/|_| |_|_| |_|\__, |
                |_|                                          |___/
```

Simplon Config
==============

[](#simplon-config)

Its a simple config file reader which handles namespaced config arrays.

Config file example
-------------------

[](#config-file-example)

```
$app = [
  'url'      => [
    'service'  => '[URL_SERVICE]',
    'frontend' => '[URL_FRONTEND]',
  ],

  'database' => [
    'mysql' => [
      'localhost' => [
        'server'   => 'localhost',
        'database' => 'some_db',
        'username' => 'rootuser',
        'password' => 'rootuser'
      ]
    ],
  ],
  'email'    => [
    'host' => 'localhost',
    'port' => 25,
  ],
];
```

Get data from your config file
------------------------------

[](#get-data-from-your-config-file)

To safe resources we access the config class via singleton pattern `Config::getInstance()`. By passing the config file path we inform the class which file we want to read. Now, in order to fetch an actual value we pass an existing config array index as array to `getConfigKeys(['url'])`. As a result we would receive all values which are within the array index of `url`:

```
[
  'service'  => '[URL_SERVICE]',
  'frontend' => '[URL_FRONTEND]',
];
```

Multiple array elements will be chained together. According to that the following example will only return the string value for `['url']['service']`:

```
use Simplon\Config\Config;

$configPath = __DIR__ . '/../../config/common.config.php';

$urlService = Config::getInstance()
->setConfigPath($configPath)
->getConfigByKeys(['url', 'service']);

echo $urlService; // prints "[URL_SERVICE]"
```

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

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

Total

4

Last Release

4559d ago

PHP version history (2 changes)0.5.0PHP &gt;=5.3.3

0.5.2PHP &gt;=5.4

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/451061?v=4)[Tino Ehrich](/maintainers/fightbulc)[@fightbulc](https://github.com/fightbulc)

---

Tags

configreader

### Embed Badge

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

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

###  Alternatives

[symfony/options-resolver

Provides an improved replacement for the array\_replace PHP function

3.2k493.9M1.6k](/packages/symfony-options-resolver)[phpoffice/phpword

PHPWord - A pure PHP library for reading and writing word processing documents (OOXML, ODF, RTF, HTML, PDF)

7.5k34.7M186](/packages/phpoffice-phpword)[nette/schema

📐 Nette Schema: validating data structures against a given Schema.

1.0k336.4M125](/packages/nette-schema)[league/config

Define configuration arrays with strict schemas and access values with dot notation

564302.2M24](/packages/league-config)

PHPackages © 2026

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