Use mrjgreen/database with gluephp/glue
Use Composer:
$ composer require gluephp/glue-database
$app = new Glue\App;
$app->config->override([
'database' => [
'driver' => 'mysql',
'host' => 'localhost',
'username' => 'root',
'password' => 'password',
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
]
]);
More configuration options can be found at https://github.com/mrjgreen/database
$app->register(
new Glue\Database\ServiceProvider()
);
Once the service provider is registered, you can fetch the Whoops instance with:
$db = $app->make('Database\Connection');
or use the alias:
$db = $app->db;