Download the PHP package thecodingmachine/service-provider-bridge-bundle without Composer
On this page you can find all versions of the php package thecodingmachine/service-provider-bridge-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package service-provider-bridge-bundle
container-interop/service-provider bridge bundle
Import service-provider
as defined in container-interop
into a Symfony application.
Usage
Installation
Add TheCodingMachine\Interop\ServiceProviderBridgeBundle\InteropServiceProviderBridgeBundle
in your kernel (the app/AppKernel.php
file).
AppKernel.php
Usage using thecodingmachine/discovery
The bridge bundle will use thecodingmachine/discvoery to automatically discover the service providers of your project. If the service provider you are loading publishes itself on Discovery, then you are done. The services declared in the service provider are available in the Symfony container!
Usage using manual declaration
If the service provider you are using does not publishes itself using thecodingmachine/discovery, you will have to declare it manually in the constructor of the bundle.
AppKernel.php
Alternatively, you can also pass the service provider class name. This is interesting because the service-locator bundle will not instantiate the service provider unless it is needed for a service. You can therefore improve performances of your application.
AppKernel.php
Finally, if you need to pass parameters to the constructors of the service providers, you can do this by passing an array:
AppKernel.php
Disabling thecodingmachine/discovery
You can disable Discovery by passing false
as the second argument of the bundle:
AppKernel.php
Default aliases
By default, this package provides a CommonAliasesServiceProvider
that will create the following aliases:
logger
=>Psr\Log\LoggerInterface
cache.app
=>Psr\Cache\CacheItemPoolInterface
twig
=>Twig_Environment
This is useful because most service providers expect entries to be available by class/interface name.
All versions of service-provider-bridge-bundle with dependencies
symfony/dependency-injection Version ^2.3 | ^3.0
container-interop/service-provider Version ~0.3.0
symfony/framework-bundle Version ^2.7 | ^3.0
puli/cli Version ^1.0
puli/symfony-bundle Version ^1.0
thecodingmachine/service-provider-registry Version ^1.0
thecodingmachine/common-factories Version ^0.3.1