]> scripts.mit.edu Git - autoinstallsdev/mediawiki.git/blobdiff - maintenance/edit.php
MediaWiki 1.14.0
[autoinstallsdev/mediawiki.git] / maintenance / edit.php
index 75b6c3338e41cd1123970ee3ad502bbbd689a1bd..6417804505bcd09716f1b2e1d74f72eb696fac8f 100644 (file)
@@ -1,4 +1,8 @@
 <?php
+/**
+ * @file
+ * @ingroup Maintenance
+ */
 
 $optionsWithArgs = array( 'u', 's' );
 
@@ -54,15 +58,20 @@ $text = file_get_contents( 'php://stdin' );
 
 # Do the edit
 print "Saving... ";
-$success = $wgArticle->doEdit( $text, $summary, 
+$status = $wgArticle->doEdit( $text, $summary, 
        ( $minor ? EDIT_MINOR : 0 ) |
        ( $bot ? EDIT_FORCE_BOT : 0 ) | 
        ( $autoSummary ? EDIT_AUTOSUMMARY : 0 ) |
        ( $noRC ? EDIT_SUPPRESS_RC : 0 ) );
-if ( $success ) {
+if ( $status->isOK() ) {
        print "done\n";
+       $exit = 0;
 } else {
        print "failed\n";
-       exit( 1 );
+       $exit = 1;
+}
+if ( !$status->isGood() ) {
+       print $status->getWikiText() . "\n";
 }
+exit( $exit );