-
Notifications
You must be signed in to change notification settings - Fork 3
/
cli.php
38 lines (30 loc) · 925 Bytes
/
cli.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php
$arguments = [];
foreach ($argv as $k => $arg) {
if ($k === 1) {
$arguments['classes'] = $arg;
} elseif ($k === 2) {
$arguments['path'] = $arg;
} elseif ($k === 3) {
$arguments['logfile'] = $arg;
}
}
if (empty($arguments)) {
die("Please type the conversion type, path to the directory or file and (optional) the log file to use");
}
if ($arguments['classes'] === 'v3to4') {
$classes = include_once('v3to4.php');
} else if ($arguments['classes'] === 'v4to5') {
$classes = include_once('v4to5.php');
} else if ($arguments['classes'] === 'v3to5') {
$classes = include_once('v3to5.php');
} else {
die("Conversion " . $arguments['classes'] . " not supported");
}
include_once('adviser.php');
$adviser = new Adviser(
$classes,
$arguments['path'],
$arguments['logfile'] ?? ''
);
$adviser->createLogAction();