From 1e5f13b21b33b0d7ce86fe97ca145a3561433a7a Mon Sep 17 00:00:00 2001 From: wei <> Date: Mon, 18 Sep 2006 22:57:16 +0000 Subject: Add an interactive php shell that loads Prado classes. --- .../PhpShell/PHP/Shell/Extensions/LoadScript.php | 32 ++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 framework/3rdParty/PhpShell/PHP/Shell/Extensions/LoadScript.php (limited to 'framework/3rdParty/PhpShell/PHP/Shell/Extensions/LoadScript.php') diff --git a/framework/3rdParty/PhpShell/PHP/Shell/Extensions/LoadScript.php b/framework/3rdParty/PhpShell/PHP/Shell/Extensions/LoadScript.php new file mode 100644 index 00000000..a8c4697d --- /dev/null +++ b/framework/3rdParty/PhpShell/PHP/Shell/Extensions/LoadScript.php @@ -0,0 +1,32 @@ +registerCommand('#^r #', $this, 'cmdLoadScript', 'r ', + 'load a php-script and execute each line'); + + } + + public function cmdLoadScript($l) { + $l = substr($l, 2); + + if (file_exists($l)) { + $content = file($l); + + $source = array(); + + foreach ($content as $line) { + $line = chop($line); + + if (preg_match('#^<\?php#', $line)) continue; + + $source[] = $line; + } + + return $source; + } + return ""; + } +} -- cgit v1.2.3