Conditions | 2 |
Paths | 2 |
Total Lines | 16 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 2 | ||
Bugs | 1 | Features | 0 |
1 | <?php |
||
18 | public function __construct($connectionName = 'default') |
||
19 | { |
||
20 | $connections = Configuration::getInstance()->get('connections'); |
||
21 | |||
22 | if (!array_key_exists($connectionName, $connections)) { |
||
23 | throw new Exception("Connection '$connectionName' is not found in .settings.php"); |
||
24 | } |
||
25 | |||
26 | $connection = $connections[$connectionName]; |
||
27 | |||
28 | parent::__construct( |
||
29 | "mysql:dbname={$connection['database']};host={$connection['host']}", |
||
30 | $connection['login'], |
||
31 | $connection['password'] |
||
32 | ); |
||
33 | } |
||
34 | } |
||
35 |