From 8de146822a40f8fad972e3d25b90d63fd937cf60 Mon Sep 17 00:00:00 2001 From: "Lukas S." Date: Fri, 28 Aug 2015 20:37:43 +0200 Subject: [PATCH] Use spot.connections if no connections are specified for a prefix Implementing Marc's proposal --- src/Dijky/Silex/Provider/SpotServiceProvider.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Dijky/Silex/Provider/SpotServiceProvider.php b/src/Dijky/Silex/Provider/SpotServiceProvider.php index 747036c..17b419d 100644 --- a/src/Dijky/Silex/Provider/SpotServiceProvider.php +++ b/src/Dijky/Silex/Provider/SpotServiceProvider.php @@ -37,7 +37,14 @@ public function register(Application $app) $app[$servicePrefix . 'spot.config'] = $app->share(function() use ($app, $servicePrefix) { $config = new Spot\Config(); - $connections = $app[$servicePrefix . 'spot.connections']; + if (isset($app[$servicePrefix . 'spot.connections'])) + { + $connections = $app[$servicePrefix . 'spot.connections']; + } + else + { + $connections = $app['spot.connections']; + } // foreach does not work with a Pimple container // like the one exposed by DoctrineServiceProvider