dbpatch/DbPatch — Issue #20: Support db adapter in configuration
Author: jorissteyn
Created: 2012-02-19 16:15:35+00:00
State: open

In some cases it's convenient to bootstrap the application to retrieve database settings for a project. This way you don't have to configure the database in two places.

This is how it can currently be done in DbPatch:
```php
// Retrieve write adapter
$db = $application->bootstrap(array('db'))
->getBootstrap()->getResource('db');

// Define DbPatch config
$dbPatchConfig = array(
/* .... */
'db' => array(
'adapter' => 'Mysqli',
'params' => $db->getConfig(),
)
);
```

Proposal: optional support for passing the adapter directly, without creating two adaters and possibly opening two database connections.
```php
// Define DbPatch config
$dbPatchConfig = array(
/* .... */
'db' => $bootstrap->getResource('db'),
);
```