1 | <?php |
||
15 | class Configuration |
||
16 | { |
||
17 | /** |
||
18 | * Filename |
||
19 | * |
||
20 | * @var string |
||
21 | */ |
||
22 | private $filename; |
||
23 | |||
24 | /** |
||
25 | * Working directory |
||
26 | * |
||
27 | * @var string |
||
28 | */ |
||
29 | private $workingDirectory; |
||
30 | |||
31 | /** |
||
32 | * Path to bootstrap file. |
||
33 | * |
||
34 | * @var string |
||
35 | */ |
||
36 | private $bootstrap; |
||
37 | |||
38 | /** |
||
39 | * Verbose output |
||
40 | * |
||
41 | * @var bool |
||
42 | */ |
||
43 | private $verbose = false; |
||
44 | |||
45 | /** |
||
46 | * Use colors in output. |
||
47 | * |
||
48 | * @var bool |
||
49 | */ |
||
50 | private $colors = false; |
||
51 | |||
52 | /** |
||
53 | * Output debug information |
||
54 | * |
||
55 | * @var boolean |
||
56 | */ |
||
57 | private $debug = false; |
||
58 | |||
59 | /** |
||
60 | * Don't execute anything just pretend to |
||
61 | * |
||
62 | * @var bool |
||
63 | */ |
||
64 | private $simulate = false; |
||
65 | |||
66 | /** |
||
67 | * List of include paths |
||
68 | * |
||
69 | * @var array |
||
70 | */ |
||
71 | private $includePaths = []; |
||
72 | |||
73 | /** |
||
74 | * List of ini settings |
||
75 | * |
||
76 | * @var array |
||
77 | */ |
||
78 | private $iniSettings = []; |
||
79 | |||
80 | /** |
||
81 | * List of logger configurations |
||
82 | * |
||
83 | * @var array |
||
84 | */ |
||
85 | private $loggers = []; |
||
86 | |||
87 | /** |
||
88 | * List of backup configurations |
||
89 | * |
||
90 | * @var array |
||
91 | */ |
||
92 | 33 | private $backups = []; |
|
93 | |||
94 | 33 | /** |
|
95 | 33 | * Constructor |
|
96 | * |
||
97 | * @param string $wd |
||
98 | */ |
||
99 | public function __construct($wd = null) |
||
103 | |||
104 | 24 | /** |
|
105 | 24 | * Filename setter. |
|
106 | 24 | * |
|
107 | * @param string $file |
||
108 | */ |
||
109 | public function setFilename($file) |
||
114 | |||
115 | 1 | /** |
|
116 | * Filename getter. |
||
117 | * |
||
118 | * @return string |
||
119 | */ |
||
120 | public function getFilename() |
||
124 | |||
125 | 1 | /** |
|
126 | 1 | * Working directory setter. |
|
127 | * |
||
128 | * @param string $wd |
||
129 | */ |
||
130 | public function setWorkingDirectory($wd) |
||
134 | |||
135 | 2 | /** |
|
136 | * Working directory getter. |
||
137 | * |
||
138 | * @return string |
||
139 | */ |
||
140 | public function getWorkingDirectory() |
||
144 | |||
145 | 14 | /** |
|
146 | 14 | * Bootstrap setter. |
|
147 | * |
||
148 | * @param $file |
||
149 | */ |
||
150 | public function setBootstrap($file) |
||
154 | |||
155 | 2 | /** |
|
156 | * Bootstrap getter. |
||
157 | * |
||
158 | * @return string |
||
159 | */ |
||
160 | public function getBootstrap() |
||
164 | |||
165 | 14 | /** |
|
166 | 14 | * Verbose setter. |
|
167 | * |
||
168 | * @param bool $bool |
||
169 | */ |
||
170 | public function setVerbose($bool) |
||
174 | |||
175 | 2 | /** |
|
176 | * Verbose getter. |
||
177 | * |
||
178 | * @return bool |
||
179 | */ |
||
180 | public function getVerbose() |
||
184 | |||
185 | 14 | /** |
|
186 | 14 | * Colors setter. |
|
187 | * |
||
188 | * @param bool $bool |
||
189 | */ |
||
190 | public function setColors($bool) |
||
194 | |||
195 | 2 | /** |
|
196 | * Colors getter. |
||
197 | * |
||
198 | * @return bool |
||
199 | */ |
||
200 | public function getColors() |
||
204 | |||
205 | 2 | /** |
|
206 | 2 | * Debug setter. |
|
207 | * |
||
208 | * @param bool $bool |
||
209 | */ |
||
210 | public function setDebug($bool) |
||
214 | |||
215 | 2 | /** |
|
216 | * Debug getter. |
||
217 | * |
||
218 | * @return bool |
||
219 | */ |
||
220 | public function getDebug() |
||
224 | |||
225 | 12 | /** |
|
226 | 12 | * Simulate setter. |
|
227 | * |
||
228 | * @param bool $bool |
||
229 | */ |
||
230 | public function setSimulate($bool) |
||
234 | |||
235 | 3 | /** |
|
236 | * Simulate getter. |
||
237 | * |
||
238 | * @return bool |
||
239 | */ |
||
240 | public function isSimulation() |
||
244 | 12 | ||
245 | /** |
||
246 | 12 | * Add an include_path. |
|
247 | 12 | * |
|
248 | * @param string $path |
||
249 | */ |
||
250 | public function addIncludePath($path) |
||
254 | 3 | ||
255 | /** |
||
256 | 3 | * Get the list of include path. |
|
257 | * |
||
258 | * @return array |
||
259 | */ |
||
260 | public function getIncludePaths() |
||
264 | |||
265 | /** |
||
266 | 13 | * Add a ini settings. |
|
267 | * |
||
268 | 13 | * @param string $name |
|
269 | 1 | * @param string $value |
|
270 | */ |
||
271 | 12 | public function addIniSetting($name, $value) |
|
275 | |||
276 | /** |
||
277 | * Get the list of ini settings. |
||
278 | * |
||
279 | 4 | * @return array |
|
280 | */ |
||
281 | 4 | public function getIniSettings() |
|
285 | |||
286 | /** |
||
287 | * Add a logger. |
||
288 | * This accepts valid logger configs as well as valid Listener objects. |
||
289 | 7 | * |
|
290 | * @param mixed $logger |
||
291 | 7 | * @throws \phpbu\App\Exception |
|
292 | 7 | */ |
|
293 | public function addLogger($logger) |
||
300 | |||
301 | 3 | /** |
|
302 | * Get the list of logger configurations. |
||
303 | * |
||
304 | * @return array |
||
305 | */ |
||
306 | public function getLoggers() |
||
310 | |||
311 | /** |
||
312 | * Add a Backup configuration. |
||
313 | * |
||
314 | * @param \phpbu\App\Configuration\Backup $backup |
||
315 | */ |
||
316 | public function addBackup(Configuration\Backup $backup) |
||
320 | |||
321 | /** |
||
322 | * Get the list of backup configurations. |
||
323 | * |
||
324 | * @return array |
||
325 | */ |
||
326 | public function getBackups() |
||
330 | } |
||
331 |