| Conditions | 3 |
| Paths | 3 |
| Total Lines | 16 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php defined('SYSPATH') OR die('No direct script access.'); |
||
| 5 | protected function db_params($database) |
||
| 6 | { |
||
| 7 | $db = Kohana::$config->load("database.$database.connection"); |
||
| 8 | |||
| 9 | if ( ! isset($db['database']) ) |
||
| 10 | { |
||
| 11 | if ( ! preg_match('/dbname=([^;]+)/', $db['dsn'], $matches)) |
||
| 12 | throw new Kohana_Exception("Error connecting to database, database missing"); |
||
| 13 | |||
| 14 | $db['database'] = $matches[1]; |
||
| 15 | } |
||
| 16 | |||
| 17 | $db['type'] = Kohana::$config->load("database.$database.type"); |
||
| 18 | |||
| 19 | return $db; |
||
| 20 | } |
||
| 21 | } |
||
| 22 |