Commit 9cf31e47 authored by Igor Wiedler's avatar Igor Wiedler Committed by Fabien Potencier

Make DoctrineServiceProvider db connection lazy

parent 7ae0fd8b
......@@ -4,7 +4,7 @@ Changelog
1.0.1 (2013-XX-XX)
------------------
* n/a
* Make ``DoctrineServiceProvider`` multi-db support lazy.
1.0.0 (2013-05-03)
------------------
......
......@@ -74,7 +74,9 @@ class DoctrineServiceProvider implements ServiceProviderInterface
$manager = $app['dbs.event_manager'][$name];
}
$dbs[$name] = DriverManager::getConnection($options, $config, $manager);
$dbs[$name] = $dbs->share(function ($dbs) use ($options, $config, $manager) {
return DriverManager::getConnection($options, $config, $manager);
});
}
return $dbs;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment