r96465 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r96464‎ | r96465 | r96466 >
Date:18:33, 7 September 2011
Author:catrope
Status:ok
Tags:
Comment:
1.17wmf1: MFT r94135, r95260, r95311, r95601, r95790, r96434
Modified paths:
  • /branches/wmf/1.17wmf1/extensions/ArticleFeedback/ArticleFeedback.hooks.php (modified) (history)
  • /branches/wmf/1.17wmf1/extensions/ArticleFeedback/ArticleFeedback.i18n.php (modified) (history)
  • /branches/wmf/1.17wmf1/extensions/ArticleFeedback/SpecialArticleFeedback.php (modified) (history)
  • /branches/wmf/1.17wmf1/extensions/ArticleFeedback/modules/jquery.articleFeedback/jquery.articleFeedback.js (modified) (history)
  • /branches/wmf/1.17wmf1/extensions/ArticleFeedback/populateAFStatistics.php (modified) (history)
  • /branches/wmf/1.17wmf1/extensions/WikiEditor/WikiEditor.i18n.php (modified) (history)
  • /branches/wmf/1.17wmf1/extensions/WikiEditor/WikiEditor.php (modified) (history)
  • /branches/wmf/1.17wmf1/extensions/WikiEditor/modules/ext.wikiEditor.toolbar.js (modified) (history)
  • /branches/wmf/1.17wmf1/includes/Export.php (modified) (history)
  • /branches/wmf/1.17wmf1/languages/messages/MessagesDtp.php (modified) (history)

Diff [purge]

Index: branches/wmf/1.17wmf1/extensions/WikiEditor/WikiEditor.php
@@ -400,6 +400,7 @@
401401 'wikieditor-toolbar-characters-page-greek',
402402 'wikieditor-toolbar-characters-page-cyrillic',
403403 'wikieditor-toolbar-characters-page-arabic',
 404+ 'wikieditor-toolbar-characters-page-arabicextended',
404405 'wikieditor-toolbar-characters-page-persian',
405406 'wikieditor-toolbar-characters-page-hebrew',
406407 'wikieditor-toolbar-characters-page-bangla',
Index: branches/wmf/1.17wmf1/extensions/WikiEditor/modules/ext.wikiEditor.toolbar.js
@@ -626,19 +626,108 @@
627627 "\u042f", "\u044f"
628628 ]
629629 },
 630+ // The core 28-letter alphabet, special letters for the Arabic language,
 631+ // vowels, punctuation, digits.
 632+ // Names of letters are written as in the Unicode charts.
