alexpts / symfony-di-loader
Simple loader for symfony DI container
6.0.2
2023-06-25 15:55 UTC
Requires
- php: >=8.1
- ext-json: *
- symfony/config: ^6.3
- symfony/dependency-injection: ^6.3
- symfony/yaml: ^6.3
Requires (Dev)
- mikey179/vfsstream: ^1.6
- phpunit/phpunit: ^10.2
README
Simple loader for symfony container DependencyInjection component
Install
composer require alexpts/symfony-di-loader
Demo
<?php use PTS\SymfonyDiLoader\LoaderContainer; $configs = [ __DIR__ . './container.yml', __DIR__ . './container.xml', __DIR__ . './container.php' ]; $fileCache = __DIR__ . '/var/di.php'; $isDebug = true; $loader = new LoaderContainer; $container = $loader->getContainer($configs, $fileCache, $isDebug);
Custom container extension:
use PTS\SymfonyDiLoader\LoaderContainer; $loader = new LoaderContainer; $builder = $loader->getBuilder(); $builder->addExtension($someContainerExtension); $container = $loader->getContainer($configs, $fileCache);