Index: branches/wmf/1.17wmf1/extensions/WikiEditor/WikiEditor.php |
— | — | @@ -400,6 +400,7 @@ |
401 | 401 | 'wikieditor-toolbar-characters-page-greek', |
402 | 402 | 'wikieditor-toolbar-characters-page-cyrillic', |
403 | 403 | 'wikieditor-toolbar-characters-page-arabic', |
| 404 | + 'wikieditor-toolbar-characters-page-arabicextended', |
404 | 405 | 'wikieditor-toolbar-characters-page-persian', |
405 | 406 | 'wikieditor-toolbar-characters-page-hebrew', |
406 | 407 | 'wikieditor-toolbar-characters-page-bangla', |
Index: branches/wmf/1.17wmf1/extensions/WikiEditor/modules/ext.wikiEditor.toolbar.js |
— | — | @@ -626,19 +626,108 @@ |
627 | 627 | "\u042f", "\u044f" |
628 | 628 | ] |
629 | 629 | }, |
| 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. |
630 | 633 | 'arabic': { |
631 | 634 | 'labelMsg': 'wikieditor-toolbar-characters-page-arabic', |
632 | 635 | 'layout': 'characters', |
633 | 636 | 'language': 'ar', |
634 | 637 | 'direction': 'rtl', |
635 | 638 | '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" |
641 | 659 | ] |
642 | 660 | }, |
| 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 | + }, |
643 | 732 | 'hebrew': { |
644 | 733 | 'labelMsg': 'wikieditor-toolbar-characters-page-hebrew', |
645 | 734 | 'layout': 'characters', |
Property changes on: branches/wmf/1.17wmf1/extensions/WikiEditor/modules/ext.wikiEditor.toolbar.js |
___________________________________________________________________ |
Added: svn:mergeinfo |
646 | 735 | Merged /branches/new-installer/phase3/extensions/WikiEditor/modules/ext.wikiEditor.toolbar.js:r43664-66004 |
647 | 736 | Merged /branches/wmf-deployment/extensions/WikiEditor/modules/ext.wikiEditor.toolbar.js:r60970 |
648 | 737 | Merged /branches/REL1_15/phase3/extensions/WikiEditor/modules/ext.wikiEditor.toolbar.js:r51646 |
649 | 738 | Merged /branches/wmf/1.16wmf4/extensions/WikiEditor/modules/ext.wikiEditor.toolbar.js:r67177,69199,76243,77266 |
650 | 739 | Merged /trunk/extensions/WikiEditor/modules/ext.wikiEditor.toolbar.js:r83817,94135,95260,95311,95340,95601,95790,96434 |
651 | 740 | Merged /branches/sqlite/extensions/WikiEditor/modules/ext.wikiEditor.toolbar.js:r58211-58321 |
652 | 741 | Merged /trunk/extensions/WikiEditor/modules/jquery.wikiEditor.toolbar.config.js:r95790 |
653 | 742 | 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 @@ |
185 | 185 | 'wikieditor-toolbar-characters-page-greek' => 'Greek', |
186 | 186 | 'wikieditor-toolbar-characters-page-cyrillic' => 'Cyrillic', |
187 | 187 | 'wikieditor-toolbar-characters-page-arabic' => 'Arabic', |
| 188 | + 'wikieditor-toolbar-characters-page-arabicextended' => 'Arabic extended', |
188 | 189 | 'wikieditor-toolbar-characters-page-persian' => 'Persian', |
189 | 190 | 'wikieditor-toolbar-characters-page-hebrew' => 'Hebrew', |
190 | 191 | 'wikieditor-toolbar-characters-page-bangla' => 'Bangla', |
Index: branches/wmf/1.17wmf1/extensions/ArticleFeedback/SpecialArticleFeedback.php |
— | — | @@ -119,6 +119,8 @@ |
120 | 120 | $ids[] = $page['page']; |
121 | 121 | } |
122 | 122 | self::populateTitleCache( $ids ); |
| 123 | + |
| 124 | + $categories = self::getCategories(); |
123 | 125 | |
124 | 126 | $rows = array(); |
125 | 127 | if ( $pages ) { |
— | — | @@ -129,12 +131,19 @@ |
130 | 132 | continue; |
131 | 133 | } |
132 | 134 | $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 | + } |
134 | 143 | $row[] = array( |
135 | | - 'text' => $this->formatNumber( $value ), |
| 144 | + 'text' => $number, |
136 | 145 | 'attr' => array( |
137 | 146 | 'class' => 'articleFeedback-table-column-rating ' . |
138 | | - 'articleFeedback-table-column-score-' . round( $value ) |
| 147 | + 'articleFeedback-table-column-score-' . $class |
139 | 148 | ) |
140 | 149 | ); |
141 | 150 | } |
— | — | @@ -153,7 +162,7 @@ |
154 | 163 | $caption, |
155 | 164 | array_merge( |
156 | 165 | array( wfMsg( 'articleFeedback-table-heading-page' ) ), |
157 | | - self::getCategories(), |
| 166 | + $categories, |
158 | 167 | array( wfMsg( 'articleFeedback-table-heading-average' ) ) |
159 | 168 | ), |
160 | 169 | $rows, |
— | — | @@ -168,15 +177,22 @@ |
169 | 178 | */ |
170 | 179 | protected function renderWeeklyMostChanged() { |
171 | 180 | global $wgOut, $wgUser; |
| 181 | + |
| 182 | + $categories = self::getCategories(); |
172 | 183 | |
173 | 184 | $rows = array(); |
174 | 185 | foreach ( $this->getWeeklyMostChanged() as $page ) { |
175 | 186 | $row = array(); |
176 | 187 | $pageTitle = Title::newFromText( $page['page'] ); |
177 | 188 | $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 | + } |
179 | 195 | $row[] = array( |
180 | | - 'text' => $this->formatNumber( $value ), |
| 196 | + 'text' => $number, |
181 | 197 | 'attr' => array( |
182 | 198 | 'class' => 'articleFeedback-table-column-changes' |
183 | 199 | ) |
— | — | @@ -188,7 +204,7 @@ |
189 | 205 | wfMsg( 'articleFeedback-table-caption-weeklymostchanged' ), |
190 | 206 | array_merge( |
191 | 207 | array( wfMsg( 'articleFeedback-table-heading-page' ) ), |
192 | | - self::getCategories() |
| 208 | + $categories |
193 | 209 | ), |
194 | 210 | $rows, |
195 | 211 | 'articleFeedback-table-weeklymostchanged' |
— | — | @@ -205,6 +221,7 @@ |
206 | 222 | |
207 | 223 | |
208 | 224 | $problems = $this->getProblems(); |
| 225 | + $categories = self::getCategories(); |
209 | 226 | |
210 | 227 | // Pre-fill page ID cache |
211 | 228 | $ids = array(); |
— | — | @@ -221,12 +238,19 @@ |
222 | 239 | continue; |
223 | 240 | } |
224 | 241 | $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 | + } |
226 | 250 | $row[] = array( |
227 | | - 'text' => $this->formatNumber( $value ), |
| 251 | + 'text' => $number, |
228 | 252 | 'attr' => array( |
229 | 253 | 'class' => 'articleFeedback-table-column-rating ' . |
230 | | - 'articleFeedback-table-column-score-' . round( $value ) |
| 254 | + 'articleFeedback-table-column-score-' . $class |
231 | 255 | ) |
232 | 256 | ); |
233 | 257 | } |
— | — | @@ -243,7 +267,7 @@ |
244 | 268 | wfMsg( 'articleFeedback-table-caption-recentlows' ), |
245 | 269 | array_merge( |
246 | 270 | array( wfMsg( 'articleFeedback-table-heading-page' ) ), |
247 | | - self::getCategories(), |
| 271 | + $categories, |
248 | 272 | array( wfMsg( 'articleFeedback-table-heading-average' ) ) |
249 | 273 | ), |
250 | 274 | $rows, |
— | — | @@ -415,7 +439,7 @@ |
416 | 440 | } |
417 | 441 | $highs_lows[] = array( |
418 | 442 | 'page' => $row->afs_page_id, |
419 | | - 'ratings' => FormatJson::decode( $row->afs_data ), |
| 443 | + 'ratings' => FormatJson::decode( $row->afs_data, true ), |
420 | 444 | 'average' => $row->afs_orderable_data |
421 | 445 | ); |
422 | 446 | } |
— | — | @@ -435,7 +459,7 @@ |
436 | 460 | } |
437 | 461 | $problems[] = array( |
438 | 462 | 'page' => $row->afs_page_id, |
439 | | - 'ratings' => FormatJson::decode( $row->afs_data ), |
| 463 | + 'ratings' => FormatJson::decode( $row->afs_data, true ), |
440 | 464 | 'average' => $row->afs_orderable_data |
441 | 465 | ); |
442 | 466 | } |
Index: branches/wmf/1.17wmf1/extensions/ArticleFeedback/ArticleFeedback.hooks.php |
— | — | @@ -306,6 +306,7 @@ |
307 | 307 | $vars['wgArticleFeedbackTracking'] = $wgArticleFeedbackTracking; |
308 | 308 | $vars['wgArticleFeedbackOptions'] = $wgArticleFeedbackOptions; |
309 | 309 | $vars['wgArticleFeedbackNamespaces'] = $wgArticleFeedbackNamespaces; |
| 310 | + $vars['wgArticleFeedbackWhatsThisPage'] = wfMsgForContent( 'articlefeedback-form-panel-explanation-link' ); |
310 | 311 | return true; |
311 | 312 | } |
312 | 313 | |
Index: branches/wmf/1.17wmf1/extensions/ArticleFeedback/populateAFStatistics.php |
— | — | @@ -494,6 +494,11 @@ |
495 | 495 | * @param string $rating_set_hash |
496 | 496 | */ |
497 | 497 | 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 | + |
498 | 503 | $this->ratings[ $rating_id ][] = $rating_value; |
499 | 504 | |
500 | 505 | if ( $rating_set_hash ) { |
Index: branches/wmf/1.17wmf1/extensions/ArticleFeedback/modules/jquery.articleFeedback/jquery.articleFeedback.js |
— | — | @@ -505,7 +505,7 @@ |
506 | 506 | .end() |
507 | 507 | .find( '.articleFeedback-explanation-link' ) |
508 | 508 | .attr( 'href', mw.config.get( 'wgArticlePath' ).replace( |
509 | | - '$1', mw.msg( 'articlefeedback-form-panel-explanation-link' ) |
| 509 | + '$1', mw.config.get( 'wgArticleFeedbackWhatsThisPage' ) |
510 | 510 | ) ) |
511 | 511 | .end() |
512 | 512 | .find( '.articleFeedback-pitches' ) |
Index: branches/wmf/1.17wmf1/extensions/ArticleFeedback/ArticleFeedback.i18n.php |
— | — | @@ -106,6 +106,7 @@ |
107 | 107 | 'articleFeedback-table-caption-recentlows' => 'Recent lows', |
108 | 108 | 'articleFeedback-table-heading-page' => 'Page', |
109 | 109 | 'articleFeedback-table-heading-average' => 'Average', |
| 110 | + 'articlefeedback-table-noratings' => '-', |
110 | 111 | 'articleFeedback-copy-above-highlow-tables' => 'This is an experimental feature. Please provide feedback on the [$1 discussion page].', |
111 | 112 | '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: |
112 | 113 | * 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 @@ |
180 | 181 | 'articlefeedback-pitch-join-login' => '{{Identical|Log in}}', |
181 | 182 | 'articleFeedback-table-heading-page' => '{{Identical|Page}}', |
182 | 183 | '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', |
183 | 185 | '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.', |
184 | 186 | ); |
185 | 187 | |
Index: branches/wmf/1.17wmf1/includes/Export.php |
— | — | @@ -348,6 +348,9 @@ |
349 | 349 | * @ingroup Dump |
350 | 350 | */ |
351 | 351 | class XmlDumpWriter { |
| 352 | + var $firstPageWritten = 0; |
| 353 | + var $lastPageWritten = 0; |
| 354 | + var $pageInProgress = 0; |
352 | 355 | |
353 | 356 | /** |
354 | 357 | * Returns the export schema version. |
— | — | @@ -451,7 +454,8 @@ |
452 | 455 | $title = Title::makeTitle( $row->page_namespace, $row->page_title ); |
453 | 456 | $out .= ' ' . Xml::elementClean( 'title', array(), $title->getPrefixedText() ) . "\n"; |
454 | 457 | $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 ) { |
456 | 460 | $out .= ' ' . Xml::element( 'redirect', array() ) . "\n"; |
457 | 461 | } |
458 | 462 | if( $row->page_restrictions != '' ) { |
— | — | @@ -471,6 +475,10 @@ |
472 | 476 | */ |
473 | 477 | function closePage() { |
474 | 478 | return " </page>\n"; |
| 479 | + if (! $this->firstPageWritten) { |
| 480 | + $this->firstPageWritten = $this->pageInProgress; |
| 481 | + } |
| 482 | + $this->lastPageWritten = $this->pageInProgress; |
475 | 483 | } |
476 | 484 | |
477 | 485 | /** |
— | — | @@ -660,6 +668,18 @@ |
661 | 669 | function write( $string ) { |
662 | 670 | print $string; |
663 | 671 | } |
| 672 | + |
| 673 | + function closeRenameAndReopen( $newname ) { |
| 674 | + return; |
| 675 | + } |
| 676 | + |
| 677 | + function rename( $newname ) { |
| 678 | + return; |
| 679 | + } |
| 680 | + |
| 681 | + function getFilename() { |
| 682 | + return NULL; |
| 683 | + } |
664 | 684 | } |
665 | 685 | |
666 | 686 | /** |
— | — | @@ -668,14 +688,56 @@ |
669 | 689 | */ |
670 | 690 | class DumpFileOutput extends DumpOutput { |
671 | 691 | var $handle; |
| 692 | + var $filename; |
672 | 693 | |
673 | 694 | function __construct( $file ) { |
674 | 695 | $this->handle = fopen( $file, "wt" ); |
| 696 | + $this->filename = $file; |
675 | 697 | } |
676 | 698 | |
677 | 699 | function write( $string ) { |
678 | 700 | fputs( $this->handle, $string ); |
679 | 701 | } |
| 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 | + } |
680 | 742 | } |
681 | 743 | |
682 | 744 | /** |
— | — | @@ -685,12 +747,52 @@ |
686 | 748 | * @ingroup Dump |
687 | 749 | */ |
688 | 750 | class DumpPipeOutput extends DumpFileOutput { |
| 751 | + var $command; |
| 752 | + |
689 | 753 | function __construct( $command, $file = null ) { |
690 | 754 | if( !is_null( $file ) ) { |
691 | 755 | $command .= " > " . wfEscapeShellArg( $file ); |
692 | 756 | } |
693 | 757 | $this->handle = popen( $command, "w" ); |
| 758 | + $this->command = $command; |
| 759 | + $this->filename = $file; |
694 | 760 | } |
| 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 | + } |
695 | 797 | } |
696 | 798 | |
697 | 799 | /** |
— | — | @@ -718,13 +820,48 @@ |
719 | 821 | * @ingroup Dump |
720 | 822 | */ |
721 | 823 | class Dump7ZipOutput extends DumpPipeOutput { |
| 824 | + var $filename; |
| 825 | + |
722 | 826 | function __construct( $file ) { |
723 | 827 | $command = "7za a -bd -si " . wfEscapeShellArg( $file ); |
724 | 828 | // Suppress annoying useless crap from p7zip |
725 | 829 | // Unfortunately this could suppress real error messages too |
726 | 830 | $command .= ' >' . wfGetNull() . ' 2>&1'; |
727 | 831 | parent::__construct( $command ); |
| 832 | + $this->filename = $file; |
728 | 833 | } |
| 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 | + } |
729 | 866 | } |
730 | 867 | |
731 | 868 | |
— | — | @@ -772,6 +909,18 @@ |
773 | 910 | $this->sink->writeRevision( $rev, $string ); |
774 | 911 | } |
775 | 912 | |
| 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 | + |
776 | 925 | /** |
777 | 926 | * Override for page-based filter types. |
778 | 927 | * @return bool |
— | — | @@ -919,6 +1068,27 @@ |
920 | 1069 | $this->sinks[$i]->writeRevision( $rev, $string ); |
921 | 1070 | } |
922 | 1071 | } |
| 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 | + |
923 | 1093 | } |
924 | 1094 | |
925 | 1095 | function xmlsafe( $string ) { |
Index: branches/wmf/1.17wmf1/languages/messages/MessagesDtp.php |
— | — | @@ -11,7 +11,7 @@ |
12 | 12 | * @author FRANELYA |
13 | 13 | */ |
14 | 14 | |
15 | | -$fallback = 'ml'; |
| 15 | +$fallback = 'ms'; |
16 | 16 | |
17 | 17 | $messages = array( |
18 | 18 | # User preference toggles |