630633 'arabic': {
631634 'labelMsg': 'wikieditor-toolbar-characters-page-arabic',
632635 'layout': 'characters',
633636 'language': 'ar',
634637 'direction': 'rtl',
635638 'characters': [
636 - "\u061b", "\u061f", "\u0621", "\u0622", "\u0623", "\u0624", "\u0625", "\u0626", "\u0627",
637 - "\u0628", "\u0629", "\u062a", "\u062b", "\u062c", "\u062d", "\u062e", "\u062f", "\u0630",
638 - "\u0631", "\u0632", "\u0633", "\u0634", "\u0635", "\u0636", "\u0637", "\u0638", "\u0639",
639 - "\u063a", "\u0641", "\u0642", "\u0643", "\u0644", "\u0645", "\u0646", "\u0647", "\u0648",
640 - "\u0649", "\u064a", "\u060c", "\u067e", "\u0686", "\u0698", "\u06af", "\u06ad"
 639+ // core alphabet
 640+ "\u0627", "\u0628", "\u062a", "\u062b", "\u062c", "\u062d", "\u062e", "\u062f",
 641+ "\u0630", "\u0631", "\u0632", "\u0633", "\u0634", "\u0635", "\u0636", "\u0637",
 642+ "\u0638", "\u0639", "\u063a", "\u0641", "\u0642", "\u0643", "\u0644", "\u0645",
 643+ "\u0646", "\u0647", "\u0648", "\u064a",
 644+ // special letters for the Arabic language
 645+ "\u0621", // Hamza
 646+ "\u0622", "\u0623", "\u0625", "\u0671", // Alef
 647+ "\u0624", // Waw hamza
 648+ "\u0626", // Yeh hamza
 649+ "\u0649", // Alef maksura
 650+ "\u0629", // Teh marbuta
 651+ // vowels
 652+ "\u064E", "\u064F", "\u0650", "\u064B", "\u064C", "\u064D", "\u0651", "\u0652",
 653+ "\u0670",
 654+ // punctuation
 655+ "\u060c", "\u061b", "\u061f", "\u0640",
 656+ // digits
 657+ "\u0660", "\u0661", "\u0662", "\u0663", "\u0664", "\u0665", "\u0666", "\u0667",
 658+ "\u0668", "\u0669", "\u066A", "\u066B", "\u066C", "\u066D"
641659 ]
642660 },
 661+ // Characters for languages other than Arabic.
 662+ 'arabicextended': {
 663+ 'labelMsg': 'wikieditor-toolbar-characters-page-arabicextended',
 664+ 'layout': 'characters',
 665+ 'language': 'ar',
 666+ 'direction': 'rtl',
 667+ 'characters': [
 668+ // Alef
 669+ "\u0672", "\u0673", "\u0674", "\u0675", "\u0773", "\u0774",
 670+ // Beh
 671+ "\u066E", "\u067B", "\u067E", "\u0680", "\u0750", "\u0751", "\u0752", "\u0753",
 672+ "\u0754", "\u0755", "\u0756",
 673+ // Teh
 674+ "\u0679", "\u067A", "\u067C", "\u067D", "\u067F",
 675+ // Jeem
 676+ "\u0681", "\u0682", "\u0683", "\u0684", "\u0685", "\u0686", "\u0687", "\u06BF",
 677+ // Hah
 678+ "\u0757", "\u0758", "\u076E", "\u076F", "\u0772", "\u077C",
 679+ // Dal
 680+ "\u0688", "\u0689", "\u068A", "\u068B", "\u068C", "\u068D", "\u068E", "\u068F",
 681+ "\u0690", "\u06EE", "\u0759", "\u075A",
 682+ // Reh
 683+ "\u0691", "\u0692", "\u0693", "\u0694", "\u0695", "\u0696", "\u0697", "\u0698",
 684+ "\u0699", "\u06EF", "\u075B", "\u076B", "\u076C", "\u0771",
 685+ // Seen
 686+ "\u069A", "\u069B", "\u069C", "\u077D",
 687+ // Sheen
 688+ "\u06FA", "\u075C", "\u076D", "\u0770", "\u077E",
 689+ // Sad
 690+ "\u069D", "\u069E",
 691+ // Dad
 692+ "\u06FB",
 693+ // Tah
 694+ "\u069F",
 695+ // Ain
 696+ "\u06A0", "\u075D", "\u075E", "\u075F",
 697+ // Ghain
 698+ "\u06FC",
 699+ // Feh
 700+ "\u06A1", "\u06A2", "\u06A3", "\u06A4", "\u06A5", "\u06A6", "\u0760", "\u0761",
 701+ // Qaf
 702+ "\u066F", "\u06A7", "\u06A8",
 703+ // Kaf
 704+ "\u063B", "\u063C", "\u06A9", "\u06AA", "\u06AB", "\u06AC", "\u06AD", "\u06AE",
 705+ "\u06AF", "\u06B0", "\u06B1", "\u06B2", "\u06B3", "\u06B4", "\u0762", "\u0763",
 706+ "\u0764", "\u077F",
 707+ // Lam
 708+ "\u06B5", "\u06B6", "\u06B7", "\u06B8", "\u076A",
 709+ // Meem
 710+ "\u0765", "\u0766",
 711+ // Noon
 712+ "\u06B9", "\u06BA", "\u06BB", "\u06BC", "\u06BD", "\u0767", "\u0768", "\u0769",
 713+ // Heh
 714+ "\u06BE", "\u06C0", "\u06C1", "\u06C2", "\u06C3", "\u06D5", "\u06FF",
 715+ // Waw
 716+ "\u0676", "\u0677", "\u06C4", "\u06C5", "\u06C6", "\u06C7", "\u06C8", "\u06C9",
 717+ "\u06CA", "\u06CB", "\u06CF", "\u0778", "\u0779",
 718+ // Yeh
 719+ "\u0620", "\u063D", "\u063E", "\u063F", "\u0678", "\u06CC", "\u06CD", "\u06CE",
 720+ "\u06D0", "\u06D1", "\u06D2", "\u06D3", "\u0775", "\u0776", "\u0777", "\u077A",
 721+ "\u077B",
 722+ // diacritics
 723+ "\u0656", "\u0657", "\u0658", "\u0659", "\u065A", "\u065B", "\u065C", "\u065D",
 724+ "\u065E", "\u065F",
 725+ // special punctuation
 726+ "\u06D4", "\u06FD", "\u06FE",
 727+ // special digits
 728+ "\u06F0", "\u06F1", "\u06F2", "\u06F3", "\u06F4", "\u06F5", "\u06F6", "\u06F7",
 729+ "\u06F8", "\u06F9",
 730+ ]
 731+ },
