remove junk function I gave up on -- no clear way to get unbuffered reads from termin...
authorBrion Vibber <brion@users.mediawiki.org>
Wed, 5 Aug 2009 02:59:32 +0000 (02:59 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Wed, 5 Aug 2009 02:59:32 +0000 (02:59 +0000)
install-utils.inc

index 78a33b2..01f8319 100644 (file)
@@ -139,43 +139,6 @@ function readlineEmulation( $prompt ) {
        return fgets(STDIN, 1024);
 }
 
-function readlineEmulationX() {
-       // Yes this is GODAWFUL. But it's better than nothing.
-       $chars = array();
-       while( true ) {
-               if( feof( STDIN ) ) {
-                       // ctrl+D?
-                       echo "[eof]";
-                       break;
-               }
-               $inchar = fread( STDIN, 1 );
-               
-               // Horrible hack... assume input is UTF-8
-               $inbyte = ord( $inchar );
-               if( $inbyte >= 0xf0 ) {
-                       $remaining = 3;
-               } elseif( $inbyte >= 0xe0 ) {
-                       $remaining = 2;
-               } elseif( $inbyte >= 0xc0 ) {
-                       $remaining = 1;
-               } else {
-                       $remaining = 0;
-               }
-               if( $remaining ) {
-                       $inchar .= fread( STDIN, $remaining );
-               }
-               
-               if( $inchar == "\n" ) {
-                       // newline
-                       echo "[newline]";
-                       break;
-               }
-               
-               $chars[] = $inchar;
-               echo "[char: $inchar]";
-       }
-       return implode( '', $chars );
-}
 
 #
 # Read and execute SQL commands from a file