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

AbandonedArchivedLibrary

requtize/config
===============

Simple Config library, that handle PHP arrays, YAML and INI files as configs and can dump all configs into one PHP file as Cache.

1.2.0(8y ago)5800MITPHPPHP ~5.5 || ~7.1

Since Apr 26Pushed 5y ago2 watchersCompare

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

READMEChangelog (5)Dependencies (2)Versions (5)Used By (0)

Config
======

[](#config)

This library provides configurational files system, that alows You to combine multiple files and multiple formats into one object and accessing to it from simple array DOT notation.

1. Merging multiple files into one object
2. Imports files in multiple formats in the same way: **PHP**, **INI**, **YAML**
3. Import files from another files
4. Simple dot notation for accessing arrays
5. Cache system, for save parsed files into one

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

[](#installation)

### Via composer.json

[](#via-composerjson)

```
{
    "require": {
        "requtize/config": "^1.2.0"
    }
}
```

### Via Composer CLI

[](#via-composer-cli)

```
composer require requtize/config:^1.2.0

```

### Dot notation

[](#dot-notation)

Dot notation is created for accessing multidimentional arrays (PHP) in simple way. If we want to access to some value, we need separate each index by dot. Following code should to explain that:

```
$array = [
    'one' => [
        'two' => [
            'three' => 'value'
        ]
    ]
];

// PHP access
$array['one']['two']['three'];

// Dot notation access
$config->get('one.two.three');
```

### Code

[](#code)

```
// Without cache system
$config = new Config();
// With cache system
$config = new Config('config-filepath.php');

// Import files - multiple formats in the same way
$config->import('filename.php');
$config->import('filename.ini');
$config->import('filename.yaml');
// Or import as array
$config->import([ 'filename.php', 'filename.ini', 'filename.yaml' ]);

// Get value - each index in multidimensional array separate by dot
// Default value will be returned if given key(s) will not be existed
$value = $config->get('some.deep.index.in-config.file', 'default value');

// Set value in current request live (and in cache).
$config->set('key', 'some value to save');

// Key exists?
$config->has('key') ? 'yes' : 'no';

// Get all data in configs (in all files)
$config->all();
```

### Importing other files in config file

[](#importing-other-files-in-config-file)

If you want to import other files, You musn't write any PHP to do this. Just use **imports.files** index in any file, and type files names in each index You want to import. Importing can be used for imports other formats in the same way. ***Remember that the files are searched relative to file you place importing rules!***

```
return [
    // Other data...
    'imports' => [
        'filepath.php',
        '../../global-config/main.ini',
        './some-yaml.file.yaml'
    ]
    // Other data...
];
```

```
# Other data...
imports:
    "filepath.php"
    "../../global-config/main.ini"
    "./some-yaml.file.yaml"
# Other data...
```

```
; Other data...
[imports]
0 = "filepath.php"
1 = "../../global-config/main.ini"
2 = "./some-yaml.file.yaml"
; Other data...
```

@todo
-----

[](#todo)

- Prefixes for imported files to allow import files from different place: ***'%root%/config.file.php'***, ***'%server-config%/some.file.ini'***
- XML files support
- **You want some more...?**

Licence
-------

[](#licence)

This code is licensed under MIT License.

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 71.4% 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 ~224 days

Total

4

Last Release

2996d ago

Major Versions

0.0.1 → 1.0.02016-10-19

PHP version history (3 changes)0.0.1PHP &gt;=5.5.0

1.0.0PHP ~5.5 || ^7.0

1.2.0PHP ~5.5 || ~7.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/6198c3bc2e2b37d339cc79893c9dd0d100c4443f56361d527bf5306acf2cbe68?d=identicon)[requtize](/maintainers/requtize)

---

Top Contributors

[![Mediaessence](https://avatars.githubusercontent.com/u/262103130?v=4)](https://github.com/Mediaessence "Mediaessence (10 commits)")[![adambanaszkiewicz](https://avatars.githubusercontent.com/u/7622472?v=4)](https://github.com/adambanaszkiewicz "adambanaszkiewicz (4 commits)")

---

Tags

configconfigurationconfiguration-filesconfiguration-managementphpconfigurationSettingsconfigsettingconf

### Embed Badge

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

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

###  Alternatives

[romanpitak/nginx-config-processor

Nginx configuration files processor.

7235.3k1](/packages/romanpitak-nginx-config-processor)[selective/config

Config component, strictly typed

19185.8k3](/packages/selective-config)

PHPackages © 2026

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