Skip to content

gluephp/glue-database

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Database for Glue

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;

About

Database adapter for gluephp/glue

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages