diff --git a/composer.json b/composer.json index 23def88..c1306e4 100644 --- a/composer.json +++ b/composer.json @@ -44,6 +44,7 @@ "require-dev": { "composer/composer": "^1.5.2", "filp/whoops": "^2.1.12", + "jsoumelidis/zend-sf-di-config": "^0.1", "mikey179/vfsstream": "^1.6.5", "northwoods/container": "^1.2", "phpunit/phpunit": "^5.7.23 || ^6.4.3", diff --git a/src/ExpressiveInstaller/OptionalPackages.php b/src/ExpressiveInstaller/OptionalPackages.php index 515adcb..3f26021 100644 --- a/src/ExpressiveInstaller/OptionalPackages.php +++ b/src/ExpressiveInstaller/OptionalPackages.php @@ -103,6 +103,7 @@ class OptionalPackages private $devDependencies = [ 'composer/composer', 'filp/whoops', + 'jsoumelidis/zend-sf-di-config', 'mikey179/vfsstream', 'northwoods/container', 'zendframework/zend-auradi-config', diff --git a/src/ExpressiveInstaller/Resources/config/container-sf-di.php b/src/ExpressiveInstaller/Resources/config/container-sf-di.php new file mode 100644 index 0000000..0710bbd --- /dev/null +++ b/src/ExpressiveInstaller/Resources/config/container-sf-di.php @@ -0,0 +1,9 @@ + true, + 'sf-container.cache_file' => __DIR__ . '/../../data/sf-container-cache.php', + //Other useful options + /* + 'sf-container.cache_class' => + 'CustomClassName', The class name of the cached container + 'sf-container.cache_class_ns' => + 'CustomClassNamespace', The namespace of the cached container + 'sf-container.cache_base_class' => + 'Container', The base class that the cached container will extend + */ +]; diff --git a/src/ExpressiveInstaller/config.php b/src/ExpressiveInstaller/config.php index 10e759f..9ee7bba 100644 --- a/src/ExpressiveInstaller/config.php +++ b/src/ExpressiveInstaller/config.php @@ -3,6 +3,7 @@ return [ 'packages' => [ 'filp/whoops' => '^2.1.12', + 'jsoumelidis/zend-sf-di-config' => '^0.1', 'northwoods/container' => '^1.2', 'zendframework/zend-auradi-config' => '^0.2', 'zendframework/zend-expressive-aurarouter' => '^2.0', @@ -105,6 +106,21 @@ 'Resources/config/container-auryn.php' => 'config/container.php', ], ], + 5 => [ + 'name' => 'Symfony DI Container', + 'packages' => [ + 'jsoumelidis/zend-sf-di-config', + ], + 'flat' => [ + 'Resources/config/container-sf-di.php' => 'config/container.php', + ], + 'modular' => [ + 'Resources/config/container-sf-di.php' => 'config/container.php', + ], + 'minimal' => [ + 'Resources/config/container-sf-di.php' => 'config/container.php', + ], + ], ], ], diff --git a/test/ExpressiveInstallerTest/ContainersTest.php b/test/ExpressiveInstallerTest/ContainersTest.php index 9264360..a1ee7f8 100644 --- a/test/ExpressiveInstallerTest/ContainersTest.php +++ b/test/ExpressiveInstallerTest/ContainersTest.php @@ -12,6 +12,7 @@ use Northwoods\Container\InjectorContainer as AurynContainer; use Pimple\Psr11\Container as PimpleContainer; use Psr\Container\ContainerInterface; +use Symfony\Component\DependencyInjection\ContainerBuilder as SfContainerBuilder; use Zend\Expressive; use Zend\ServiceManager\ServiceManager as ZendServiceManagerContainer; @@ -108,6 +109,9 @@ public function containerProvider() 'auryn-minimal' => [OptionalPackages::INSTALL_MINIMAL, 4, 2, 'minimal-files', 404, AurynContainer::class], 'auryn-flat' => [OptionalPackages::INSTALL_FLAT, 4, 2, 'copy-files', 200, AurynContainer::class], 'auryn-modular' => [OptionalPackages::INSTALL_MODULAR, 4, 2, 'copy-files', 200, AurynContainer::class], + 'sf-di-minimal' => [OptionalPackages::INSTALL_MINIMAL, 4, 2, 'minimal-files', 404, SfContainerBuilder::class], + 'sf-di-flat' => [OptionalPackages::INSTALL_FLAT, 4, 2, 'copy-files', 200, SfContainerBuilder::class], + 'sf-di-modular' => [OptionalPackages::INSTALL_MODULAR, 4, 2, 'copy-files', 200, SfContainerBuilder::class], ]; // @codingStandardsIgnoreEnd }