1 | <?php |
||
9 | class Import |
||
10 | { |
||
11 | /** |
||
12 | * Lines of config file |
||
13 | * |
||
14 | * @var array |
||
15 | */ |
||
16 | private $_lines = []; |
||
17 | |||
18 | /** |
||
19 | * Import constructor, can import file on starting |
||
20 | * |
||
21 | * @param string|null $filename |
||
22 | */ |
||
23 | public function __construct(string $filename = null) |
||
29 | |||
30 | /** |
||
31 | * Check if line is valid config line, TRUE if line is okay. |
||
32 | * If empty line or line with comment then FALSE. |
||
33 | * |
||
34 | * @param string $line |
||
35 | * |
||
36 | * @return bool |
||
37 | */ |
||
38 | private function isLine(string $line): bool |
||
47 | |||
48 | /** |
||
49 | * Read configuration file line by line |
||
50 | * |
||
51 | * @param string $filename |
||
52 | * |
||
53 | * @return array Array with count of total and read lines |
||
54 | */ |
||
55 | public function read(string $filename): array |
||
75 | |||
76 | /** |
||
77 | * Parse readed lines |
||
78 | * |
||
79 | * @return \OpenVPN\Interfaces\ConfigInterface |
||
80 | */ |
||
81 | public function parse(): ConfigInterface |
||
94 | } |
||
95 |