PHPackages                             kevinkiel/wp-yaml-loader - 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. kevinkiel/wp-yaml-loader

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

kevinkiel/wp-yaml-loader
========================

Simple YAML Loader for wordpress

1.0.5(11y ago)19523MITPHP

Since Feb 28Pushed 11y ago2 watchersCompare

[ Source](https://github.com/kevinkiel/wp-yaml-loader)[ Packagist](https://packagist.org/packages/kevinkiel/wp-yaml-loader)[ Docs](https://github.com/kevinkiel/wp-yaml-loader)[ RSS](/packages/kevinkiel-wp-yaml-loader/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (7)Used By (0)

wp-yaml-loader
==============

[](#wp-yaml-loader)

Simple YAML config Loader for WordPress

Security
--------

[](#security)

Make sure that you place the config map outside the web root. If you discover any security related issues, please use the issue tracker.

Install
-------

[](#install)

Via Composer

```
$ composer require kevinkiel/wp-yaml-loader

```

Usage wp-config.php (PHP)
-------------------------

[](#usage-wp-configphp-php)

```
use KevinKiel\Yaml\Loader\YamlLoader;

$yaml = new YamlLoader;
$yaml->set_path( __DIR__ . '/../config' );
$yaml->load();

```

Config files
------------

[](#config-files)

Place the config files outside the web root so nobody can read your yml files. Single string's int's and boolean will be defined `define( 'DB_NAME', 'databasename' );`.

##### config/config.yml

[](#configconfigyml)

```
WP_ENV: development
#WP_ENV: acceptance
#WP_ENV: production
DB_NAME: databasename
DB_USER: username
DB_PASSWORD: password
DB_HOST: localhost
DB_PREFIX: wp_
DB_CHARSET: utf8
DB_COLLATE: ''
WP_DEBUG: false
WP_DEFAULT_THEME: thema
FS_METHOD: ssh2
DISALLOW_FILE_EDIT: true

```

**(SALT) **

```
AUTH_KEY:
SECURE_AUTH_KEY:
LOGGED_IN_KEY:
NONCE_KEY:
AUTH_SALT:
SECURE_AUTH_SALT:
LOGGED_IN_SALT:
NONCE_SALT:

```

#### Custom config

[](#custom-config)

If you're using custom config the data will be available as a global variable.

**Custom example (YAML).**

```
twitter:
    oauth_access_token: [key]
    oauth_access_token_secret: [key]
    consumer_key: [key]
    consumer_secret: [key]

```

**Retrieve the custom config (PHP).**

```
global $config;
$twitter_auth = $config['twitter'];

/* oauth_access_token */
$oauth_access_token = $config['twitter']['oauth_access_token'];

```

OTAP
----

[](#otap)

If you're using more then one environment. You can import / overwrite your config settings with your environment setting. Make sure you set your environment in config.yml with the 'WP\_ENV' parameter.

##### config/config\_development.yml

[](#configconfig_developmentyml)

```
DB_NAME: development_databasename
DB_USER: development_username
DB_PASSWORD: development_password
WP_DEBUG: true
SAVEQUERIES: true
CONCATENATE_SCRIPTS: false
FS_METHOD: direct
EMPTY_TRASH_DAYS: 0

```

##### config/config\_acceptance.yml

[](#configconfig_acceptanceyml)

```
DB_NAME: acceptance_databasename
DB_USER: acceptance_username
DB_PASSWORD: acceptance_password

```

##### config/config\_production.yml

[](#configconfig_productionyml)

```
DB_NAME: production_databasename
DB_USER: production_username
DB_PASSWORD: production_password

```

Credits
-------

[](#credits)

- [Kevin Kiel](https://github.com/kevinkiel)

License
-------

[](#license)

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

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity67

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

Total

5

Last Release

4071d ago

### Community

Maintainers

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

---

Top Contributors

[![kevinkiel](https://avatars.githubusercontent.com/u/531113?v=4)](https://github.com/kevinkiel "kevinkiel (10 commits)")

---

Tags

wordpressyamlwp

### Embed Badge

![Health badge](/badges/kevinkiel-wp-yaml-loader/health.svg)

```
[![Health](https://phpackages.com/badges/kevinkiel-wp-yaml-loader/health.svg)](https://phpackages.com/packages/kevinkiel-wp-yaml-loader)
```

###  Alternatives

[sspooky13/yaml-standards

Standards for yaml files

11518.3k3](/packages/sspooky13-yaml-standards)[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)
