2017 © Pedro Peláez
 

symfony-bundle di-configuration-bundle

Override Symfony service definition configuration with ease

image

xabbuh/di-configuration-bundle

Override Symfony service definition configuration with ease

  • Monday, May 4, 2015
  • by xabbuh
  • Repository
  • 1 Watchers
  • 0 Stars
  • 3 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Symfony Dependency Injection Configuration Bundle

This bundle makes it possible to easily customise existing service definitions defined in third-party bundles., (*1)

Note: Many bundles offer their own configuration options to customise how their services are configured. Please refer to their documentation first for available configuration options before using this bundle., (*2)

Installation

Use Composer to install the bundle:, (*3)

$ composer require xabbuh/di-configuration-bundle

Then, enable it in your application:, (*4)

// app/AppKernel.php
// ...

public function registerBundles()
{
    $bundles = array(
        // ...
        new Xabbuh\DiConfigurationBundle\XabbuhDiConfigurationBundle(),
    );

    // ...

    return $bundles;
}

Configuration

Note: You can only change the configuration of existing services. The bundle is not meant to be used to configure new services. If you want to add your own services use [the built-in Symfony configuration mechanisms][2]., (*5)

Customize Service Definitions

Change the class name of a service:, (*6)

xabbuh_di_configuration:
    logger:
        class: app.logger

If you do not want to configure any other options of a particular service, you can omit the class key:, (*7)

xabbuh_di_configuration:
    monolog.logger: app.logger

You can replace existing arguments using the arguments key. A reference to another service needs to be the service id prefixed with the @ character:, (*8)

xabbuh_di_configuration:
    locale_listener:
        arguments:
            - de
            - @app.router

You can use the index key for an argument if you do not want to replace all arguments, but want to skip some of them. The following example only replaces the first and the third argument of the locale_listener service, but leaves the second argument as is:, (*9)

xabbuh_di_configuration:
    locale_listener:
        arguments:
            - de
            - index: 2
              value: @app.request_stack

The Versions

04/05 2015

dev-master

9999999-dev https://github.com/xabbuh/DIConfigurationBundle

Override Symfony service definition configuration with ease

  Sources   Download

MIT

The Requires

 

The Development Requires

dependency injection configuration symfony service container di customization customisation

03/05 2015

v0.1.0

0.1.0.0 https://github.com/xabbuh/DIConfigurationBundle

Override Symfony service definition configuration with ease

  Sources   Download

MIT

The Requires

 

The Development Requires

dependency injection configuration symfony service container di customization customisation