r108770 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r108769‎ | r108770 | r108771 >
Date:22:14, 12 January 2012
Author:reedy
Status:ok
Tags:
Comment:
Fix typo in SpecialVersion

Change require to require_once in commandLine.inc

Make eval.php require an absolute path rather than just one in itself

Simplify if statement
Modified paths:
  • /trunk/phase3/includes/specials/SpecialVersion.php (modified) (history)
  • /trunk/phase3/maintenance/commandLine.inc (modified) (history)
  • /trunk/phase3/maintenance/eval.php (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/commandLine.inc
@@ -21,7 +21,7 @@
2222 * @ingroup Maintenance
2323 */
2424
25 -require( dirname( __FILE__ ) . '/Maintenance.php' );
 25+require_once( dirname( __FILE__ ) . '/Maintenance.php' );
2626
2727 global $optionsWithArgs;
2828 if ( !isset( $optionsWithArgs ) ) {
Index: trunk/phase3/maintenance/eval.php
@@ -34,7 +34,7 @@
3535 $optionsWithArgs = array( 'd' );
3636
3737 /** */
38 -require_once( "commandLine.inc" );
 38+require_once( dirname( __FILE__ ) . "/commandLine.inc" );
3939
4040 if ( isset( $options['d'] ) ) {
4141 $d = $options['d'];
@@ -55,13 +55,8 @@
5656 }
5757 }
5858
59 -if ( function_exists( 'readline_add_history' )
60 - && Maintenance::posix_isatty( 0 /*STDIN*/ ) )
61 -{
62 - $useReadline = true;
63 -} else {
64 - $useReadline = false;
65 -}
 59+$useReadline = function_exists( 'readline_add_history' )
 60+ && Maintenance::posix_isatty( 0 /*STDIN*/ );
6661
6762 if ( $useReadline ) {
6863 $historyFile = isset( $_ENV['HOME'] ) ?
Index: trunk/phase3/includes/specials/SpecialVersion.php
@@ -368,7 +368,7 @@
369369 }
370370
371371 /**
372 - * Creates and formats the creidts for a single extension and returns this.
 372+ * Creates and formats the credits for a single extension and returns this.
373373 *
374374 * @param $extension Array
375375 *

Status & tagging log