643732 'hebrew': {
644733 'labelMsg': 'wikieditor-toolbar-characters-page-hebrew',
645734 'layout': 'characters',
Property changes on: branches/wmf/1.17wmf1/extensions/WikiEditor/modules/ext.wikiEditor.toolbar.js
___________________________________________________________________
Added: svn:mergeinfo
646735 Merged /branches/new-installer/phase3/extensions/WikiEditor/modules/ext.wikiEditor.toolbar.js:r43664-66004
647736 Merged /branches/wmf-deployment/extensions/WikiEditor/modules/ext.wikiEditor.toolbar.js:r60970
648737 Merged /branches/REL1_15/phase3/extensions/WikiEditor/modules/ext.wikiEditor.toolbar.js:r51646
649738 Merged /branches/wmf/1.16wmf4/extensions/WikiEditor/modules/ext.wikiEditor.toolbar.js:r67177,69199,76243,77266
650739 Merged /trunk/extensions/WikiEditor/modules/ext.wikiEditor.toolbar.js:r83817,94135,95260,95311,95340,95601,95790,96434
651740 Merged /branches/sqlite/extensions/WikiEditor/modules/ext.wikiEditor.toolbar.js:r58211-58321
652741 Merged /trunk/extensions/WikiEditor/modules/jquery.wikiEditor.toolbar.config.js:r95790
653742 Merged /trunk/phase3/extensions/WikiEditor/modules/ext.wikiEditor.toolbar.js:r79828,79830,79848,79853,79950-79951,79954,79989,80006-80007,80013,80016,80080,80083,80124,80128,80238,81833,83212,83590,94135,95260,95311,95340,95601,95790,96434
Index: branches/wmf/1.17wmf1/extensions/WikiEditor/WikiEditor.i18n.php
@@ -184,6 +184,7 @@
185185 'wikieditor-toolbar-characters-page-greek' => 'Greek',
186186 'wikieditor-toolbar-characters-page-cyrillic' => 'Cyrillic',
187187 'wikieditor-toolbar-characters-page-arabic' => 'Arabic',
 188+ 'wikieditor-toolbar-characters-page-arabicextended' => 'Arabic extended',
188189 'wikieditor-toolbar-characters-page-persian' => 'Persian',
189190 'wikieditor-toolbar-characters-page-hebrew' => 'Hebrew',
190191 'wikieditor-toolbar-characters-page-bangla' => 'Bangla',
Index: branches/wmf/1.17wmf1/extensions/ArticleFeedback/SpecialArticleFeedback.php
@@ -119,6 +119,8 @@
120120 $ids[] = $page['page'];
121121 }
122122 self::populateTitleCache( $ids );
 123+
 124+ $categories = self::getCategories();
