-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathexample.php
More file actions
51 lines (34 loc) · 774 Bytes
/
example.php
File metadata and controls
51 lines (34 loc) · 774 Bytes
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
51
<?php
include 'lib/Cmd.php';
class SubCmdTest extends Cmd {
private $command_list = array('subcmd');
public function get_command_list() {
return $this->command_list;
}
public function do_subcmd() {
$args = func_get_args();
print_r($args);
}
}
class CmdTest extends Cmd {
private $command_list = array('testcmd', 'hello');
public function get_command_list() {
return $this->command_list;
}
public function do_hello() {
$args = func_get_args();
print "World!\n";
}
public function help_hello() {
print "Print 'World!'\n";
}
public function do_testcmd() {
$args = func_get_args();
$subc = new SubCmdTest;
$subc->set_prompt($this->get_prompt() . ":testcmd");
$subc->commandloop();
}
}
$c = new CmdTest;
$c->commandloop();
?>