* (bug 17472) use print <<<EOF in maintenance/importTextFile.php. Patch contribute...
authorSiebrand Mazeland <siebrand@users.mediawiki.org>
Sun, 15 Feb 2009 00:20:33 +0000 (00:20 +0000)
committerSiebrand Mazeland <siebrand@users.mediawiki.org>
Sun, 15 Feb 2009 00:20:33 +0000 (00:20 +0000)
* removed trailing whitespace

CREDITS
RELEASE-NOTES
maintenance/importTextFile.php

diff --git a/CREDITS b/CREDITS
index 280654c..38d1730 100644 (file)
--- a/CREDITS
+++ b/CREDITS
@@ -64,6 +64,7 @@ following names for their contribution to the product.
 * FunPika
 * Happy-melon
 * Jeremy Baron
+* Jidanni
 * Juliano F. Ravasi
 * Lucas Garczewski
 * Louperivois
index 40693b0..3f4713c 100644 (file)
@@ -170,6 +170,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * (bug 17478) Fixed a PHP Strict standards error in
   maintenance/cleanupWatchlist.php
 * (bug 17488) RSS/Atom links in left toolbar are now localized
+* (bug 17472) use print <<<EOF in maintenance/importTextFile.php
 
 == API changes in 1.15 ==
 * (bug 16858) Revamped list=deletedrevs to make listing deleted contributions
index 0a0068d..df23b1d 100644 (file)
@@ -9,7 +9,7 @@
  * @author Rob Church <robchur@gmail.com>
  */
 
-$options = array( 'help', 'nooverwrite', 'norc' ); 
+$options = array( 'help', 'nooverwrite', 'norc' );
 $optionsWithArgs = array( 'title', 'user', 'comment' );
 require_once( 'commandLine.inc' );
 echo( "Import Text File\n\n" );
@@ -21,43 +21,43 @@ if( count( $args ) < 1 || isset( $options['help'] ) ) {
        $filename = $args[0];
        echo( "Using {$filename}..." );
        if( is_file( $filename ) ) {
-               
+
                $title = isset( $options['title'] ) ? $options['title'] : titleFromFilename( $filename );
                $title = Title::newFromUrl( $title );
-               
+
                if( is_object( $title ) ) {
-                       
+
                        echo( "\nUsing title '" . $title->getPrefixedText() . "'..." );
                        if( !$title->exists() || !isset( $options['nooverwrite'] ) ) {
-                       
+
                                $text = file_get_contents( $filename );
                                $user = isset( $options['user'] ) ? $options['user'] : 'Maintenance script';
                                $user = User::newFromName( $user );
-                               
+
                                if( is_object( $user ) ) {
-                               
+
                                        echo( "\nUsing username '" . $user->getName() . "'..." );
                                        $wgUser =& $user;
                                        $comment = isset( $options['comment'] ) ? $options['comment'] : 'Importing text file';
                                        $flags = 0 | ( isset( $options['norc'] ) ? EDIT_SUPPRESS_RC : 0 );
-                                       
+
                                        echo( "\nPerforming edit..." );
                                        $article = new Article( $title );
                                        $article->doEdit( $text, $comment, $flags );
                                        echo( "done.\n" );
-                               
+
                                } else {
                                        echo( "invalid username.\n" );
                                }
-                       
+
                        } else {
                                echo( "page exists.\n" );
                        }
-                       
+
                } else {
                        echo( "invalid title.\n" );
                }
-               
+
        } else {
                echo( "does not exist.\n" );
        }
@@ -71,16 +71,24 @@ function titleFromFilename( $filename ) {
 }
 
 function showHelp() {
-       echo( "Import the contents of a text file into a wiki page.\n" );
-       echo( "USAGE: php importTextFile.php <options> <filename>\n\n" );
-       echo( "<filename> : Path to the file containing page content to import\n\n" );
-       echo( "Options:\n\n" );
-       echo( "--title <title>\n\tTitle for the new page; default is to use the filename as a base\n" );
-       echo( "--user <user>\n\tUser to be associated with the edit\n" );
-       echo( "--comment <comment>\n\tEdit summary\n" );
-       echo( "--nooverwrite\n\tDon't overwrite existing content\n" );
-       echo( "--norc\n\tDon't update recent changes\n" );
-       echo( "--help\n\tShow this information\n" );
-       echo( "\n" );
-}
+print <<<EOF
+USAGE: php importTextFile.php <options> <filename>
 
+<filename> : Path to the file containing page content to import
+
+Options:
+
+--title <title>
+       Title for the new page; default is to use the filename as a base
+--user <user>
+       User to be associated with the edit
+--comment <comment>
+       Edit summary
+--nooverwrite
+       Don't overwrite existing content
+--norc
+       Don't update recent changes
+--help
+       Show this information
+EOF;
+}