forked from DatabayAG/his_in_one_proxy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcmd.php
45 lines (41 loc) · 837 Bytes
/
cmd.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
41
42
43
44
45
<?php
namespace HisInOneProxy\Command;
use HisInOneProxy\System\ConsoleHandler;
require_once './libs/composer/vendor/autoload.php';
function startHandler()
{
if($_SERVER['argc'] < 2)
{
$handler = new ConsoleHandler(null, null);
$handler->printHelp();
}
else if($_SERVER['argc'] >= 2)
{
$param = null;
$func = null;
$term = null;
$year = null;
if(array_key_exists(1, $_SERVER['argv']))
{
$func = $_SERVER['argv'][1];
}
if(array_key_exists(2, $_SERVER['argv']))
{
$term = $_SERVER['argv'][2];
}
if(array_key_exists(3, $_SERVER['argv']))
{
$year = $_SERVER['argv'][3];
}
if(array_key_exists(4, $_SERVER['argv']))
{
$param = $_SERVER['argv'][4];
}
$handler = new ConsoleHandler($term, $year);
$handler->functionMap($func, $param);
}
}
if(!defined('PHPUNIT'))
{
startHandler();
}