Add color to the output; assumes a more or less ANSI-flavored terminal.
[lhc/web/wiklou.git] / maintenance / eval.php
index 5ba2f04..c53da36 100755 (executable)
@@ -1,32 +1,22 @@
 <?php
-/*require_once( "../includes/DefaultSettings.php" );
-require_once( "../LocalSettings.php" );
-require_once( "../includes/MemCachedClient.inc.php" );*/
+/**
+ * @todo document
+ * @package MediaWiki
+ * @subpackage Maintenance
+ */
 
-
-require_once( "liveCmdLine.inc" );
+/** */
+require_once( "commandLine.inc" );
 
 do {
-       $line = readconsole( "> " ). ";" ;
-       eval( $line );
+       $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;
-       }
-}
 
 
 
 ?>
-