Added lot of junk laying around on harvie.cz
[mirrors/Programs.git] / php / skripty / php_shell.php
diff --git a/php/skripty/php_shell.php b/php/skripty/php_shell.php
new file mode 100644 (file)
index 0000000..6475881
--- /dev/null
@@ -0,0 +1,38 @@
+<?php\r
+\r
+if(!isset($__PHP_SHELL__) || $$__PHP_SHELL__ != true) {\r
+  $__PHP_SHELL__ = true;\r
+\r
+  //READLINE Function\r
+  $__STDIN__ = fopen("php://stdin", "rb");\r
+  function readline($prompt="") {\r
+    echo $prompt;\r
+    return fgets($GLOBALS["__STDIN__"]);\r
+  }\r
+  //READLINE End\r
+\r
+}\r
+\r
+///CODE/////////////////////////////////////////////////\r
+\r
+if($argc > 1) {\r
+  array_shift($argv);\r
+  //print_r($argv); //Debug\r
+  include($argv[0]);\r
+  die();\r
+}\r
+\r
+echo (\r
+"PHP CONSOLE\n"\r
+."Coded: Harvie 2oo7\n"\r
+."Version: 0.3\n"\r
+."--------------------------\n"\r
+);\r
+\r
+//$loop = 1;\r
+$__prompt__ = "\n> ";\r
+while(1) {\r
+  eval(readline($__prompt__));\r
+}\r
+\r
+?>\r
This page took 0.097135 seconds and 4 git commands to generate.