| Conditions | 1 |
| Paths | 1 |
| Total Lines | 16 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 2 |
| Changes | 4 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php namespace Bosnadev\Database; |
||
| 17 | public function register() |
||
| 18 | { |
||
| 19 | // The connection factory is used to create the actual connection instances on |
||
| 20 | // the database. We will inject the factory into the manager so that it may |
||
| 21 | // make the connections while they are actually needed and not of before. |
||
| 22 | $this->app->singleton('db.factory', function ($app) { |
||
| 23 | return new ConnectionFactory($app); |
||
| 24 | }); |
||
| 25 | |||
| 26 | // The database manager is used to resolve various connections, since multiple |
||
| 27 | // connections might be managed. It also implements the connection resolver |
||
| 28 | // interface which may be used by other components requiring connections. |
||
| 29 | $this->app->singleton('db', function ($app) { |
||
| 30 | return new DatabaseManager($app, $app['db.factory']); |
||
| 31 | }); |
||
| 32 | } |
||
| 33 | } |
||
| 34 |