Fix typo in SpecialVersion
authorSam Reed <reedy@users.mediawiki.org>
Thu, 12 Jan 2012 22:14:56 +0000 (22:14 +0000)
committerSam Reed <reedy@users.mediawiki.org>
Thu, 12 Jan 2012 22:14:56 +0000 (22:14 +0000)
Change require to require_once in commandLine.inc

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

Simplify if statement

includes/specials/SpecialVersion.php
maintenance/commandLine.inc
maintenance/eval.php

index 92e4340..8185fe8 100644 (file)
@@ -368,7 +368,7 @@ class SpecialVersion extends SpecialPage {
        }
 
        /**
-        * Creates and formats the creidts for a single extension and returns this.
+        * Creates and formats the credits for a single extension and returns this.
         *
         * @param $extension Array
         *
index 4b6422a..c7adbfb 100644 (file)
@@ -21,7 +21,7 @@
  * @ingroup Maintenance
  */
 
-require( dirname( __FILE__ ) . '/Maintenance.php' );
+require_once( dirname( __FILE__ ) . '/Maintenance.php' );
 
 global $optionsWithArgs;
 if ( !isset( $optionsWithArgs ) ) {
index 9ad51bb..3bd164f 100644 (file)
@@ -34,7 +34,7 @@
 $optionsWithArgs = array( 'd' );
 
 /** */
-require_once( "commandLine.inc" );
+require_once( dirname( __FILE__ ) . "/commandLine.inc" );
 
 if ( isset( $options['d'] ) ) {
        $d = $options['d'];
@@ -55,13 +55,8 @@ if ( isset( $options['d'] ) ) {
        }
 }
 
-if ( function_exists( 'readline_add_history' )
-       && Maintenance::posix_isatty( 0 /*STDIN*/ ) )
-{
-       $useReadline = true;
-} else {
-       $useReadline = false;
-}
+$useReadline = function_exists( 'readline_add_history' )
+                       && Maintenance::posix_isatty( 0 /*STDIN*/ );
 
 if ( $useReadline ) {
        $historyFile = isset( $_ENV['HOME'] ) ?