Index: trunk/phase3/includes/Export.php |
— | — | @@ -630,7 +630,7 @@ |
631 | 631 | */ |
632 | 632 | function writeUpload( $file, $dumpContents = false ) { |
633 | 633 | if ( $file->isOld() ) { |
634 | | - $archiveName = " " . |
| 634 | + $archiveName = " " . |
635 | 635 | Xml::element( 'archivename', null, $file->getArchiveName() ) . "\n"; |
636 | 636 | } else { |
637 | 637 | $archiveName = ''; |
— | — | @@ -638,7 +638,7 @@ |
639 | 639 | if ( $dumpContents ) { |
640 | 640 | # Dump file as base64 |
641 | 641 | # Uses only XML-safe characters, so does not need escaping |
642 | | - $contents = ' <contents encoding="base64">' . |
| 642 | + $contents = ' <contents encoding="base64">' . |
643 | 643 | chunk_split( base64_encode( file_get_contents( $file->getPath() ) ) ) . |
644 | 644 | " </contents>\n"; |
645 | 645 | } else { |
— | — | @@ -649,7 +649,7 @@ |
650 | 650 | $this->writeContributor( $file->getUser( 'id' ), $file->getUser( 'text' ) ) . |
651 | 651 | " " . Xml::elementClean( 'comment', null, $file->getDescription() ) . "\n" . |
652 | 652 | " " . Xml::element( 'filename', null, $file->getName() ) . "\n" . |
653 | | - $archiveName . |
| 653 | + $archiveName . |
654 | 654 | " " . Xml::element( 'src', null, $file->getCanonicalUrl() ) . "\n" . |
655 | 655 | " " . Xml::element( 'size', null, $file->getSize() ) . "\n" . |
656 | 656 | " " . Xml::element( 'sha1base36', null, $file->getSha1() ) . "\n" . |
— | — | @@ -699,7 +699,7 @@ |
700 | 700 | } |
701 | 701 | |
702 | 702 | /** |
703 | | - * Close the old file, move it to a specified name, |
| 703 | + * Close the old file, move it to a specified name, |
704 | 704 | * and reopen new file with the old name. Use this |
705 | 705 | * for writing out a file in multiple pieces |
706 | 706 | * at specified checkpoints (e.g. every n hours). |
— | — | @@ -772,7 +772,7 @@ |
773 | 773 | } |
774 | 774 | |
775 | 775 | function rename( $newname ) { |
776 | | - if ( is_array($newname) ) { |
| 776 | + if ( is_array( $newname ) ) { |
777 | 777 | if ( count( $newname ) > 1 ) { |
778 | 778 | throw new MWException( __METHOD__ . ": passed multiple arguments for rename of single file\n" ); |
779 | 779 | } else { |
— | — | @@ -802,13 +802,13 @@ |
803 | 803 | if ( !is_null( $file ) ) { |
804 | 804 | $command .= " > " . wfEscapeShellArg( $file ); |
805 | 805 | } |
806 | | - |
| 806 | + |
807 | 807 | $this->startCommand( $command ); |
808 | 808 | $this->command = $command; |
809 | 809 | $this->filename = $file; |
810 | 810 | } |
811 | 811 | |
812 | | - function startCommand($command) { |
| 812 | + function startCommand( $command ) { |
813 | 813 | $spec = array( |
814 | 814 | 0 => array( "pipe", "r" ), |
815 | 815 | ); |
— | — | @@ -818,12 +818,12 @@ |
819 | 819 | } |
820 | 820 | |
821 | 821 | /** |
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. |
824 | 824 | */ |
825 | 825 | function closeRenameAndReopen( $newname ) { |
826 | 826 | if ( is_array( $newname ) ) { |
827 | | - if ( count( $newname ) > 1) { |
| 827 | + if ( count( $newname ) > 1 ) { |
828 | 828 | throw new MWException( __METHOD__ . ": passed multiple arguments for rename of single file\n" ); |
829 | 829 | } else { |
830 | 830 | $newname = $newname[0]; |
— | — | @@ -831,11 +831,11 @@ |
832 | 832 | } |
833 | 833 | if ( $newname ) { |
834 | 834 | fclose( $this->handle ); |
835 | | - proc_close($this->procOpenResource); |
| 835 | + proc_close( $this->procOpenResource ); |
836 | 836 | rename( $this->filename, $newname ); |
837 | 837 | $command = $this->command; |
838 | 838 | $command .= " > " . wfEscapeShellArg( $this->filename ); |
839 | | - $this->startCommand($command); |
| 839 | + $this->startCommand( $command ); |
840 | 840 | } |
841 | 841 | } |
842 | 842 | |
— | — | @@ -850,14 +850,14 @@ |
851 | 851 | if ( $newname ) { |
852 | 852 | # pclose( $this->handle ); |
853 | 853 | fclose( $this->handle ); |
854 | | - proc_close($this->procOpenResource); |
| 854 | + proc_close( $this->procOpenResource ); |
855 | 855 | rename( $this->filename, $newname ); |
856 | 856 | } |
857 | 857 | } |
858 | 858 | |
859 | 859 | function rename( $newname ) { |
860 | 860 | if ( is_array( $newname ) ) { |
861 | | - if ( count( $newname ) > 1) { |
| 861 | + if ( count( $newname ) > 1 ) { |
862 | 862 | throw new MWException( __METHOD__ . ": passed multiple arguments for rename of single file\n" ); |
863 | 863 | } else { |
864 | 864 | $newname = $newname[0]; |
— | — | @@ -906,9 +906,9 @@ |
907 | 907 | } |
908 | 908 | |
909 | 909 | 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" ); |
913 | 913 | } |
914 | 914 | else { |
915 | 915 | $newname = $newname[0]; |
— | — | @@ -940,9 +940,9 @@ |
941 | 941 | } |
942 | 942 | |
943 | 943 | 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" ); |
947 | 947 | } |
948 | 948 | else { |
949 | 949 | $newname = $newname[0]; |
— | — | @@ -1164,25 +1164,25 @@ |
1165 | 1165 | } |
1166 | 1166 | |
1167 | 1167 | function closeRenameAndReopen( $newnames ) { |
1168 | | - for( $i = 0; $i < $this->count; $i++ ) { |
| 1168 | + for ( $i = 0; $i < $this->count; $i++ ) { |
1169 | 1169 | $this->sinks[$i]->closeRenameAndReopen( $newnames[$i] ); |
1170 | 1170 | } |
1171 | 1171 | } |
1172 | 1172 | |
1173 | 1173 | function closeAndRename( $newname ) { |
1174 | | - for( $i = 0; $i < $this->count; $i++ ) { |
| 1174 | + for ( $i = 0; $i < $this->count; $i++ ) { |
1175 | 1175 | $this->sinks[$i]->closeAndRename( $newnames[$i] ); |
1176 | 1176 | } |
1177 | 1177 | } |
1178 | 1178 | function rename( $newnames ) { |
1179 | | - for( $i = 0; $i < $this->count; $i++ ) { |
| 1179 | + for ( $i = 0; $i < $this->count; $i++ ) { |
1180 | 1180 | $this->sinks[$i]->rename( $newnames[$i] ); |
1181 | 1181 | } |
1182 | 1182 | } |
1183 | 1183 | |
1184 | 1184 | function getFilename() { |
1185 | 1185 | $filenames = array(); |
1186 | | - for( $i = 0; $i < $this->count; $i++ ) { |
| 1186 | + for ( $i = 0; $i < $this->count; $i++ ) { |
1187 | 1187 | $filenames[] = $this->sinks[$i]->getFilename(); |
1188 | 1188 | } |
1189 | 1189 | return $filenames; |