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

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

tinyapps/yaml-config
====================

Simple PHP library for using yaml config files

v1.3.0(4y ago)22421MITPHPPHP ^8.0

Since Oct 8Pushed 4y ago1 watchersCompare

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

READMEChangelog (6)Dependencies (2)Versions (8)Used By (0)

[![Unit Tests](https://github.com/tinyappsde/yaml-config/actions/workflows/unit-test.yml/badge.svg?branch=master)](https://github.com/tinyappsde/yaml-config/actions/workflows/unit-test.yml)

YAML Config
===========

[](#yaml-config)

Simple PHP library for conveniently using yaml config files and (optional) loading into environment variables.

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

[](#requirements)

PHP ^8.0 or ^8.1 and php-yaml extension (v1.2.0 is based on symfony/yaml instead)

You can use v1.0.2 or lower for PHP 7.4 compatibility (requires the php-yaml extension though).

Installation
------------

[](#installation)

`composer require tinyapps/yaml-config`

Usage
-----

[](#usage)

### Config

[](#config)

```
$config = new \TinyApps\YamlConfig\Config(__DIR__ . '/config.yml');

var_dump($config->get('your_variable')); // or
var_dump($config['your_variable']); // or
var_dump($config->your_variable);

// You can also set the config directory once for easier access
\TinyApps\YamlConfig\Config::setConfigDir(__DIR__ . '/example-configs');

$config = new Config('example'); // will read example-configs/example.yml
$config = new Config('sub/test'); // will read example-configs/sub/test.yml
```

### Load into environment variables

[](#load-into-environment-variables)

```
TinyApps\YamlConfig\EnvLoader::init(__DIR__ . '/env.yml');
var_dump(getenv('your_environment_variable'));
```

### Get a single value from a config (static context)

[](#get-a-single-value-from-a-config-static-context)

```
TinyApps\YamlConfig\Config::getConfigValue('example', 'property'); // returns the "property" value from example config
```

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community8

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

Recently: every ~54 days

Total

7

Last Release

1464d ago

PHP version history (2 changes)v1.0.0PHP ^7.4 || ^8.0

v1.1.0PHP ^8.0

### Community

Maintainers

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

---

Top Contributors

[![dioncodes](https://avatars.githubusercontent.com/u/1241360?v=4)](https://github.com/dioncodes "dioncodes (19 commits)")

---

Tags

configphpphp-libraryyamlconfigyamlenv

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[pragmarx/yaml

Load your Laravel config files using yaml

1152.8M29](/packages/pragmarx-yaml)[maatwebsite/yamlenv

Reads `env.yml` and makes a validated list of variables available as environment variables

1116.7k](/packages/maatwebsite-yamlenv)

PHPackages © 2026

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