-
Notifications
You must be signed in to change notification settings - Fork 0
/
phpdfm.php
40 lines (35 loc) · 1.12 KB
/
phpdfm.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
39
40
#! /bin/php
<?php
$config = parse_ini_file('config.ini', true);
include $config['locations']['aadm'].'/src/Check.php';
include $config['locations']['aadm'].'/src/Create.php';
include $config['locations']['aadm'].'/src/Message.php';
include $config['locations']['aadm'].'/src/Execute.php';
include $config['locations']['aadm'].'/src/Git.php';
include $config['locations']['aadm'].'/src/System.php';
$dotfileRepositoryDestination = $config['locations']['dotfilesDir'];
$configFileDestination = $dotfileRepositoryDestination.'/'.$config['locations']['json'];
$data = Create::arrayFromJson($configFileDestination);
if (!Check::isJson($data)) {
Message::invalidJson($data);
}
if (!empty($argv[1])) {
if (Check::isValidArgument($argv[1])) {
Execute::run(
$argv[1],
$dotfileRepositoryDestination,
$data,
$config['executables']['installation']
);
} else {
Message::invalidArgument($argv[1]);
}
} else {
Execute::run(
'update',
$dotfileRepositoryDestination,
$data,
$config['executables']['installation']
);
exit;
}