1 | <?php |
||
8 | class Config |
||
9 | { |
||
10 | private static $defaultConfig = array( |
||
11 | 'transmission' => [ |
||
12 | [ |
||
13 | 'host' => 'localhost', |
||
14 | 'port' => 9091, |
||
15 | 'user' => '', |
||
16 | 'password' => '', |
||
17 | ], |
||
18 | ], |
||
19 | |||
20 | 'influxdb-host' => 'localhost', |
||
21 | 'influxdb-port' => 8086, |
||
22 | 'influxdb-database' => 'transmission', |
||
23 | 'influxdb-user' => '', |
||
24 | 'influxdb-password' => '', |
||
25 | |||
26 | 'download-torrents-dir' => '', |
||
27 | 'download-imdb-min' => '8.0', |
||
28 | 'download-kinopoisk-min' => '8.0', |
||
29 | 'download-comments-min' => 10, |
||
30 | 'download-votes-min' => 25, |
||
31 | |||
32 | 'download-filename-whitelist' => [], |
||
33 | 'download-filename-blacklist' => [], |
||
34 | |||
35 | 'weburg-series-list' => [], |
||
36 | 'weburg-series-max-age' => 1, |
||
37 | 'weburg-series-allowed-misses' => 1, |
||
38 | 'weburg-request-delay' => 2, |
||
39 | ); |
||
40 | |||
41 | private $config; |
||
42 | private $configFile; |
||
43 | |||
44 | public function __construct($configFile = null) |
||
53 | |||
54 | public function loadConfigFile() |
||
69 | |||
70 | public function saveConfigFile() |
||
75 | |||
76 | public function get($key) |
||
83 | |||
84 | public function set($key, $value) |
||
88 | |||
89 | public function overrideConfig(InputInterface $input, $optionName, $configName = null) |
||
102 | |||
103 | public static function getHomeDir() |
||
119 | } |
||
120 |