2017 © Pedro Peláez
 

library sf-dependency-injection-bridge

Symfony dependency injection bridge into ZF2

image

cdx/sf-dependency-injection-bridge

Symfony dependency injection bridge into ZF2

  • Friday, July 10, 2015
  • by CDaigneaux
  • Repository
  • 1 Watchers
  • 0 Stars
  • 4 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Sf Dependency Injection Bridge

Build Status, (*1)

Zf2 module to use Symfony Dependency Injection (symfony/dependency-injection)., (*2)

Requirements

Please see the composer.json file., (*3)

Installation

You can install using:, (*4)

curl -s https://getcomposer.org/installer | php
php composer.phar install

You can import the sf-dependency-injection-bridge module into an existing application by adding cdx/sf-dependency-injection-bridge to your composer.json "require" section. You should also add the module to your application's configuration:, (*5)

'modules' => array (
    /* ... */
    'Cdx\SfDependencyInjectionBridge',
),

Configuration

This module load each module configuration files to search the sf_dependency_injection_bridge key. To add an dependency you should set in the module configuration file:, (*6)

return array (
    'router' => /* ... */
    'service_manager' => /* ... */
    /* ... */
    'sf_dependency_injection_bridge' => [
        'config_files' => [
            __DIR__ . '/services.yml',
            /* ... */
        ],
        'service_locator_mapping' => [
            'Doctrine\\ORM\\EntityManager' => 'Doctrine\\ORM\\EntityManager',
            /* ... */
        ]
    ],

You can specify any service loaded in service locator to set them onto the ContainerBuilder of Symfony. Moreover, you can load any file you want in Yaml format to load services onto it too., (*7)

See documentation of Symfony Dependency Injection., (*8)

The Versions