Immediate PHP statement execution in the fully initialised MediaWiki environment.
authorTim Starling <tstarling@users.mediawiki.org>
Wed, 2 Jun 2004 02:16:40 +0000 (02:16 +0000)
committerTim Starling <tstarling@users.mediawiki.org>
Wed, 2 Jun 2004 02:16:40 +0000 (02:16 +0000)
maintenance/eval.php [new file with mode: 0755]

diff --git a/maintenance/eval.php b/maintenance/eval.php
new file mode 100755 (executable)
index 0000000..76518f0
--- /dev/null
@@ -0,0 +1,32 @@
+<?php
+/*require_once( "../includes/DefaultSettings.php" );
+require_once( "../LocalSettings.php" );
+require_once( "../includes/MemCachedClient.inc.php" );*/
+
+
+require_once( "liveCmdLine.inc" );
+
+do {
+       $line = readconsole( "> " );
+       eval( $line );
+       if ( function_exists( "readline_add_history" ) ) {
+               readline_add_history( $line );
+       }
+} while ( 1 );
+
+function readconsole( $prompt = "" ) {
+       if ( function_exists( "readline" ) ) {
+               return readline( $prompt );
+       } else {
+               print $prompt;
+               $fp = fopen( "php://stdin", "r" );
+               $resp = trim( fgets( $fp, 1024 ) );
+               fclose( $fp );
+               return $resp;
+       }
+}
+
+
+
+?>
+