2017 © Pedro Peláez
 

library pimpyaml-container

A simple Pimple container configurable from yaml file, symfony's style syntax

image

mascherucci/pimpyaml-container

A simple Pimple container configurable from yaml file, symfony's style syntax

  • Saturday, March 17, 2018
  • by donkyfronky
  • Repository
  • 1 Watchers
  • 0 Stars
  • 24 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 1 Open issues
  • 8 Versions
  • 0 % Grown

The README.md

Pimpyaml is a simple configuration package for Pimple container. It implements ContainerInterface, so you can switch easly with another container, (*1)

Install

composer require mascherucci/pimpyaml-container, (*2)

Usage

You can obviously define the service in normal way or you can define with yaml config.yml file with symfony like syntax, (*3)

Defining Services

Loading config file

  $conf_file = __DIR__.'/config.yml';
  $config = \SwissArmy\ConfigHandler::loadConf($conf_file);
  $container = new \SwissArmy\SimpleContainer($config);

ConfigHandler support several imports -> resource if you want to separate domain of configuration as you can see below, (*4)

imports:
    - resource: dependency.yml
    - resource: routes.yml
customvalues:
    custom1: 1    

The Services

services:
    zone:
        class: \DateTimeZone
        arguments: ['America/Adak']
    time:
        class: \DateTime
        arguments: ['2016-01-01','@zone']
    time2
        class: \DateTime
        calls:
            - [setTimezone , ['@zone']]
    dummy
        class: \yourclass
        arguments: ['@container']
    dummy2
        class: \yourclass
        arguments: ['%custom1%']        

At moment the only markdown support, as you can see, is @object,@container(is a special word to pass the container),%yourvariable%, (*5)

The Versions

17/03 2018

dev-master

9999999-dev http://www.labcode.it

A simple Pimple container configurable from yaml file, symfony's style syntax

  Sources   Download

MIT

The Requires

 

The Development Requires

by Roberto Mascherucci

container symfony yaml pimple container-interop

03/10 2016

1.1.3

1.1.3.0 http://www.labcode.it

A simple Pimple container configurable from yaml file, symfony's style syntax

  Sources   Download

MIT

The Requires

 

The Development Requires

by Roberto Mascherucci

container symfony yaml pimple container-interop

30/09 2016

1.1.2

1.1.2.0 http://www.labcode.it

A simple Pimple container configurable from yaml file, symfony's style syntax

  Sources   Download

MIT

The Requires

 

The Development Requires

by Roberto Mascherucci

container symfony yaml pimple container-interop

10/06 2016

1.x-dev

1.9999999.9999999.9999999-dev http://www.labcode.it

A simple Pimple container configurable from yaml file, symfony's style syntax

  Sources   Download

MIT

The Requires

 

The Development Requires

by Roberto Mascherucci

container symfony yaml pimple container-interop

10/06 2016

1.1.1

1.1.1.0 http://www.labcode.it

A simple Pimple container configurable from yaml file, symfony's style syntax

  Sources   Download

MIT

The Requires

 

The Development Requires

by Roberto Mascherucci

container symfony yaml pimple container-interop

10/06 2016

dev-test

dev-test http://www.labcode.it

A simple Pimple container configurable from yaml file, symfony's style syntax

  Sources   Download

MIT

The Requires

 

The Development Requires

by Roberto Mascherucci

container symfony yaml pimple container-interop

10/06 2016

1.0

1.0.0.0 http://www.labcode.it

A simple Pimple container configurable from yaml file, symfony's style syntax

  Sources   Download

MIT

The Requires

 

The Development Requires

by Roberto Mascherucci

container symfony yaml pimple container-interop

10/06 2016

1.1

1.1.0.0 http://www.labcode.it

A simple Pimple container configurable from yaml file, symfony's style syntax

  Sources   Download

MIT

The Requires

 

The Development Requires

by Roberto Mascherucci

container symfony yaml pimple container-interop