1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
<?php
use Illuminate\Database\Capsule\Manager as Capsule; use Illuminate\Events\Dispatcher;
global $_database; global $dbh;
$capsule = new Capsule();
$capsule->addConnection(array( 'driver' => $_database['driver'], 'host' => $_database['host'], 'database' => $_database['database'], 'username' => $_database['username'], 'password' => $_database['password'], 'charset' => $_database['charset'], 'collation' => $_database['collation'], 'prefix' => $_database['prefix'], ));
$capsule->setAsGlobal();
$capsule->setEventDispatcher(new Dispatcher());
$capsule->bootEloquent();
$dbh = $capsule->getConnection()->getPdo();
|