aboutsummaryrefslogtreecommitdiffstats
path: root/install-utils.inc
diff options
context:
space:
mode:
Diffstat (limited to 'install-utils.inc')
-rw-r--r--install-utils.inc16
1 files changed, 10 insertions, 6 deletions
diff --git a/install-utils.inc b/install-utils.inc
index 73f4e38171a6..040c34dc8191 100644
--- a/install-utils.inc
+++ b/install-utils.inc
@@ -55,14 +55,18 @@ function copydirectory( $source, $dest ) {
}
}
-function readconsole() {
- $fp = fopen( "php://stdin", "r" );
- $resp = trim( fgets( $fp, 1024 ) );
- fclose( $fp );
- return $resp;
+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;
+ }
}
-
function replacevars( $ins ) {
$varnames = array(
"wgDBserver", "wgDBname", "wgDBintlname", "wgDBuser",