Index: trunk/phase3/includes/Export.php |
— | — | @@ -354,9 +354,7 @@ |
355 | 355 | * @ingroup Dump |
356 | 356 | */ |
357 | 357 | class XmlDumpWriter { |
358 | | - var $firstPageWritten = 0; |
359 | | - var $lastPageWritten = 0; |
360 | | - var $pageInProgress = 0; |
| 358 | + protected $firstPageWritten = 0, $lastPageWritten = 0, $pageInProgress = 0; |
361 | 359 | |
362 | 360 | /** |
363 | 361 | * Returns the export schema version. |
— | — | @@ -482,7 +480,7 @@ |
483 | 481 | */ |
484 | 482 | function closePage() { |
485 | 483 | return " </page>\n"; |
486 | | - if (! $this->firstPageWritten) { |
| 484 | + if ( !$this->firstPageWritten ) { |
487 | 485 | $this->firstPageWritten = $this->pageInProgress; |
488 | 486 | } |
489 | 487 | $this->lastPageWritten = $this->pageInProgress; |
— | — | @@ -700,18 +698,28 @@ |
701 | 699 | print $string; |
702 | 700 | } |
703 | 701 | |
| 702 | + /** |
| 703 | + * Close the old file, move it to a specified name, |
| 704 | + * and reopen new file with the old name. Use this |
| 705 | + * for writing out a file in multiple pieces |
| 706 | + * at specified checkpoints (e.g. every n hours). |
| 707 | + * @param $newname mixed File name. May be a string or an array with one element |
| 708 | + */ |
704 | 709 | function closeRenameAndReopen( $newname ) { |
705 | 710 | return; |
706 | 711 | } |
707 | 712 | |
| 713 | + // TODO: document |
708 | 714 | function closeAndRename( $newname ) { |
709 | 715 | return; |
710 | 716 | } |
711 | 717 | |
| 718 | + // TODO: document |
712 | 719 | function rename( $newname ) { |
713 | 720 | return; |
714 | 721 | } |
715 | 722 | |
| 723 | + // TODO: document |
716 | 724 | function getFilename() { |
717 | 725 | return NULL; |
718 | 726 | } |
— | — | @@ -734,16 +742,10 @@ |
735 | 743 | fputs( $this->handle, $string ); |
736 | 744 | } |
737 | 745 | |
738 | | - /** |
739 | | - * Close the old file, move it to a specified name, |
740 | | - * and reopen new file with the old name. Use this |
741 | | - * for writing out a file in multiple pieces |
742 | | - * at specified checkpoints (e.g. every n hours). |
743 | | - */ |
744 | 746 | function closeRenameAndReopen( $newname ) { |
745 | 747 | if ( is_array($newname) ) { |
746 | 748 | if (count($newname) > 1) { |
747 | | - throw new MWException("Export closeRenameAndReopen: passed multiple argumnts for rename of single file\n"); |
| 749 | + throw new MWException(__METHOD__ . ": passed multiple arguments for rename of single file\n"); |
748 | 750 | } |
749 | 751 | else { |
750 | 752 | $newname = $newname[0]; |
— | — | @@ -759,7 +761,7 @@ |
760 | 762 | function closeAndRename( $newname ) { |
761 | 763 | if ( is_array($newname) ) { |
762 | 764 | if (count($newname) > 1) { |
763 | | - throw new MWException("Export closeRenameAndReopen: passed multiple argumnts for rename of single file\n"); |
| 765 | + throw new MWException(__METHOD__ . ": passed multiple arguments for rename of single file\n"); |
764 | 766 | } |
765 | 767 | else { |
766 | 768 | $newname = $newname[0]; |
— | — | @@ -774,7 +776,7 @@ |
775 | 777 | function rename( $newname ) { |
776 | 778 | if ( is_array($newname) ) { |
777 | 779 | if (count($newname) > 1) { |
778 | | - throw new MWException("Export closeRenameAndReopen: passed multiple argumnts for rename of single file\n"); |
| 780 | + throw new MWException(__METHOD__ . ": passed multiple arguments for rename of single file\n"); |
779 | 781 | } |
780 | 782 | else { |
781 | 783 | $newname = $newname[0]; |
— | — | @@ -797,7 +799,7 @@ |
798 | 800 | * @ingroup Dump |
799 | 801 | */ |
800 | 802 | class DumpPipeOutput extends DumpFileOutput { |
801 | | - var $command; |
| 803 | + protected $command, $filename; |
802 | 804 | |
803 | 805 | function __construct( $command, $file = null ) { |
804 | 806 | if ( !is_null( $file ) ) { |
— | — | @@ -825,7 +827,7 @@ |
826 | 828 | function closeRenameAndReopen( $newname ) { |
827 | 829 | if ( is_array($newname) ) { |
828 | 830 | if (count($newname) > 1) { |
829 | | - throw new MWException("Export closeRenameAndReopen: passed multiple argumnts for rename of single file\n"); |
| 831 | + throw new MWException(__METHOD__ . ": passed multiple arguments for rename of single file\n"); |
830 | 832 | } |
831 | 833 | else { |
832 | 834 | $newname = $newname[0]; |
— | — | @@ -844,7 +846,7 @@ |
845 | 847 | function closeAndRename( $newname ) { |
846 | 848 | if ( is_array($newname) ) { |
847 | 849 | if (count($newname) > 1) { |
848 | | - throw new MWException("Export closeRenameAndReopen: passed multiple argumnts for rename of single file\n"); |
| 850 | + throw new MWException(__METHOD__ . ": passed multiple arguments for rename of single file\n"); |
849 | 851 | } |
850 | 852 | else { |
851 | 853 | $newname = $newname[0]; |
— | — | @@ -861,7 +863,7 @@ |
862 | 864 | function rename( $newname ) { |
863 | 865 | if ( is_array($newname) ) { |
864 | 866 | if (count($newname) > 1) { |
865 | | - throw new MWException("Export closeRenameAndReopen: passed multiple argumnts for rename of single file\n"); |
| 867 | + throw new MWException(__METHOD__ . ": passed multiple arguments for rename of single file\n"); |
866 | 868 | } |
867 | 869 | else { |
868 | 870 | $newname = $newname[0]; |
— | — | @@ -898,7 +900,7 @@ |
899 | 901 | * @ingroup Dump |
900 | 902 | */ |
901 | 903 | class Dump7ZipOutput extends DumpPipeOutput { |
902 | | - var $filename; |
| 904 | + protected $filename; |
903 | 905 | |
904 | 906 | function __construct( $file ) { |
905 | 907 | $command = "7za a -bd -si " . wfEscapeShellArg( $file ); |
— | — | @@ -912,7 +914,7 @@ |
913 | 915 | function closeRenameAndReopen( $newname ) { |
914 | 916 | if ( is_array($newname) ) { |
915 | 917 | if (count($newname) > 1) { |
916 | | - throw new MWException("Export closeRenameAndReopen: passed multiple argumnts for rename of single file\n"); |
| 918 | + throw new MWException(__METHOD__ . ": passed multiple arguments for rename of single file\n"); |
917 | 919 | } |
918 | 920 | else { |
919 | 921 | $newname = $newname[0]; |
— | — | @@ -931,7 +933,7 @@ |
932 | 934 | function closeAndRename( $newname ) { |
933 | 935 | if ( is_array($newname) ) { |
934 | 936 | if (count($newname) > 1) { |
935 | | - throw new MWException("Export closeRenameAndReopen: passed multiple argumnts for rename of single file\n"); |
| 937 | + throw new MWException(__METHOD__ . ": passed multiple arguments for rename of single file\n"); |
936 | 938 | } |
937 | 939 | else { |
938 | 940 | $newname = $newname[0]; |
— | — | @@ -947,7 +949,7 @@ |
948 | 950 | function rename( $newname ) { |
949 | 951 | if ( is_array($newname) ) { |
950 | 952 | if (count($newname) > 1) { |
951 | | - throw new MWException("Export closeRenameAndReopen: passed multiple argumnts for rename of single file\n"); |
| 953 | + throw new MWException(__METHOD__ . ": passed multiple arguments for rename of single file\n"); |
952 | 954 | } |
953 | 955 | else { |
954 | 956 | $newname = $newname[0]; |