PHPackages                             gonzalo123/yaml2pimple - 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. gonzalo123/yaml2pimple

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

gonzalo123/yaml2pimple
======================

Build a Pimple/Container from a config file

2212.2k↓33.3%7[5 issues](https://github.com/gonzalo123/yml2pimple/issues)PHP

Since Apr 23Pushed 9y ago1 watchersCompare

[ Source](https://github.com/gonzalo123/yml2pimple)[ Packagist](https://packagist.org/packages/gonzalo123/yaml2pimple)[ RSS](/packages/gonzalo123-yaml2pimple/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Pimple/Container builder
========================

[](#pimplecontainer-builder)

[![Build Status](https://camo.githubusercontent.com/398ed5442ee32774664a1e7437daa8b8005469c4dbeb9d9c23177776aa327e27/68747470733a2f2f7472617669732d63692e6f72672f676f6e7a616c6f3132332f796d6c3270696d706c652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/gonzalo123/yml2pimple)

Simple tool build pimple containers from a configuration file

Imagine this simple application:

```
use Pimple\Container;

$container         = new Container();
$container['name'] = 'Gonzalo';

$container['Curl']  = function () {
    return new Curl();
};
$container['Proxy'] = function ($c) {
    return new Proxy($c['Curl']);
};

$container['App'] = function ($c) {
    return new App($c['Proxy'], $c['name']);
};

$app = $container['App'];
echo $app->hello();
```

We define the dependencies with code. But we want to define dependencies using a yml file for example:

```
parameters:
  name: Gonzalo

services:
  App:
    class:     App
    arguments: [@Proxy, %name%]
  Proxy:
    class:     Proxy
    arguments: [@Curl]
  Curl:
    class:     Curl

```

With this library we can create a pimple container from this yaml file (similar syntax than Symfony's Dependency Injection Container)

```
use Pimple\Container;
use G\Yaml2Pimple\ContainerBuilder;
use G\Yaml2Pimple\YamlFileLoader;
use Symfony\Component\Config\FileLocator;

$container = new Container();

$builder = new ContainerBuilder($container);
$locator = new FileLocator(__DIR__);
$loader = new YamlFileLoader($builder, $locator);
$loader->load('services.yml');

$app = $container['App'];
echo $app->hello();
```

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance15

Infrequent updates — may be unmaintained

Popularity35

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 69.2% 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.

### Community

Maintainers

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

---

Top Contributors

[![gonzalo123](https://avatars.githubusercontent.com/u/39072?v=4)](https://github.com/gonzalo123 "gonzalo123 (27 commits)")[![cordoval](https://avatars.githubusercontent.com/u/328359?v=4)](https://github.com/cordoval "cordoval (5 commits)")[![ponent](https://avatars.githubusercontent.com/u/32094089?v=4)](https://github.com/ponent "ponent (4 commits)")[![AlexStansfield](https://avatars.githubusercontent.com/u/4319443?v=4)](https://github.com/AlexStansfield "AlexStansfield (3 commits)")

### Embed Badge

![Health badge](/badges/gonzalo123-yaml2pimple/health.svg)

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

###  Alternatives

[alleyinteractive/wp-bulk-task

A library to assist with running performant bulk tasks against WordPress objects.

21326.8k4](/packages/alleyinteractive-wp-bulk-task)

PHPackages © 2026

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