Completed
Push — master ( 4dc03d...bf54d1 )
by Gregory
22:33
created

Config   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
c 1
b 0
f 0
lcom 0
cbo 0
dl 0
loc 23
ccs 0
cts 10
cp 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 13 3
1
<?php
2
namespace Tivnet\WPDB;
3
4
/**
5
 * Class Config
6
 * @package Tivnet\WPDB
7
 */
8
class Config {
9
	public static $dir_dump = 'dbdump-data';
10
	public static $dump_ext = 'sql';
11
	public static $cmd_ls = 'ls -o --time-style long-iso';
12
13
	/**
14
	 * Config constructor.
15
	 */
16
	public function __construct() {
17
		$config = array();
18
19
		$file_config = getcwd() . '/.wpdb.json';
20
		if ( is_readable( $file_config ) ) {
21
			$config = json_decode( file_get_contents( $file_config ), JSON_OBJECT_AS_ARRAY );
22
		}
23
24
		if ( ! empty( $config['dir_dump'] ) ) {
25
			self::$dir_dump = $config['dir_dump'];
26
		}
27
28
	}
29
30
}
31