From: Tim Starling Date: Wed, 15 Nov 2006 05:43:04 +0000 (+0000) Subject: A few small changes X-Git-Tag: 1.31.0-rc.0~55185 X-Git-Url: http://git.cyclocoop.org/%24href?a=commitdiff_plain;h=b7811795c47142dab37fa574c8b97afca95a4fba;p=lhc%2Fweb%2Fwiklou.git A few small changes --- diff --git a/maintenance/dumpHTML.inc b/maintenance/dumpHTML.inc index 0f6e62c271..8213fa9b5a 100644 --- a/maintenance/dumpHTML.inc +++ b/maintenance/dumpHTML.inc @@ -124,13 +124,13 @@ class DumpHTML { return; } $this->doArticles(); - $this->doLocalImageDescriptions(); - $this->doSharedImageDescriptions(); $this->doCategories(); $this->doRedirects(); if ( $this->sliceNumerator == 1 ) { $this->doSpecials(); } + $this->doLocalImageDescriptions(); + $this->doSharedImageDescriptions(); $this->setCheckpoint( 'everything', 'done' ); } @@ -309,19 +309,23 @@ class DumpHTML { for ( $hash = $start; $hash <= $end; $hash++ ) { $this->setCheckpoint( 'shared image', $hash ); - $dir = sprintf( "%01x/%02x", intval( $hash / 16 ), $hash ); - $paths = array_merge( glob( "{$this->sharedStaticDirectory}/$dir/*" ), - glob( "{$this->sharedStaticDirectory}/thumb/$dir/*" ) ); - - foreach ( $paths as $path ) { - $file = wfBaseName( $path ); + $dir = sprintf( "%s/%01x/%02x", $this->sharedStaticDirectory, + intval( $hash / 16 ), $hash ); + $handle = @opendir( $dir ); + while ( $handle && $file = readdir( $handle ) ) { + if ( $file[0] == '.' ) { + continue; + } if ( !(++$i % REPORTING_INTERVAL ) ) { print "$i\r"; } - $title = Title::makeTitle( NS_IMAGE, $file ); + $title = Title::makeTitleSafe( NS_IMAGE, $file ); $this->doArticle( $title ); } + if ( $handle ) { + closedir( $handle ); + } } $this->setCheckpoint( 'shared image', 'done' ); print "\n";