From 9db190c7e736ec8d063187d4241b59feaf7dc2d1 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Wed, 22 Jun 2011 11:28:20 +0200 Subject: update to MediaWiki 1.17.0 --- maintenance/eval.php | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'maintenance/eval.php') diff --git a/maintenance/eval.php b/maintenance/eval.php index a990a4d8..3cc1d16a 100644 --- a/maintenance/eval.php +++ b/maintenance/eval.php @@ -16,7 +16,7 @@ * @ingroup Maintenance */ -$wgUseNormalUser = (bool)getenv('MW_WIKIUSER'); +$wgUseNormalUser = (bool)getenv( 'MW_WIKIUSER' ); $optionsWithArgs = array( 'd' ); @@ -39,8 +39,8 @@ if ( isset( $options['d'] ) ) { } } -if ( function_exists( 'readline_add_history' ) - && function_exists( 'posix_isatty' ) && posix_isatty( 0 /*STDIN*/ ) ) +if ( function_exists( 'readline_add_history' ) + && posix_isatty( 0 /*STDIN*/ ) ) { $useReadline = true; } else { @@ -48,19 +48,20 @@ if ( function_exists( 'readline_add_history' ) } if ( $useReadline ) { - $historyFile = "{$_ENV['HOME']}/.mweval_history"; + $historyFile = isset( $_ENV['HOME'] ) ? + "{$_ENV['HOME']}/.mweval_history" : "$IP/maintenance/.mweval_history"; readline_read_history( $historyFile ); } -while ( ( $line = readconsole( '> ' ) ) !== false ) { +while ( ( $line = Maintenance::readconsole() ) !== false ) { if ( $useReadline ) { readline_add_history( $line ); readline_write_history( $historyFile ); } $val = eval( $line . ";" ); - if( is_null( $val ) ) { + if ( is_null( $val ) ) { echo "\n"; - } elseif( is_string( $val ) || is_numeric( $val ) ) { + } elseif ( is_string( $val ) || is_numeric( $val ) ) { echo "$val\n"; } else { var_dump( $val ); -- cgit v1.2.2