3 class PHP_Shell_Extensions_LoadScript implements PHP_Shell_Extension {
4 public function register() {
5 $cmd = PHP_Shell_Commands::getInstance();
7 $cmd->registerCommand('#^r #', $this, 'cmdLoadScript', 'r <filename>',
8 'load a php-script and execute each line');
12 public function cmdLoadScript($l) {
15 if (file_exists($l)) {
20 foreach ($content as $line) {
23 if (preg_match('#^<\?php#', $line)) continue;