r96277 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r96276‎ | r96277 | r96278 >
Date:11:23, 5 September 2011
Author:catrope
Status:ok
Tags:
Comment:
Stylize Export.php
Modified paths:
  • /trunk/phase3/includes/Export.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Export.php
@@ -630,7 +630,7 @@
631631 */
632632 function writeUpload( $file, $dumpContents = false ) {
633633 if ( $file->isOld() ) {
634 - $archiveName = " " .
 634+ $archiveName = " " .
635635 Xml::element( 'archivename', null, $file->getArchiveName() ) . "\n";
636636 } else {
637637 $archiveName = '';
@@ -638,7 +638,7 @@
639639 if ( $dumpContents ) {
640640 # Dump file as base64
641641 # Uses only XML-safe characters, so does not need escaping
642 - $contents = ' <contents encoding="base64">' .
 642+ $contents = ' <contents encoding="base64">' .
643643 chunk_split( base64_encode( file_get_contents( $file->getPath() ) ) ) .
644644 " </contents>\n";
645645 } else {
@@ -649,7 +649,7 @@
650650 $this->writeContributor( $file->getUser( 'id' ), $file->getUser( 'text' ) ) .
651651 " " . Xml::elementClean( 'comment', null, $file->getDescription() ) . "\n" .
652652 " " . Xml::element( 'filename', null, $file->getName() ) . "\n" .
653 - $archiveName .
 653+ $archiveName .
654654 " " . Xml::element( 'src', null, $file->getCanonicalUrl() ) . "\n" .
655655 " " . Xml::element( 'size', null, $file->getSize() ) . "\n" .
656656 " " . Xml::element( 'sha1base36', null, $file->getSha1() ) . "\n" .
@@ -699,7 +699,7 @@
700700 }
701701
702702 /**
703 - * Close the old file, move it to a specified name,
 703+ * Close the old file, move it to a specified name,
704704 * and reopen new file with the old name. Use this
705705 * for writing out a file in multiple pieces
706706 * at specified checkpoints (e.g. every n hours).
@@ -772,7 +772,7 @@
773773 }
774774
775775 function rename( $newname ) {
776 - if ( is_array($newname) ) {
 776+ if ( is_array( $newname ) ) {
777777 if ( count( $newname ) > 1 ) {
778778 throw new MWException( __METHOD__ . ": passed multiple arguments for rename of single file\n" );
779779 } else {
@@ -802,13 +802,13 @@
803803 if ( !is_null( $file ) ) {
804804 $command .= " > " . wfEscapeShellArg( $file );
805805 }
806 -
 806+
807807 $this->startCommand( $command );
808808 $this->command = $command;
809809 $this->filename = $file;
810810 }
811811
812 - function startCommand($command) {
 812+ function startCommand( $command ) {
813813 $spec = array(
814814 0 => array( "pipe", "r" ),
815815 );
@@ -818,12 +818,12 @@
819819 }
820820
821821 /**
822 - * Close the old file, move it to a specified name,
823 - * and reopen new file with the old name.
 822+ * Close the old file, move it to a specified name,
 823+ * and reopen new file with the old name.
824824 */
825825 function closeRenameAndReopen( $newname ) {
826826 if ( is_array( $newname ) ) {
827 - if ( count( $newname ) > 1) {
 827+ if ( count( $newname ) > 1 ) {
828828 throw new MWException( __METHOD__ . ": passed multiple arguments for rename of single file\n" );
829829 } else {
830830 $newname = $newname[0];
@@ -831,11 +831,11 @@
832832 }
833833 if ( $newname ) {
834834 fclose( $this->handle );
835 - proc_close($this->procOpenResource);
 835+ proc_close( $this->procOpenResource );
836836 rename( $this->filename, $newname );
837837 $command = $this->command;
838838 $command .= " > " . wfEscapeShellArg( $this->filename );
839 - $this->startCommand($command);
 839+ $this->startCommand( $command );
840840 }
841841 }
842842
@@ -850,14 +850,14 @@
851851 if ( $newname ) {
852852 # pclose( $this->handle );
853853 fclose( $this->handle );
854 - proc_close($this->procOpenResource);
 854+ proc_close( $this->procOpenResource );
855855 rename( $this->filename, $newname );
856856 }
857857 }
858858
859859 function rename( $newname ) {
860860 if ( is_array( $newname ) ) {
861 - if ( count( $newname ) > 1) {
 861+ if ( count( $newname ) > 1 ) {
862862 throw new MWException( __METHOD__ . ": passed multiple arguments for rename of single file\n" );
863863 } else {
864864 $newname = $newname[0];
@@ -906,9 +906,9 @@
907907 }
908908
909909 function closeRenameAndReopen( $newname ) {
910 - if ( is_array($newname) ) {
911 - if (count($newname) > 1) {
912 - throw new MWException(__METHOD__ . ": passed multiple arguments for rename of single file\n");
 910+ if ( is_array( $newname ) ) {
 911+ if ( count( $newname ) > 1 ) {
 912+ throw new MWException( __METHOD__ . ": passed multiple arguments for rename of single file\n" );
913913 }
914914 else {
915915 $newname = $newname[0];
@@ -940,9 +940,9 @@
941941 }
942942
943943 function rename( $newname ) {
944 - if ( is_array($newname) ) {
945 - if (count($newname) > 1) {
946 - throw new MWException(__METHOD__ . ": passed multiple arguments for rename of single file\n");
 944+ if ( is_array( $newname ) ) {
 945+ if ( count( $newname ) > 1 ) {
 946+ throw new MWException( __METHOD__ . ": passed multiple arguments for rename of single file\n" );
947947 }
948948 else {
949949 $newname = $newname[0];
@@ -1164,25 +1164,25 @@
11651165 }
11661166
11671167 function closeRenameAndReopen( $newnames ) {
1168 - for( $i = 0; $i < $this->count; $i++ ) {
 1168+ for ( $i = 0; $i < $this->count; $i++ ) {
11691169 $this->sinks[$i]->closeRenameAndReopen( $newnames[$i] );
11701170 }
11711171 }
11721172
11731173 function closeAndRename( $newname ) {
1174 - for( $i = 0; $i < $this->count; $i++ ) {
 1174+ for ( $i = 0; $i < $this->count; $i++ ) {
11751175 $this->sinks[$i]->closeAndRename( $newnames[$i] );
11761176 }
11771177 }
11781178 function rename( $newnames ) {
1179 - for( $i = 0; $i < $this->count; $i++ ) {
 1179+ for ( $i = 0; $i < $this->count; $i++ ) {
11801180 $this->sinks[$i]->rename( $newnames[$i] );
11811181 }
11821182 }
11831183
11841184 function getFilename() {
11851185 $filenames = array();
1186 - for( $i = 0; $i < $this->count; $i++ ) {
 1186+ for ( $i = 0; $i < $this->count; $i++ ) {
11871187 $filenames[] = $this->sinks[$i]->getFilename();
11881188 }
11891189 return $filenames;

Status & tagging log