-
Notifications
You must be signed in to change notification settings - Fork 17
/
esupdater.php
37 lines (34 loc) · 872 Bytes
/
esupdater.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
<?php
/**
* The main file of esupdater.
*
* @author wgrape <https://github.com/WGrape>
* @license https://github.com/WGrape/esupdater/blob/master/LICENSE MIT Licence
*/
include_once 'bootstrap.php';
$command = strtolower(isset($argv[1]) ? $argv[1] : '');
if (empty($command)) {
echo "Command empty!\n";
return;
}
$manager = new \framework\Manager();
switch ($command) {
case "start":
$manager->commandStart();
break;
case "stop":
$success = $manager->commandStop();
echo "{$success}\n";
break;
case "work":
$canalData = isset($argv[2]) ? $argv[2] : "";
if (empty($canalData)) {
return;
}
$success = $manager->commandWork($canalData);
echo "{$success}\n";
break;
default:
echo "Not support command: {$command}\n";
return;
}