PHPackages                             opensourcerefinery/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. [PSR &amp; Standards](/categories/psr-standards)
4. /
5. opensourcerefinery/yaml2pimple

ActiveLibrary[PSR &amp; Standards](/categories/psr-standards)

opensourcerefinery/yaml2pimple
==============================

Build a Pimple/Container from a config file

2.0.1(6y ago)118.0k↓50%MITPHP

Since Mar 19Pushed 6y ago1 watchersCompare

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

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

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

[](#pimplecontainer-builder)

[![Build Status](https://camo.githubusercontent.com/c4d14cc705b2be3971fe540f2bd7ef3e7bf5939d29ba281a21e1542f7e1e91d8/68747470733a2f2f7472617669732d63692e6f72672f6f70656e736f75726365726566696e6572792f796d6c3270696d706c652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/opensourcerefinery/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 OpenSourceRefinery\Yaml2Pimple\ContainerBuilder;
use OpenSourceRefinery\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();
```

License
-------

[](#license)

Yaml2Pimple is licensed under the MIT license.

Change Log
----------

[](#change-log)

### 1.1.0

[](#110)

- We have a license. Pulled from the original -

### 1.0.0

[](#100)

- Just because its needed

### 0.1.1 Forked from opensourcerefinery/yml2pimple

[](#011-forked-from-opensourcerefineryyml2pimple)

Added the pimple container as the last argument

### 0.1.0 Forked from opensourcerefinery/yml2pimple

[](#010-forked-from-opensourcerefineryyml2pimple)

Creating a release to have a stable version.

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity25

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 53.5% 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 ~327 days

Recently: every ~400 days

Total

6

Last Release

2441d ago

Major Versions

0.1.1 → 1.0.02016-12-15

1.1.0 → 2.0.02017-05-08

### Community

Maintainers

![](https://www.gravatar.com/avatar/1e0a3fac1fa53e5c17a6d6fddb4f3f805c420ff8d5ba9490ff76b6be615c62e1?d=identicon)[mkoert](/maintainers/mkoert)

![](https://www.gravatar.com/avatar/215f1611c7a739f97dceb85786dcc59b87dc4256cd22862ffd0c05fe5faee87d?d=identicon)[tomfordweb](/maintainers/tomfordweb)

---

Top Contributors

[![gonzalo123](https://avatars.githubusercontent.com/u/39072?v=4)](https://github.com/gonzalo123 "gonzalo123 (23 commits)")[![dc-mkoert](https://avatars.githubusercontent.com/u/62149338?v=4)](https://github.com/dc-mkoert "dc-mkoert (10 commits)")[![cordoval](https://avatars.githubusercontent.com/u/328359?v=4)](https://github.com/cordoval "cordoval (5 commits)")[![mkoert](https://avatars.githubusercontent.com/u/307702?v=4)](https://github.com/mkoert "mkoert (5 commits)")

---

Tags

containerdependency-injectionpimple

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[php-di/php-di

The dependency injection container for humans

2.8k48.9M994](/packages/php-di-php-di)[mrclay/props-dic

Props is a simple DI container that allows retrieving values via custom property and method names

3611.7M3](/packages/mrclay-props-dic)

PHPackages © 2026

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