r85437 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r85436‎ | r85437 | r85438 >
Date:14:29, 5 April 2011
Author:demon
Status:ok
Tags:
Comment:
MFT last couple of extension revs: r84664, r84921, r85202
Modified paths:
  • /branches/REL1_17/extensions/FlaggedRevs/maintenance (modified) (history)
  • /branches/REL1_17/extensions/FlaggedRevs/maintenance/fixBug28348.inc (added) (history)
  • /branches/REL1_17/extensions/FlaggedRevs/maintenance/fixBug28348.php (added) (history)
  • /branches/REL1_17/extensions/WikiEditor/modules/jquery.wikiEditor.dialogs.js (modified) (history)
  • /branches/REL1_17/extensions/cldr (modified) (history)
  • /branches/REL1_17/extensions/cldr/LanguageNames.body.php (modified) (history)
  • /branches/REL1_17/extensions/cldr/cldr.php (modified) (history)

Diff [purge]

Index: branches/REL1_17/extensions/cldr/cldr.php
@@ -1,7 +1,7 @@
22 <?php
33 if (!defined('MEDIAWIKI')) die();
44 /**
5 - * An extension which provised localised language names for other extensions.
 5+ * An extension which provides localised language names for other extensions.
66 *
77 * @file
88 * @ingroup Extensions
Index: branches/REL1_17/extensions/cldr/LanguageNames.body.php
@@ -12,8 +12,8 @@
1313 private static $cache = array();
1414
1515 const FALLBACK_NATIVE = 0; // Missing entries fallback to native name
16 - const FALLBACK_NORMAL = 1; // Missing entries fallback trough fallback chain
17 - const LIST_MW_SUPPORTED = 0; // Only names that has localisation in MediaWiki
 16+ const FALLBACK_NORMAL = 1; // Missing entries fallback through the fallback chain
 17+ const LIST_MW_SUPPORTED = 0; // Only names that have localisation in MediaWiki
1818 const LIST_MW = 1; // All names that are in Names.php
1919 const LIST_MW_AND_CLDR = 2; // Combination of Names.php and what is in cldr
2020
@@ -59,6 +59,7 @@
6060
6161 private static function loadLanguage( $code ) {
6262 if ( !isset(self::$cache[$code]) ) {
 63+ wfProfileIn( __METHOD__.'-recache' );
6364
6465 /** Load override for wrong or missing entries in cldr */
6566 $override = dirname(__FILE__) . '/' . self::getOverrideFileName( $code );
@@ -84,6 +85,7 @@
8586 } else {
8687 wfDebug( __METHOD__ . ": Unable to load language names for $filename\n" );
8788 }
 89+ wfProfileOut( __METHOD__.'-recache' );
