forked from apinstein/iphp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
iphp_commands.php
51 lines (46 loc) · 999 Bytes
/
iphp_commands.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
46
47
48
49
50
<?php
abstract class iphp_command
{
abstract public function run($shell, $args);
abstract public function name();
public function help() { return ''; }
}
class iphp_command_help extends iphp_command
{
function run($shell, $args)
{
$shell->printHelp();
}
function name()
{
return array('help', '?');
}
function help() { return 'View a list of all installed commands.'; }
}
class iphp_command_exit extends iphp_command
{
function run($shell, $args)
{
exit(0);
}
function name()
{
return array('exit', 'die', 'bye', 'quit');
}
function help() { return 'Quit the shell.'; }
}
class iphp_command_reload extends iphp_command
{
function run($shell, $args)
{
$shell->initialize($shell->options());
}
function name()
{
return 'reload';
}
function help()
{
return "Re-initialize the iphp state so it's just as if you quit and re-started.";
}
}