Index: trunk/phase3/maintenance/dumpHTML.inc |
— | — | @@ -124,13 +124,13 @@ |
125 | 125 | return; |
126 | 126 | } |
127 | 127 | $this->doArticles(); |
128 | | - $this->doLocalImageDescriptions(); |
129 | | - $this->doSharedImageDescriptions(); |
130 | 128 | $this->doCategories(); |
131 | 129 | $this->doRedirects(); |
132 | 130 | if ( $this->sliceNumerator == 1 ) { |
133 | 131 | $this->doSpecials(); |
134 | 132 | } |
| 133 | + $this->doLocalImageDescriptions(); |
| 134 | + $this->doSharedImageDescriptions(); |
135 | 135 | |
136 | 136 | $this->setCheckpoint( 'everything', 'done' ); |
137 | 137 | } |
— | — | @@ -309,19 +309,23 @@ |
310 | 310 | for ( $hash = $start; $hash <= $end; $hash++ ) { |
311 | 311 | $this->setCheckpoint( 'shared image', $hash ); |
312 | 312 | |
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 | + } |
319 | 320 | if ( !(++$i % REPORTING_INTERVAL ) ) { |
320 | 321 | print "$i\r"; |
321 | 322 | } |
322 | 323 | |
323 | | - $title = Title::makeTitle( NS_IMAGE, $file ); |
| 324 | + $title = Title::makeTitleSafe( NS_IMAGE, $file ); |
324 | 325 | $this->doArticle( $title ); |
325 | 326 | } |
| 327 | + if ( $handle ) { |
| 328 | + closedir( $handle ); |
| 329 | + } |
326 | 330 | } |
327 | 331 | $this->setCheckpoint( 'shared image', 'done' ); |
328 | 332 | print "\n"; |