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

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

dev-sanjeeb/config
==================

This project is focused around writing a parser for configuration files.

1.0.1(4y ago)06MITPHPPHP &gt;=7.2

Since Oct 19Pushed 4y ago1 watchersCompare

[ Source](https://github.com/dev-sanjeeb/config)[ Packagist](https://packagist.org/packages/dev-sanjeeb/config)[ RSS](/packages/dev-sanjeeb-config/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (1)Dependencies (1)Versions (6)Used By (0)

Introduction
------------

[](#introduction)

This project is focused around writing a parser for configuration files.

Supported file formats:

- JSON

Requirements
------------

[](#requirements)

- PHP &gt;= 7.2

Install with Composer
---------------------

[](#install-with-composer)

```
$ composer require dev-sanjeeb/config
```

Usage
-----

[](#usage)

### Loading Files

[](#loading-files)

Method 1: At the time of initialization

```
// Loading Single file
$config = new Config(__DIR__.'/files/test.json');

// Loading Multiple file
$config = new Config([__DIR__.'/files/test.json', __DIR__.'/files/test2.json']);
```

Method 2: After initialization

```
$config = new Config();

// Loading Single file
$config->loadFiles(__DIR__.'/files/test.json');

// Loading Multiple file
$config->loadFiles([__DIR__.'/files/test.json', __DIR__.'/files/test2.json']);
```

### Loading Raw Text

[](#loading-raw-text)

```
$config = new Config();

// Loading Raw Text
$config->loadRawText(
            [
                [
                    'content' => '{"a":1,"b":2,"c":3,"d":4,"e":5}',
                    'type' => 'json'
                ],
                [
                    'content' => '{"a1":1,"b1":2,"c1":3,"d1":4,"e1":5}',
                    'type' => 'json'
                ]
            ]
        );
```

### Getter

[](#getter)

```
$config = new Config();

// Accessing
$config->get('database.host');

// Accessing with default data
$config->get('database.host', '127.0.0.1');
```

### Setter

[](#setter)

```
$config = new Config();

// Setting value
$config->set('database.host', '127.0.0.1');
```

### Merge Array

[](#merge-array)

```
$config = new Config();

// merge value
$config->merge(['database' => ['host'] => '127.0.0.1']);
```

### Reset

[](#reset)

```
$config = new Config();

// Resetting value
$config->reset();
```

Testing
-------

[](#testing)

```
$ phpunit
```

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE) for more information.

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

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

Total

3

Last Release

1672d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/e8dcc8f863622ce15147e9a326b64652257166357d01ca9b532a959994add9bc?d=identicon)[dev-sanjeeb](/maintainers/dev-sanjeeb)

---

Top Contributors

[![dev-sanjeeb](https://avatars.githubusercontent.com/u/85007621?v=4)](https://github.com/dev-sanjeeb "dev-sanjeeb (36 commits)")

---

Tags

jsonconfigparser

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[hassankhan/config

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

97513.5M170](/packages/hassankhan-config)[salsify/json-streaming-parser

A streaming parser for JSON in PHP.

7766.7M15](/packages/salsify-json-streaming-parser)[cerbero/json-parser

Zero-dependencies pull parser to read large JSON from any source in a memory-efficient way.

803474.6k5](/packages/cerbero-json-parser)[laktak/hjson

JSON for Humans. A configuration file format with relaxed syntax, fewer mistakes and more comments.

86233.7k12](/packages/laktak-hjson)[pcrov/jsonreader

JSON Pull Parser

1451.2M5](/packages/pcrov-jsonreader)[bcncommerce/json-stream

A bundle of tools to work with JSON in PHP

642.2M3](/packages/bcncommerce-json-stream)

PHPackages © 2026

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