8890 }
8991
9092 return isset( self::$cache[$code] ) ? self::$cache[$code] : array();
Property changes on: branches/REL1_17/extensions/cldr
___________________________________________________________________
Added: svn:mergeinfo
9193 Merged /trunk/extensions/cldr:r83817,84664
Index: branches/REL1_17/extensions/WikiEditor/modules/jquery.wikiEditor.dialogs.js
@@ -167,7 +167,7 @@
168168 $(this).css( 'white-space', 'nowrap' );
169169 if ( wrapper.width() <= $(this).get(0).scrollWidth ) {
170170 var thisWidth = $(this).data( 'thisWidth' ) ? $(this).data( 'thisWidth' ) : 0;
171 - thisWidth = Math.max( $(this).get(0).scrollWidth, thisWidth );
 171+ thisWidth = Math.max( $(this).get(0).width, thisWidth );
172172 $(this).width( thisWidth );
173173 $(this).data( 'thisWidth', thisWidth );
174174 var wrapperWidth = $(this).data( 'wrapperWidth' ) ? $(this).data( 'wrapperWidth' ) : 0;
Property changes on: branches/REL1_17/extensions/WikiEditor/modules/jquery.wikiEditor.dialogs.js
___________________________________________________________________
Added: svn:mergeinfo
175175 Merged /trunk/extensions/WikiEditor/modules/jquery.wikiEditor.dialogs.js:r82458,82554,82698,83816-83817,84921
Index: branches/REL1_17/extensions/FlaggedRevs/maintenance/fixBug28348.php
@@ -0,0 +1,34 @@
 2+<?php
 3+
 4+if ( getenv( 'MW_INSTALL_PATH' ) ) {
 5+ $IP = getenv( 'MW_INSTALL_PATH' );
 6+} else {
 7+ $IP = dirname(__FILE__).'/../../..';
 8+}
 9+
 10+$options = array( 'help', 'startrev' );
 11+require "$IP/maintenance/commandLine.inc";
 12+require dirname(__FILE__) . '/fixBug28348.inc';
 13+
 14+if ( isset($options['help']) ) {
 15+ echo <<<TEXT
 16+Purpose:
 17+ Correct bad fi_img_timestamp rows due to bug 28348
 18+Usage:
 19+ php updateLinks.php --help
 20+ php updateLinks.php [--startrev <ID>]
 21+
 22+ --help : This help message
 23+ --<ID> : The ID of the starting rev
 24+ --<CALL> : One of (revs)
 25+
 26+TEXT;
 27+ exit(0);
 28+}
 29+
 30+error_reporting( E_ALL );
 31+
 32+$startRev = isset( $options['startrev'] ) ?
 33+ (int)$options['startrev'] : null;
 34+
 35+update_images_bug_28348( $startRev );
Property changes on: branches/REL1_17/extensions/FlaggedRevs/maintenance/fixBug28348.php
___________________________________________________________________
Added: svn:eol-style
136 + native
Index: branches/REL1_17/extensions/FlaggedRevs/maintenance/fixBug28348.inc
@@ -0,0 +1,64 @@
 2+<?php
 3+
 4+function update_images_bug_28348( $start = null ) {
 5+ echo "Correcting fi_img_timestamp column in flaggedimages\n";
 6+
 7+ $BATCH_SIZE = 1000;
 8+
 9+ $db = wfGetDB( DB_MASTER );
 10+
 11+ if( $start === null ) {
 12+ $start = $db->selectField( 'flaggedimages', 'MIN(fi_rev_id)', false, __FUNCTION__ );
 13+ }
 14+ $end = $db->selectField( 'flaggedimages', 'MAX(fi_rev_id)', false, __FUNCTION__ );
 15+ if( is_null( $start ) || is_null( $end ) ) {
 16+ echo "...flaggedimages table seems to be empty.\n";
 17+ return;
 18+ }
 19+ # Do remaining chunk
 20+ $end += $BATCH_SIZE - 1;
 21+ $blockStart = $start;
 22+ $blockEnd = $start + $BATCH_SIZE - 1;
 23+
 24+ $count = $changed = 0;
 25+ while( $blockEnd <= $end ) {
 26+ echo "...doing fi_rev_id from $blockStart to $blockEnd\n";
 27+ $cond = "fi_rev_id BETWEEN $blockStart AND $blockEnd";
 28+ $res = $db->select( 'flaggedimages', '*', $cond, __FUNCTION__ );
 29+
 30+ $db->begin();
 31+ # Go through and clean up missing items, as well as correct fr_quality...
 32+ foreach( $res as $row ) {
 33+ $count++;
 34+ $fi_img_timestamp = trim( $row->fi_img_timestamp ); // clear pad garbage
 35+ if ( !$fi_img_timestamp ) {
 36+ continue; // nothing to check
 37+ }
 38+ $time = wfTimestamp( TS_MW, $fi_img_timestamp );
 39+ $sha1 = $row->fi_img_sha1;
 40+ # Check if the specified file exists...
 41+ $file = RepoGroup::singleton()->findFileFromKey( $sha1, array( 'time' => $time ) );
 42+ if ( !$file ) { // doesn't exist?
 43+ $time = wfTimestamp( TS_MW, wfTimestamp( TS_UNIX, $time ) + 1 );
 44+ # Check if the fi_img_timestamp value is off by 1 second...
 45+ $file = RepoGroup::singleton()->findFileFromKey( $sha1, array( 'time' => $time ) );
 46+ if ( $file ) {
 47+ echo "fixed file {$row->fi_name} reference in rev ID {$row->fi_rev_id}\n";
 48+ # Fix the fi_img_timestamp value...
 49+ $dbw->update( 'flaggedimages',
 50+ array( 'fi_img_timestamp' => $dbw->timestamp( $time ) ),
 51+ array( 'fi_rev_id' => $row->fi_rev_id, 'fi_name' => $row->fi_name ),
 52+ __METHOD__
 53+ );
 54+ $changed++;
 55+ }
 56+ }
 57+ }
 58+ $db->commit();
 59+ $db->freeResult( $res );
 60+ $blockStart += $BATCH_SIZE;
 61+ $blockEnd += $BATCH_SIZE;
 62+ wfWaitForSlaves( 5 );
 63+ }
 64+ echo "fi_img_timestamp column fixes complete ... {$count} rows [{$changed} changed]\n";
 65+}
Property changes on: branches/REL1_17/extensions/FlaggedRevs/maintenance/fixBug28348.inc
___________________________________________________________________
Added: svn:eol-style
166 + native
Property changes on: branches/REL1_17/extensions/FlaggedRevs/maintenance
___________________________________________________________________
Added: svn:mergeinfo
267 Merged /branches/chad-pre-wmf-merge/extensions/FlaggedRevs/maintenance:r76925
368 Merged /branches/wmf/1.17wmf1/extensions/FlaggedRevs/maintenance:r82225
469 Merged /trunk/extensions/FlaggedRevs/maintenance:r78027,78042,78044,78051,78092,78140,78142,78163,78166,78213,78226,78293,78319,78346,78517,78520,79872-79873,80297,82226,82537,82917,82919,82923,83817,84365,84454,84598,85202

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r84664* Fixed a few comments....tstarling04:08, 24 March 2011
r84921Because this element has margins, the scrollWidth will be larger by definitio...hartman21:11, 28 March 2011
r85202Added bug 28348 cleanup scriptaaron17:57, 2 April 2011

Status & tagging log