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

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

yetanother/config
=================

Yet another php configuration tool

07PHP

Since Aug 4Pushed 12y ago2 watchersCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

Object-oriented configuration for PHP
=====================================

[](#object-oriented-configuration-for-php)

YetAnother Config — простой менеджер конфигурационных файлов.

Установка
---------

[](#установка)

Рекомендуемая установка через [composer](http://getcomposer.org):

```
{
    "require": {
        "yetanother/config": "dev-master"
    }
}
```

Одиночный конфигурационный файл
-------------------------------

[](#одиночный-конфигурационный-файл)

```
// path/to/config.php

return array(
    'parameter1' => 'value1',
    'parameter2' => 'value2'
);
```

```
use YetAnother\Config\Config;

$config = new Config('path/to/config.php');
echo $config['parameter1']; // value1
```

Директория с конфигурационными файлами
--------------------------------------

[](#директория-с-конфигурационными-файлами)

```
config
┕database.php
┕routing.php
┕security.php

```

```
use YetAnother\Config\Config;

$config = new Config('path/to/config');
echo $config['database']['host'];
```

Использование переменных вместо массива
---------------------------------------

[](#использование-переменных-вместо-массива)

```
// path/to/config.php

$parameter1 = 'value1';
$parameter2 = 'value2';
```

```
use YetAnother\Config\Config;

$config = new Config('path/to/config.php');
echo $config['parameter1'];
```

Включение других конфигурационных файлов
----------------------------------------

[](#включение-других-конфигурационных-файлов)

```
config
┕config.php
┕database.php
┕routing.php
┕security.php

```

```
// config.php

$database = include(__DIR__.'/database.php');
$routing = include(__DIR__.'/routing.php');
$security = include(__DIR__.'/security.php');
// или
$database = $this->import('database');
$routing = $this->import('routing');
$security = $this->import('security');
// или
$database = $this->import(__DIR__.'/database.php');
$routing = $this->import(__DIR__.'/routing.php');
$security = $this->import(__DIR__.'/security.php');
```

```
use YetAnother\Config\Config;

$config = new Config('config/config.php');
echo $config['database']['host'];
```

###  Health Score

20

—

LowBetter than 13% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 50% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/dd4b72ef687e4f49f7fa2d7131d9337ec6bba7c4760ca17fbbef9d0b1a955be6?d=identicon)[yetanother](/maintainers/yetanother)

---

Top Contributors

[![heorshe](https://avatars.githubusercontent.com/u/5097270?v=4)](https://github.com/heorshe "heorshe (1 commits)")[![yetanotherphp](https://avatars.githubusercontent.com/u/5096999?v=4)](https://github.com/yetanotherphp "yetanotherphp (1 commits)")

### Embed Badge

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

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

PHPackages © 2026

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