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

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

popphp/pop-config
=================

Pop Config Component for Pop PHP Framework

4.0.4(6mo ago)412.0k↑38.9%2BSD-3-ClausePHPPHP &gt;=8.3.0CI passing

Since Jul 16Pushed 6mo ago1 watchersCompare

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

READMEChangelog (10)Dependencies (2)Versions (25)Used By (2)

pop-config
==========

[](#pop-config)

[![Build Status](https://github.com/popphp/pop-config/workflows/phpunit/badge.svg)](https://github.com/popphp/pop-config/actions)[![Coverage Status](https://camo.githubusercontent.com/3dc4de4f24bb5efa08742fc709b5038dfa6c52a5d1f83da5ef7339a9b98d3216/687474703a2f2f63632e706f707068702e6f72672f636f7665726167652e7068703f636f6d703d706f702d636f6e666967)](http://cc.popphp.org/pop-config/)

[![Join the chat at https://discord.gg/TZjgT74U7E](https://camo.githubusercontent.com/acad7b0eeb78b78d08ffd2b85681ab243436388b5f86f8bcb956a69246e53739/68747470733a2f2f6d656469612e706f707068702e6f72672f696d672f646973636f72642e737667)](https://discord.gg/TZjgT74U7E)

- [Overview](#overview)
- [Install](#install)
- [Quickstart](#quickstart)

Overview
--------

[](#overview)

`pop-config` is a basic configuration component that helps centralize application configuration values and parameters. Values can be accessed via array notation or object arrow notation. It can disable changes to the configuration values if need be for the life-cycle of the application. It also can parse configuration values from common formats, such as JSON, XML, INI and YAML.

`pop-config` is a component of the [Pop PHP Framework](https://www.popphp.org/).

Install
-------

[](#install)

Install `pop-config` using Composer.

```
composer require popphp/pop-config

```

Or, require it in your composer.json file

```
"require": {
    "popphp/pop-config" : "^4.0.4"
}

```

[Top](#pop-config)

Quickstart
----------

[](#quickstart)

### Set and access values

[](#set-and-access-values)

```
use Pop\Config\Config;

$config = new Config(['foo' => 'bar']);

$foo = $config->foo;
// OR
$foo = $config['foo'];
```

### Allow changes

[](#allow-changes)

Changes to configuration values are disabled by default.

```
use Pop\Config\Config;

$config = new Config(['foo' => 'bar'], true);
$config->foo = 'New Value';
```

### Merge new values into the config object

[](#merge-new-values-into-the-config-object)

```
use Pop\Config\Config;

$config = new Config($configData);
$config->merge($newData);
```

### Convert config object down to a basic array

[](#convert-config-object-down-to-a-basic-array)

```
use Pop\Config\Config;

$config = new Config($configData);
$data   = $config->toArray();
```

### Parse a configuration file

[](#parse-a-configuration-file)

```
; This is a sample configuration file config.ini
[foo]
bar = 1
baz = 2

```

```
use Pop\Config\Config;

$config = Config::createFromData('/path/to/config.ini');

// $value equals 1
$value = $config->foo->bar;
```

### Render config data to a string format

[](#render-config-data-to-a-string-format)

Supported formats include PHP, JSON, XML, INI and YAML

```
use Pop\Config\Config;

$config = new Config($configData);
echo $config->render('json');
```

[Top](#pop-config)

###  Health Score

53

—

FairBetter than 97% of packages

Maintenance66

Regular maintenance activity

Popularity29

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity88

Battle-tested with a long release history

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

Recently: every ~180 days

Total

20

Last Release

201d ago

Major Versions

2.1.1 → 3.0.02017-02-22

v2.x-dev → 3.2.22019-01-10

3.4.1 → 4.0.02023-11-09

PHP version history (8 changes)2.0.0PHP &gt;=5.4.0

3.0.0PHP &gt;=5.6.0

3.2.2PHP &gt;=7.1.0

3.4.0PHP &gt;=7.3.0

3.4.1PHP &gt;=7.4.0

4.0.0PHP &gt;=8.1.0

4.0.2PHP &gt;=8.2.0

4.0.4PHP &gt;=8.3.0

### Community

Maintainers

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

---

Top Contributors

[![nicksagona](https://avatars.githubusercontent.com/u/898670?v=4)](https://github.com/nicksagona "nicksagona (55 commits)")

---

Tags

phpconfigurationconfigpoppop phpapp configapplication configuration

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[caseyamcl/configula

A simple, but versatile, PHP config loader

42146.6k6](/packages/caseyamcl-configula)[popphp/pop-db

Pop Db Component for Pop PHP Framework

1814.6k11](/packages/popphp-pop-db)

PHPackages © 2026

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