r17695 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r17694‎ | r17695 | r17696 >
Date:05:43, 15 November 2006
Author:tstarling
Status:old
Tags:
Comment:
A few small changes
Modified paths:
  • /trunk/phase3/maintenance/dumpHTML.inc (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/dumpHTML.inc
@@ -124,13 +124,13 @@
125125 return;
126126 }
127127 $this->doArticles();
128 - $this->doLocalImageDescriptions();
129 - $this->doSharedImageDescriptions();
130128 $this->doCategories();
131129 $this->doRedirects();
132130 if ( $this->sliceNumerator == 1 ) {
133131 $this->doSpecials();
134132 }
 133+ $this->doLocalImageDescriptions();
 134+ $this->doSharedImageDescriptions();
135135
136136 $this->setCheckpoint( 'everything', 'done' );
137137 }
@@ -309,19 +309,23 @@
310310 for ( $hash = $start; $hash <= $end; $hash++ ) {
311311 $this->setCheckpoint( 'shared image', $hash );
312312
313 - $dir = sprintf( "%01x/%02x", intval( $hash / 16 ), $hash );
314 - $paths = array_merge( glob( "{$this->sharedStaticDirectory}/$dir/*" ),
315 - glob( "{$this->sharedStaticDirectory}/thumb/$dir/*" ) );
316 -
317 - foreach ( $paths as $path ) {
318 - $file = wfBaseName( $path );
 313+ $dir = sprintf( "%s/%01x/%02x", $this->sharedStaticDirectory,
 314+ intval( $hash / 16 ), $hash );
 315+ $handle = @opendir( $dir );
 316+ while ( $handle && $file = readdir( $handle ) ) {
 317+ if ( $file[0] == '.' ) {
 318+ continue;
 319+ }
319320 if ( !(++$i % REPORTING_INTERVAL ) ) {
320321 print "$i\r";
321322 }
322323
323 - $title = Title::makeTitle( NS_IMAGE, $file );
 324+ $title = Title::makeTitleSafe( NS_IMAGE, $file );
324325 $this->doArticle( $title );
325326 }
 327+ if ( $handle ) {
 328+ closedir( $handle );
 329+ }
326330 }
327331 $this->setCheckpoint( 'shared image', 'done' );
328332 print "\n";