| Conditions | 3 |
| Paths | 3 |
| Total Lines | 15 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 30 | public static function getInstance(): ?PDO |
||
| 31 | { |
||
| 32 | if (empty(self::$instance)) { |
||
| 33 | try { |
||
| 34 | self::$instance = new PDO( |
||
| 35 | DLC["driver"] . ":host=" . DLC["host"] . ";dbname=" . DLC["dbname"] . ";port=" . DLC["port"], |
||
| 36 | DLC["username"], |
||
| 37 | DLC["passwd"], |
||
| 38 | DLC["options"] |
||
| 39 | ); |
||
| 40 | } catch (PDOException $exception) { |
||
| 41 | self::$error = $exception; |
||
| 42 | } |
||
| 43 | } |
||
| 44 | return self::$instance; |
||
| 45 | } |
||
| 61 | } |