123125
124126 $rows = array();
125127 if ( $pages ) {
@@ -129,12 +131,19 @@
130132 continue;
131133 }
132134 $row['page'] = $wgUser->getSkin()->link( $pageTitle, $pageTitle->getPrefixedText() );
133 - foreach ( $page['ratings'] as $id => $value ) {
 135+ foreach ( $categories as $catid => $catmsg ) {
 136+ if ( isset( $page['ratings'][$catid] ) ) {
 137+ $number = $this->formatNumber( $page['ratings'][$catid] );
 138+ $class = round( $page['ratings'][$catid] );
 139+ } else {
 140+ $number = wfMsg( 'articlefeedback-table-noratings' );
 141+ $class = 'none';
 142+ }
134143 $row[] = array(
135 - 'text' => $this->formatNumber( $value ),
 144+ 'text' => $number,
136145 'attr' => array(
137146 'class' => 'articleFeedback-table-column-rating ' .
138 - 'articleFeedback-table-column-score-' . round( $value )
 147+ 'articleFeedback-table-column-score-' . $class
139148 )
140149 );
141150 }
@@ -153,7 +162,7 @@
154163 $caption,
155164 array_merge(
156165 array( wfMsg( 'articleFeedback-table-heading-page' ) ),
157 - self::getCategories(),
 166+ $categories,
158167 array( wfMsg( 'articleFeedback-table-heading-average' ) )
159168 ),
160169 $rows,
@@ -168,15 +177,22 @@
169178 */
170179 protected function renderWeeklyMostChanged() {
171180 global $wgOut, $wgUser;
 181+
 182+ $categories = self::getCategories();
172183
173184 $rows = array();
174185 foreach ( $this->getWeeklyMostChanged() as $page ) {
175186 $row = array();
176187 $pageTitle = Title::newFromText( $page['page'] );
177188 $row['page'] = $wgUser->getSkin()->link( $pageTitle, $pageTitle->getPrefixedText() );
178 - foreach ( $page['changes'] as $id => $value ) {
 189+ foreach ( $categories as $catid => $catmsg ) {
 190+ if ( isset( $page['changes'][$catid] ) ) {
 191+ $number = $this->formatNumber( $page['changes'][$catid] );
 192+ } else {
 193+ $number = wfMsg( 'articlefeedback-table-noratings' );
 194+ }
179195 $row[] = array(
180 - 'text' => $this->formatNumber( $value ),
 196+ 'text' => $number,
181197 'attr' => array(
182198 'class' => 'articleFeedback-table-column-changes'
183199 )
@@ -188,7 +204,7 @@
189205 wfMsg( 'articleFeedback-table-caption-weeklymostchanged' ),
190206 array_merge(
191207 array( wfMsg( 'articleFeedback-table-heading-page' ) ),
192 - self::getCategories()
 208+ $categories
193209 ),
194210 $rows,
195211 'articleFeedback-table-weeklymostchanged'
@@ -205,6 +221,7 @@
206222
207223
208224 $problems = $this->getProblems();
 225+ $categories = self::getCategories();
209226
210227 // Pre-fill page ID cache
211228 $ids = array();
@@ -221,12 +238,19 @@
222239 continue;
223240 }
224241 $row['page'] = $wgUser->getSkin()->link( $pageTitle, $pageTitle->getPrefixedText() );
225 - foreach ( $page['ratings'] as $id => $value ) {
 242+ foreach ( $categories as $catid => $catmsg ) {
 243+ if ( isset( $page['ratings'][$catid] ) ) {
 244+ $number = $this->formatNumber( $page['ratings'][$catid] );
 245+ $class = round( $page['ratings'][$catid] );
 246+ } else {
 247+ $number = wfMsg( 'articlefeedback-table-noratings' );
 248+ $class = 'none';
 249+ }
226250 $row[] = array(
227 - 'text' => $this->formatNumber( $value ),
 251+ 'text' => $number,
228252 'attr' => array(
229253 'class' => 'articleFeedback-table-column-rating ' .
230 - 'articleFeedback-table-column-score-' . round( $value )
 254+ 'articleFeedback-table-column-score-' . $class
231255 )
232256 );
233257 }
@@ -243,7 +267,7 @@
244268 wfMsg( 'articleFeedback-table-caption-recentlows' ),
245269 array_merge(
246270 array( wfMsg( 'articleFeedback-table-heading-page' ) ),
247 - self::getCategories(),
 271+ $categories,
248272 array( wfMsg( 'articleFeedback-table-heading-average' ) )
249273 ),
250274 $rows,
@@ -415,7 +439,7 @@
416440 }
417441 $highs_lows[] = array(
418442 'page' => $row->afs_page_id,
419 - 'ratings' => FormatJson::decode( $row->afs_data ),
 443+ 'ratings' => FormatJson::decode( $row->afs_data, true ),
420444 'average' => $row->afs_orderable_data
421445 );
422446 }
@@ -435,7 +459,7 @@
436460 }
437461 $problems[] = array(
438462 'page' => $row->afs_page_id,
439 - 'ratings' => FormatJson::decode( $row->afs_data ),
 463+ 'ratings' => FormatJson::decode( $row->afs_data, true ),
440464 'average' => $row->afs_orderable_data
441465 );
442466 }
Index: branches/wmf/1.17wmf1/extensions/ArticleFeedback/ArticleFeedback.hooks.php
@@ -306,6 +306,7 @@
307307 $vars['wgArticleFeedbackTracking'] = $wgArticleFeedbackTracking;
308308 $vars['wgArticleFeedbackOptions'] = $wgArticleFeedbackOptions;
309309 $vars['wgArticleFeedbackNamespaces'] = $wgArticleFeedbackNamespaces;
 310+ $vars['wgArticleFeedbackWhatsThisPage'] = wfMsgForContent( 'articlefeedback-form-panel-explanation-link' );
310311 return true;
311312 }
312313
Index: branches/wmf/1.17wmf1/extensions/ArticleFeedback/populateAFStatistics.php
@@ -494,6 +494,11 @@
495495 * @param string $rating_set_hash
496496 */
497497 public function addRating( $rating_id, $rating_value, $rating_set_hash = null ) {
 498+ if ( intval( $rating_value ) == 0 ) {
 499+ // Ignore zero ratings
 500+ return;
 501+ }
 502+
498503 $this->ratings[ $rating_id ][] = $rating_value;
499504
500505 if ( $rating_set_hash ) {
Index: branches/wmf/1.17wmf1/extensions/ArticleFeedback/modules/jquery.articleFeedback/jquery.articleFeedback.js
@@ -505,7 +505,7 @@
506506 .end()
507507 .find( '.articleFeedback-explanation-link' )
508508 .attr( 'href', mw.config.get( 'wgArticlePath' ).replace(
509 - '$1', mw.msg( 'articlefeedback-form-panel-explanation-link' )
 509+ '$1', mw.config.get( 'wgArticleFeedbackWhatsThisPage' )
510510 ) )
511511 .end()
512512 .find( '.articleFeedback-pitches' )
Index: branches/wmf/1.17wmf1/extensions/ArticleFeedback/ArticleFeedback.i18n.php
@@ -106,6 +106,7 @@
107107 'articleFeedback-table-caption-recentlows' => 'Recent lows',
108108 'articleFeedback-table-heading-page' => 'Page',
109109 'articleFeedback-table-heading-average' => 'Average',
 110+ 'articlefeedback-table-noratings' => '-',
110111 'articleFeedback-copy-above-highlow-tables' => 'This is an experimental feature. Please provide feedback on the [$1 discussion page].',
111112 'articlefeedback-dashboard-bottom' => "'''Note''': We will continue to experiment with different ways of surfacing articles in these dashboards. At present, the dashboards include the following articles:
112113 * Pages with highest/lowest ratings: articles that have received at least 10 ratings within the last 24 hours. Averages are calculated by taking the mean of all ratings submitted within the last 24 hours.
@@ -179,6 +180,7 @@
180181 'articlefeedback-pitch-join-login' => '{{Identical|Log in}}',
181182 'articleFeedback-table-heading-page' => '{{Identical|Page}}',
182183 'articleFeedback-table-heading-average' => '{{Identical|Average}}',
 184+ 'articlefeedback-table-noratings' => 'Text to display in a table cell if there is no number to be shown',
183185 'articleFeedback-copy-above-highlow-tables' => 'The variable $1 will contain a full URL to a discussion page where the dashboard can be discussed - since the dashboard is powered by a special page, we can not rely on the built-in MediaWiki talk page.',
184186 );
185187
Index: branches/wmf/1.17wmf1/includes/Export.php
@@ -348,6 +348,9 @@
349349 * @ingroup Dump
350350 */
351351 class XmlDumpWriter {
 352+ var $firstPageWritten = 0;
 353+ var $lastPageWritten = 0;
 354+ var $pageInProgress = 0;
352355
353356 /**
354357 * Returns the export schema version.
@@ -451,7 +454,8 @@
452455 $title = Title::makeTitle( $row->page_namespace, $row->page_title );
453456 $out .= ' ' . Xml::elementClean( 'title', array(), $title->getPrefixedText() ) . "\n";
454457 $out .= ' ' . Xml::element( 'id', array(), strval( $row->page_id ) ) . "\n";
455 - if( $row->page_is_redirect ) {
 458+ $this->pageInProgress = $row->page_id;
 459+ if ( $row->page_is_redirect ) {
456460 $out .= ' ' . Xml::element( 'redirect', array() ) . "\n";
457461 }
458462 if( $row->page_restrictions != '' ) {
@@ -471,6 +475,10 @@
472476 */
473477 function closePage() {
474478 return " </page>\n";
 479+ if (! $this->firstPageWritten) {
 480+ $this->firstPageWritten = $this->pageInProgress;
 481+ }
 482+ $this->lastPageWritten = $this->pageInProgress;
475483 }
476484
477485 /**
@@ -660,6 +668,18 @@
661669 function write( $string ) {
662670 print $string;
663671 }
 672+
 673+ function closeRenameAndReopen( $newname ) {
 674+ return;
 675+ }
 676+
 677+ function rename( $newname ) {
 678+ return;
 679+ }
 680+
 681+ function getFilename() {
 682+ return NULL;
 683+ }
664684 }
665685
666686 /**
@@ -668,14 +688,56 @@
669689 */
670690 class DumpFileOutput extends DumpOutput {
671691 var $handle;
 692+ var $filename;
672693
673694 function __construct( $file ) {
674695 $this->handle = fopen( $file, "wt" );
 696+ $this->filename = $file;
675697 }
676698
677699 function write( $string ) {
678700 fputs( $this->handle, $string );
679701 }
 702+
 703+ /**
 704+ * Close the old file, move it to a specified name,
 705+ * and reopen new file with the old name. Use this
 706+ * for writing out a file in multiple pieces
 707+ * at specified checkpoints (e.g. every n hours).
 708+ */
 709+ function closeRenameAndReopen( $newname ) {
 710+ if ( is_array($newname) ) {
 711+ if (count($newname) > 1) {
 712+ throw new MWException("Export closeRenameAndReopen: passed multiple argumnts for rename of single file\n");
 713+ }
 714+ else {
 715+ $newname = $newname[0];
 716+ }
 717+ }
 718+ if ( $newname ) {
 719+ fclose( $this->handle );
 720+ rename( $this->filename, $newname );
 721+ $this->handle = fopen( $this->filename, "wt" );
 722+ }
 723+ }
 724+
 725+ function rename( $newname ) {
 726+ if ( is_array($newname) ) {
 727+ if (count($newname) > 1) {
 728+ throw new MWException("Export closeRenameAndReopen: passed multiple argumnts for rename of single file\n");
 729+ }
 730+ else {
 731+ $newname = $newname[0];
 732+ }
 733+ }
 734+ if ( $newname ) {
 735+ rename( $this->filename, $newname );
 736+ }
 737+ }
 738+
 739+ function getFilename() {
 740+ return $this->filename;
 741+ }
680742 }
681743
682744 /**
@@ -685,12 +747,52 @@
686748 * @ingroup Dump
687749 */
688750 class DumpPipeOutput extends DumpFileOutput {
 751+ var $command;
 752+
689753 function __construct( $command, $file = null ) {
690754 if( !is_null( $file ) ) {
691755 $command .= " > " . wfEscapeShellArg( $file );
692756 }
693757 $this->handle = popen( $command, "w" );
 758+ $this->command = $command;
 759+ $this->filename = $file;
694760 }
 761+
 762+ /**
 763+ * Close the old file, move it to a specified name,
 764+ * and reopen new file with the old name.
 765+ */
 766+ function closeRenameAndReopen( $newname ) {
 767+ if ( is_array($newname) ) {
 768+ if (count($newname) > 1) {
 769+ throw new MWException("Export closeRenameAndReopen: passed multiple argumnts for rename of single file\n");
 770+ }
 771+ else {
 772+ $newname = $newname[0];
 773+ }
 774+ }
 775+ if ( $newname ) {
 776+ pclose( $this->handle );
 777+ rename( $this->filename, $newname );
 778+ $command = $this->command;
 779+ $command .= " > " . wfEscapeShellArg( $this->filename );
 780+ $this->handle = popen( $command, "w" );
 781+ }
 782+ }
 783+
 784+ function rename( $newname ) {
 785+ if ( is_array($newname) ) {
 786+ if (count($newname) > 1) {
 787+ throw new MWException("Export closeRenameAndReopen: passed multiple argumnts for rename of single file\n");
 788+ }
 789+ else {
 790+ $newname = $newname[0];
 791+ }
 792+ }
 793+ if ( $newname ) {
 794+ rename( $this->filename, $newname );
 795+ }
 796+ }
695797 }
696798
697799 /**
@@ -718,13 +820,48 @@
719821 * @ingroup Dump
720822 */
721823 class Dump7ZipOutput extends DumpPipeOutput {
 824+ var $filename;
 825+
722826 function __construct( $file ) {
723827 $command = "7za a -bd -si " . wfEscapeShellArg( $file );
724828 // Suppress annoying useless crap from p7zip
725829 // Unfortunately this could suppress real error messages too
726830 $command .= ' >' . wfGetNull() . ' 2>&1';
727831 parent::__construct( $command );
 832+ $this->filename = $file;
728833 }
 834+
 835+ function closeRenameAndReopen( $newname ) {
 836+ if ( is_array($newname) ) {
 837+ if (count($newname) > 1) {
 838+ throw new MWException("Export closeRenameAndReopen: passed multiple argumnts for rename of single file\n");
 839+ }
 840+ else {
 841+ $newname = $newname[0];
 842+ }
 843+ }
 844+ if ( $newname ) {
 845+ pclose( $this->handle );
 846+ rename( $this->filename, $newname );
 847+ $command = "7za a -bd -si " . wfEscapeShellArg( $file );
 848+ $command .= ' >' . wfGetNull() . ' 2>&1';
 849+ $this->handle = popen( $command, "w" );
 850+ }
 851+ }
 852+
 853+ function rename( $newname ) {
 854+ if ( is_array($newname) ) {
 855+ if (count($newname) > 1) {
 856+ throw new MWException("Export closeRenameAndReopen: passed multiple argumnts for rename of single file\n");
 857+ }
 858+ else {
 859+ $newname = $newname[0];
 860+ }
 861+ }
 862+ if ( $newname ) {
 863+ rename( $this->filename, $newname );
 864+ }
 865+ }
729866 }
730867
731868
@@ -772,6 +909,18 @@
773910 $this->sink->writeRevision( $rev, $string );
774911 }
775912
 913+ function closeRenameAndReopen( $newname ) {
 914+ $this->sink->closeRenameAndReopen( $newname );
 915+ }
 916+
 917+ function rename( $newname ) {
 918+ $this->sink->rename( $newname );
 919+ }
 920+
 921+ function getFilename() {
 922+ return $this->sink->getFilename();
 923+ }
 924+
776925 /**
777926 * Override for page-based filter types.
778927 * @return bool
@@ -919,6 +1068,27 @@
9201069 $this->sinks[$i]->writeRevision( $rev, $string );
9211070 }
9221071 }
 1072+
 1073+ function closeRenameAndReopen( $newnames ) {
 1074+ for( $i = 0; $i < $this->count; $i++ ) {
 1075+ $this->sinks[$i]->closeRenameAndReopen( $newnames[$i] );
 1076+ }
 1077+ }
 1078+
 1079+ function rename( $newnames ) {
 1080+ for( $i = 0; $i < $this->count; $i++ ) {
 1081+ $this->sinks[$i]->rename( $newnames[$i] );
 1082+ }
 1083+ }
 1084+
 1085+ function getFilename() {
 1086+ $filenames = array();
 1087+ for( $i = 0; $i < $this->count; $i++ ) {
 1088+ $filenames[] = $this->sinks[$i]->getFilename();
 1089+ }
 1090+ return $filenames;
 1091+ }
 1092+
9231093 }
9241094
9251095 function xmlsafe( $string ) {
Index: branches/wmf/1.17wmf1/languages/messages/MessagesDtp.php
@@ -11,7 +11,7 @@
1212 * @author FRANELYA
1313 */
1414
15 -$fallback = 'ml';
 15+$fallback = 'ms';
1616
1717 $messages = array(
1818 # User preference toggles

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r94135Use workaround so the "What's this?" link goes to a page depending on the con...robin19:18, 9 August 2011
r95260add functions that support close and rename of output files as they are being...ariel22:01, 22 August 2011
r95311ArticleFeedback: Don't count zero-value ratings in the statistics used for th...catrope15:47, 23 August 2011
r95601replace WfDie()ariel15:50, 27 August 2011
r95790(bug 30611) Improve WikiEditor localization for Arabic script languages. Patc...siebrand16:22, 30 August 2011
r96434Correct fallback from Malayalam (ml) to Malay (ms) for Dusun (dtp) spoken in ...robin14:04, 7 September 2011

Status & tagging log