| Conditions | 2 |
| Paths | 2 |
| Total Lines | 13 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 13 | final public static function dsn(Configuration $configuration) |
||
| 14 | { |
||
| 15 | $dbname = $configuration->get('MYSQL', 'DBNAME'); |
||
| 16 | $host = $configuration->get('MYSQL', 'HOST'); |
||
| 17 | $port = $configuration->get('MYSQL', 'PORT'); |
||
| 18 | $charset = $configuration->get('MYSQL', 'CHARSET'); |
||
| 19 | $socket = $configuration->get('MYSQL', 'SOCKET'); |
||
| 20 | |||
| 21 | if (!empty($socket)) |
||
| 22 | { |
||
| 23 | return "mysql:dbname={$dbname};unix_socket{$socket};charset={$charset}"; |
||
| 24 | } |
||
| 25 | return "mysql:dbname={$dbname};host={$host};port={$port};charset={$charset}"; |
||
| 26 | } |
||
| 29 |