PHPackages                             mezon/conf - 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. mezon/conf

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

mezon/conf
==========

Small conf routine

1.2.3(3y ago)512.4k8MITPHPPHP &gt;=7.2.0CI failing

Since Feb 17Pushed 3y ago2 watchersCompare

[ Source](https://github.com/alexdodonov/mezon-conf)[ Packagist](https://packagist.org/packages/mezon/conf)[ Docs](https://github.com/alexdodonov/mezon-conf)[ RSS](/packages/mezon-conf/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (4)Versions (16)Used By (8)

Conf [![Build Status](https://camo.githubusercontent.com/700326b37fc5017a3d2f2cb7c483bceb9b3b1a9d883f64ec8202522051a5da9a/68747470733a2f2f7472617669732d63692e636f6d2f616c6578646f646f6e6f762f6d657a6f6e2d636f6e662e7376673f6272616e63683d6d6173746572)](https://travis-ci.com/alexdodonov/mezon-conf) [![codecov](https://camo.githubusercontent.com/98d805c1a628baa3b9a7db026d31ed56c93a41aa1dc5d97eb343676288c2bd1d/68747470733a2f2f636f6465636f762e696f2f67682f616c6578646f646f6e6f762f6d657a6f6e2d636f6e662f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/alexdodonov/mezon-conf)
===========================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================

[](#conf--)

Configuration
=============

[](#configuration)

Mezon has it's own routine for working with configs. It can be accesed with a set of functions, wich are described below.

Getting access to the key in config can be done with Conf::getValue($route, $defaultValue = false) function. It returns config value with route $route and return $defaultValue if this key was not found. For example:

```
$value = Conf::getValue('res/images/favicon', 'http://yoursite.com/res/images/favicon.ico');
```

Setting values for the config key can be done by calling Conf::setConfigValue($route, $value) or Conf::addConfigValue($route, $value) function. The main difference between these two functions is that the first one sets scalar key, and the second one adds element to the array in config. Here is small example:

```
Conf::setConfigValue('res/value', 'Value!');
var_dump(Conf::getValue('res/value')); // displays 'Value!' string

Conf::addConfigValue('res/value', 'Value 1!');
Conf::addConfigValue('res/value', 'Value 2!');
var_dump(Conf::getValue('res/value')); // displays array( [0] => 'Value 1!' , [1] => 'Value 2!' )
```

You also can use typed versions of these methods:

```
Conf::getValueAsArray(...);
Conf::getValueAsObject(...);
Conf::getValueAsString(...);

Conf::setConfigArrayValue(...);
Conf::setConfigObjectValue(...);
Conf::setConfigStringValue(...);
```

You can set multyple values to the config:

```
// here $settings is an associative array
Conf::setConfigValues(array $settings);
```

Or you can read config from JSON:

```
Conf::loadConfigFromJson(string $pathToConfig);
```

If you are not shure that the key exists, then you can check it:

```
Conf::setConfigValue('res/value', 'Value!');

var_dump(Conf::configKeyExists('res')); // true
var_dump(Conf::configKeyExists('res2')); // false
var_dump(Conf::configKeyExists('res/value')); // true
```

You can also able to delete config key

```
Conf::setConfigValue('res/value', 'Value!');
Conf::deleteConfigValue('res/value');
var_dump(Conf::configKeyExists('res/value')); // false
var_dump(Conf::configKeyExists('res')); // also false
```

Or clear the entire config:

```
Conf::clear();
```

That's all you need to know about config read/write.

###  Health Score

33

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity26

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity60

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

Recently: every ~119 days

Total

15

Last Release

1219d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/14943896?v=4)[alexdodonov](/maintainers/alexdodonov)[@alexdodonov](https://github.com/alexdodonov)

---

Top Contributors

[![alexdodonov](https://avatars.githubusercontent.com/u/14943896?v=4)](https://github.com/alexdodonov "alexdodonov (25 commits)")

---

Tags

configconfigurationconfiguration-filesconfiguration-managementiniini-configini-parserini-readerjson-configjson-configurationphp

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Type Coverage Yes

### Embed Badge

![Health badge](/badges/mezon-conf/health.svg)

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

###  Alternatives

[bluebaytravel/dosh

Simple currency formatter for PHP.

2120.8k](/packages/bluebaytravel-dosh)

PHPackages © 2026

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