r96276 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r96275‎ | r96276 | r96277 >
Date:11:22, 5 September 2011
Author:catrope
Status:ok
Tags:
Comment:
Whitespace fixes for r95272, r95604
Modified paths:
  • /trunk/phase3/includes/Export.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Export.php
@@ -743,11 +743,10 @@
744744 }
745745
746746 function closeRenameAndReopen( $newname ) {
747 - if ( is_array($newname) ) {
748 - if (count($newname) > 1) {
749 - throw new MWException(__METHOD__ . ": passed multiple arguments for rename of single file\n");
750 - }
751 - else {
 747+ if ( is_array( $newname ) ) {
 748+ if ( count( $newname ) > 1 ) {
 749+ throw new MWException( __METHOD__ . ": passed multiple arguments for rename of single file\n" );
 750+ } else {
752751 $newname = $newname[0];
753752 }
754753 }
@@ -759,11 +758,10 @@
760759 }
761760
762761 function closeAndRename( $newname ) {
763 - if ( is_array($newname) ) {
764 - if (count($newname) > 1) {
765 - throw new MWException(__METHOD__ . ": passed multiple arguments for rename of single file\n");
766 - }
767 - else {
 762+ if ( is_array( $newname ) ) {
 763+ if ( count( $newname ) > 1 ) {
 764+ throw new MWException( __METHOD__ . ": passed multiple arguments for rename of single file\n" );
 765+ } else {
768766 $newname = $newname[0];
769767 }
770768 }
@@ -775,10 +773,9 @@
776774
777775 function rename( $newname ) {
778776 if ( is_array($newname) ) {
779 - if (count($newname) > 1) {
780 - throw new MWException(__METHOD__ . ": passed multiple arguments for rename of single file\n");
781 - }
782 - else {
 777+ if ( count( $newname ) > 1 ) {
 778+ throw new MWException( __METHOD__ . ": passed multiple arguments for rename of single file\n" );
 779+ } else {
783780 $newname = $newname[0];
784781 }
785782 }
@@ -806,7 +803,7 @@
807804 $command .= " > " . wfEscapeShellArg( $file );
808805 }
809806
810 - $this->startCommand($command);
 807+ $this->startCommand( $command );
811808 $this->command = $command;
812809 $this->filename = $file;
813810 }
@@ -825,11 +822,10 @@
826823 * and reopen new file with the old name.
827824 */
828825 function closeRenameAndReopen( $newname ) {
829 - if ( is_array($newname) ) {
830 - if (count($newname) > 1) {
831 - throw new MWException(__METHOD__ . ": passed multiple arguments for rename of single file\n");
832 - }
833 - else {
 826+ if ( is_array( $newname ) ) {
 827+ if ( count( $newname ) > 1) {
 828+ throw new MWException( __METHOD__ . ": passed multiple arguments for rename of single file\n" );
 829+ } else {
834830 $newname = $newname[0];
835831 }
836832 }
@@ -844,11 +840,10 @@
845841 }
846842
847843 function closeAndRename( $newname ) {
848 - if ( is_array($newname) ) {
849 - if (count($newname) > 1) {
850 - throw new MWException(__METHOD__ . ": passed multiple arguments for rename of single file\n");
851 - }
852 - else {
 844+ if ( is_array( $newname ) ) {
 845+ if ( count( $newname ) > 1 ) {
 846+ throw new MWException( __METHOD__ . ": passed multiple arguments for rename of single file\n" );
 847+ } else {
853848 $newname = $newname[0];
854849 }
855850 }
@@ -861,11 +856,10 @@
862857 }
863858
864859 function rename( $newname ) {
865 - if ( is_array($newname) ) {
866 - if (count($newname) > 1) {
867 - throw new MWException(__METHOD__ . ": passed multiple arguments for rename of single file\n");
868 - }
869 - else {
 860+ if ( is_array( $newname ) ) {
 861+ if ( count( $newname ) > 1) {
 862+ throw new MWException( __METHOD__ . ": passed multiple arguments for rename of single file\n" );
 863+ } else {
870864 $newname = $newname[0];
871865 }
872866 }
@@ -922,26 +916,25 @@
923917 }
924918 if ( $newname ) {
925919 fclose( $this->handle );
926 - proc_close($this->procOpenResource);
 920+ proc_close( $this->procOpenResource );
927921 rename( $this->filename, $newname );
928922 $command = "7za a -bd -si " . wfEscapeShellArg( $file );
929923 $command .= ' >' . wfGetNull() . ' 2>&1';
930 - $this->startCommand($command);
 924+ $this->startCommand( $command );
931925 }
932926 }
933927
934928 function closeAndRename( $newname ) {
935 - if ( is_array($newname) ) {
936 - if (count($newname) > 1) {
937 - throw new MWException(__METHOD__ . ": passed multiple arguments for rename of single file\n");
938 - }
939 - else {
 929+ if ( is_array( $newname ) ) {
 930+ if ( count( $newname ) > 1 ) {
 931+ throw new MWException( __METHOD__ . ": passed multiple arguments for rename of single file\n" );
 932+ } else {
940933 $newname = $newname[0];
941934 }
942935 }
943936 if ( $newname ) {
944937 fclose( $this->handle );
945 - proc_close($this->procOpenResource);
 938+ proc_close( $this->procOpenResource );
946939 rename( $this->filename, $newname );
947940 }
948941 }

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r95272add support for writing out checkpoint files of xml dump at regular intervals...ariel22:45, 22 August 2011
r95604define and use closeAndRename() after last write of xml dump file; convert fr...ariel18:31, 27 August 2011

Status & tagging log