Skip to content

Commit

Permalink
Use spot.connections if no connections are specified for a prefix
Browse files Browse the repository at this point in the history
Implementing Marc's proposal
  • Loading branch information
Dijky committed Aug 28, 2015
1 parent 9a6f169 commit 8de1468
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/Dijky/Silex/Provider/SpotServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8de1468

Please sign in to comment.