From d3e13fc866e0dacacc0ca6b6c4345a29f961dff9 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Wed, 5 Aug 2009 02:59:32 +0000 Subject: [PATCH] remove junk function I gave up on -- no clear way to get unbuffered reads from terminal in direct PHP (and who wants to reimplement readline anyway?) --- install-utils.inc | 37 ------------------------------------- 1 file changed, 37 deletions(-) diff --git a/install-utils.inc b/install-utils.inc index 78a33b2c06..01f831918f 100644 --- a/install-utils.inc +++ b/install-utils.inc @@ -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 -- 2.20.1