PHPackages                             slexx/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. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. slexx/config

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

slexx/config
============

PHP config manager

v1.0.2(8y ago)33611MITPHP

Since Jul 31Pushed 8y ago1 watchersCompare

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

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

Config
======

[](#config)

[![Latest Stable Version](https://camo.githubusercontent.com/f8bb3c814190dbdb81bfdf171fe766ee9a862cc34bcab488eb79a9e68a33b0ce/68747470733a2f2f706f7365722e707567782e6f72672f736c6578782f636f6e6669672f762f737461626c65)](https://packagist.org/packages/slexx/config) [![Total Downloads](https://camo.githubusercontent.com/6f1e1fcc112f9179567d840b57a43cbebd54979492c5a938cde5b33e72f2557f/68747470733a2f2f706f7365722e707567782e6f72672f736c6578782f636f6e6669672f646f776e6c6f616473)](https://packagist.org/packages/slexx/config) [![Latest Unstable Version](https://camo.githubusercontent.com/f5ad5562537a8a7a20d72226fbb5cdd03b322b53e0482a032bcef2f0cfbf47bc/68747470733a2f2f706f7365722e707567782e6f72672f736c6578782f636f6e6669672f762f756e737461626c65)](https://packagist.org/packages/slexx/config) [![License](https://camo.githubusercontent.com/d55ff8c7ec86d0ac4210003e379114ac0084b0a3d9364e4cb6db67b32f753327/68747470733a2f2f706f7365722e707567782e6f72672f736c6578782f636f6e6669672f6c6963656e7365)](https://packagist.org/packages/slexx/config)

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

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

Установка через `composer`:

```
$ composer require slexx/config

```

Документация
------------

[](#документация)

### Config-&gt;\_\_construct(\[$file\])

[](#config-__constructfile)

**Аргументы:**

ИмяТипОписание\[$file\]`string`, `array`Имя файла имя массив данных**Пример:**

```
new Config('config.json');
new Config('config.ini');
new Config();
new Config(['foo' => 'bar']);
```

### Config-&gt;setFile($file)

[](#config-setfilefile)

Установка пути к файлу

**Аргументы:**

ИмяТипОписание$file`null`, `string`Путь к файлу**Возвращает:** `$this`

### Config-&gt;getFile()

[](#config-getfile)

Получение пути к файлу

**Возвращает:** `null`, `string`

### Config-&gt;save()

[](#config-save)

Сохранение конфигурайии

**Возвращает:** `$this`

**Пример:**

```
$config = new Config('config.json')
$config->set('foo', 'bar');
$config->save();
```

### Config-&gt;toArray()

[](#config-toarray)

Преобразование в массив

**Возвращает:** `array`

### Config-&gt;all()

[](#config-all)

**Возвращает:** `array`

### Config-&gt;count()

[](#config-count)

**Возвращает:** `int`

### Config-&gt;getIterator()

[](#config-getiterator)

**Возвращает:** `\ArrayIterator`

### Config-&gt;set($key, $value)

[](#config-setkey-value)

Установка переменной конфигурации

**Аргументы:**

ИмяТипОписание$key`string`Имя переменной$value`mixed`Значение переменной**Возвращает:** `$this`

### Config-&gt;has($key)

[](#config-haskey)

Проверка существования переменной конфигурации

**Аргументы:**

ИмяТипОписание$key`string`Имя переменной**Возвращает:** `bool`

### Config-&gt;get($key)

[](#config-getkey)

Получение значение переменной конфигурации

**Аргументы:**

ИмяТипОписание$key`string`Имя переменной**Возвращает:** `mixed`, `null` - Значение переменной или null в случае её отсуцтвия

### Config-&gt;remove($key)

[](#config-removekey)

Удаление переменной конфигурации

**Аргументы:**

ИмяТипОписание$key`string`Имя переменной**Возвращает:** `$this`

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity65

Established project with proven stability

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

Total

3

Last Release

2927d ago

### Community

Maintainers

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

---

Top Contributors

[![slexx1234](https://avatars.githubusercontent.com/u/23412450?v=4)](https://github.com/slexx1234 "slexx1234 (29 commits)")

---

Tags

configurationinijsonphpyamljsonconfigyamlini

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[hassankhan/config

Lightweight configuration file loader that supports PHP, INI, XML, JSON, and YAML files

97513.5M170](/packages/hassankhan-config)[thewunder/conphigure

Framework Agnostic Configuration Library

3115.9k](/packages/thewunder-conphigure)[m1/vars

Vars is a simple to use and easily extendable configuration loader with in built loaders for ini, json, PHP, toml, XML and yaml/yml file types. It also comes with in built support for Silex and more frameworks to come soon.

69124.2k1](/packages/m1-vars)[phppkg/config

Config manage, load, get. Supports INI,JSON,YAML,NEON,PHP format file

133.5k](/packages/phppkg-config)

PHPackages © 2026

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