Commit | Line | Data |
---|---|---|
8de51304 H |
1 | <?php\r |
2 | \r | |
3 | if(!isset($__PHP_SHELL__) || $$__PHP_SHELL__ != true) {\r | |
4 | $__PHP_SHELL__ = true;\r | |
5 | \r | |
6 | //READLINE Function\r | |
7 | $__STDIN__ = fopen("php://stdin", "rb");\r | |
8 | function readline($prompt="") {\r | |
9 | echo $prompt;\r | |
10 | return fgets($GLOBALS["__STDIN__"]);\r | |
11 | }\r | |
12 | //READLINE End\r | |
13 | \r | |
14 | }\r | |
15 | \r | |
16 | ///CODE/////////////////////////////////////////////////\r | |
17 | \r | |
18 | if($argc > 1) {\r | |
19 | array_shift($argv);\r | |
20 | //print_r($argv); //Debug\r | |
21 | include($argv[0]);\r | |
22 | die();\r | |
23 | }\r | |
24 | \r | |
25 | echo (\r | |
26 | "PHP CONSOLE\n"\r | |
27 | ."Coded: Harvie 2oo7\n"\r | |
28 | ."Version: 0.3\n"\r | |
29 | ."--------------------------\n"\r | |
30 | );\r | |
31 | \r | |
32 | //$loop = 1;\r | |
33 | $__prompt__ = "\n> ";\r | |
34 | while(1) {\r | |
35 | eval(readline($__prompt__));\r | |
36 | }\r | |
37 | \r | |
38 | ?>\r |