Conditions | 3 |
Paths | 3 |
Total Lines | 11 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
46 | public function loadConfig(array $config) |
||
47 | { |
||
48 | switch ($config['connection']) { |
||
49 | case 'mysql': |
||
50 | return 'mysql:host=' . $config['mysql']['host'] . ';dbname=' . $config['mysql']['database']; |
||
51 | case 'sqlite': |
||
52 | return 'sqlite:' . __DIR__ . '/database/' . $config['sqlite']['database'] . '.sqlite'; |
||
53 | default: |
||
54 | throw new Exception('Connection type not supported'); |
||
55 | } |
||
56 | } |
||
57 | } |
||
58 |