gluephp / glue-database
Use mrjgreen/database in Glue
0.1.0
2016-05-06 19:37 UTC
Requires
- php: >=5.5.0
- mrjgreen/database: 2.5.*
This package is not auto-updated.
Last update: 2025-01-27 08:24:38 UTC
README
Use mrjgreen/database with gluephp/glue
Installation
Use Composer:
$ composer require gluephp/glue-database
Configuration
$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
Register
$app->register( new Glue\Database\ServiceProvider() );
Get the Database Connection instance
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;