diff --git a/_config.php b/_config.php index 53de22f9f..d8af1b414 100644 --- a/_config.php +++ b/_config.php @@ -28,7 +28,8 @@ Director::addRules(10, array( 'sitemap.xml' => 'GoogleSitemap', 'api/v1' => 'RestfulServer', 'soap/v1' => 'SOAPModelAccess', - 'dev' => 'DevelopmentAdmin' + 'dev' => 'DevelopmentAdmin', + 'interactive' => 'SapphireREPL', )); Director::addRules(1, array( diff --git a/dev/SapphireREPL.php b/dev/SapphireREPL.php new file mode 100644 index 000000000..bbcd2cae1 --- /dev/null +++ b/dev/SapphireREPL.php @@ -0,0 +1,23 @@ + "; + $command = trim(fgets(STDIN, 4096)); + + // Simple processing + if(substr($command,-1) == ';') $command = substr($command,0,-1); + if(!preg_match('/^return/i', $command)) $command = "return ($command)"; + $command .= ";"; + $result = eval($command); + print_r($result); + echo "\n"; + } + } +} + +?> \ No newline at end of file