|
@@ 26-36 (lines=11) @@
|
| 23 |
|
*/ |
| 24 |
|
public function register() |
| 25 |
|
{ |
| 26 |
|
$this->getContainer()->share('Database', function () { |
| 27 |
|
$config = $this->getContainer()->get('config')['database']; |
| 28 |
|
|
| 29 |
|
$pdo = new ExtendedPdo( |
| 30 |
|
"mysql:host={$config['host']};port={$config['port']};dbname={$config['schema']}", |
| 31 |
|
$config['user'], |
| 32 |
|
$config['password'] |
| 33 |
|
); |
| 34 |
|
|
| 35 |
|
return $pdo; |
| 36 |
|
}); |
| 37 |
|
|
| 38 |
|
$this->getContainer()->share('Database\Data', function () { |
| 39 |
|
$config = $this->getContainer()->get('config')['database_data']; |
|
@@ 38-48 (lines=11) @@
|
| 35 |
|
return $pdo; |
| 36 |
|
}); |
| 37 |
|
|
| 38 |
|
$this->getContainer()->share('Database\Data', function () { |
| 39 |
|
$config = $this->getContainer()->get('config')['database_data']; |
| 40 |
|
|
| 41 |
|
$pdo = new ExtendedPdo( |
| 42 |
|
"mysql:host={$config['host']};port={$config['port']};dbname={$config['schema']}", |
| 43 |
|
$config['user'], |
| 44 |
|
$config['password'] |
| 45 |
|
); |
| 46 |
|
|
| 47 |
|
return $pdo; |
| 48 |
|
}); |
| 49 |
|
|
| 50 |
|
$this->getContainer()->share('Database\Archive', function () { |
| 51 |
|
$config = $this->getContainer()->get('config')['database_archive']; |
|
@@ 50-60 (lines=11) @@
|
| 47 |
|
return $pdo; |
| 48 |
|
}); |
| 49 |
|
|
| 50 |
|
$this->getContainer()->share('Database\Archive', function () { |
| 51 |
|
$config = $this->getContainer()->get('config')['database_archive']; |
| 52 |
|
|
| 53 |
|
$pdo = new ExtendedPdo( |
| 54 |
|
"mysql:host={$config['host']};port={$config['port']};dbname={$config['schema']}", |
| 55 |
|
$config['user'], |
| 56 |
|
$config['password'] |
| 57 |
|
); |
| 58 |
|
|
| 59 |
|
return $pdo; |
| 60 |
|
}); |
| 61 |
|
|
| 62 |
|
$this->getContainer()->add('Aura\SqlQuery\QueryFactory', function () { |
| 63 |
|
return new QueryFactory('mysql'); |