Minion_Database   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 4
dl 0
loc 19
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A db_params() 0 16 3
1
<?php defined('SYSPATH') OR die('No direct script access.');
2
3
abstract class Minion_Database extends Minion_Task {
4
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