Index: trunk/phase3/includes/filerepo/LocalFile.php |
— | — | @@ -599,19 +599,9 @@ |
600 | 600 | $dir = $this->getThumbPath(); |
601 | 601 | |
602 | 602 | if ( is_dir( $dir ) ) { |
603 | | - $handle = opendir( $dir ); |
604 | | - |
605 | | - if ( $handle ) { |
606 | | - while ( false !== ( $file = readdir( $handle ) ) ) { |
607 | | - if ( $file { 0 } != '.' ) { |
608 | | - $files[] = $file; |
609 | | - } |
610 | | - } |
611 | | - |
612 | | - closedir( $handle ); |
613 | | - } |
| 603 | + $files = array_map( 'basename', sfFinder::type('file')->maxdepth(0)->discard('.*')->in($dir) ); |
614 | 604 | } |
615 | | - |
| 605 | + |
616 | 606 | return $files; |
617 | 607 | } |
618 | 608 | |
Index: trunk/phase3/includes/filerepo/ForeignAPIFile.php |
— | — | @@ -168,16 +168,9 @@ |
169 | 169 | $files = array(); |
170 | 170 | $dir = $this->getThumbPath( $this->getName() ); |
171 | 171 | if ( is_dir( $dir ) ) { |
172 | | - $handle = opendir( $dir ); |
173 | | - if ( $handle ) { |
174 | | - while ( false !== ( $file = readdir($handle) ) ) { |
175 | | - if ( $file{0} != '.' ) { |
176 | | - $files[] = $file; |
177 | | - } |
178 | | - } |
179 | | - closedir( $handle ); |
180 | | - } |
| 172 | + $files = array_map( 'basename', sfFinder::type('file')->maxdepth(0)->discard('.*')->in($dir) ); |
181 | 173 | } |
| 174 | + |
182 | 175 | return $files; |
183 | 176 | } |
184 | 177 | |
Index: trunk/phase3/includes/AutoLoader.php |
— | — | @@ -476,7 +476,10 @@ |
477 | 477 | # includes/libs |
478 | 478 | 'IEContentAnalyzer' => 'includes/libs/IEContentAnalyzer.php', |
479 | 479 | 'Spyc' => 'includes/libs/spyc.php', |
480 | | - |
| 480 | + 'sfFinder' => 'includes/libs/sfFinder.php', |
| 481 | + 'sfGlobToRegex' => 'includes/libs/sfFinder.php', |
| 482 | + 'sfNumberCompare' => 'includes/libs/sfFinder.php', |
| 483 | + |
481 | 484 | # includes/media |
482 | 485 | 'BitmapHandler' => 'includes/media/Bitmap.php', |
483 | 486 | 'BitmapHandler_ClientOnly' => 'includes/media/Bitmap_ClientOnly.php', |
Index: trunk/phase3/languages/Language.php |
— | — | @@ -476,14 +476,14 @@ |
477 | 477 | |
478 | 478 | global $IP; |
479 | 479 | $names = array(); |
480 | | - $dir = opendir( "$IP/languages/messages" ); |
481 | | - while ( false !== ( $file = readdir( $dir ) ) ) { |
| 480 | + |
| 481 | + foreach( sfFinder::type('file')->maxdepth(0)->in( "$IP/languages/messages" ) as $file ) { |
482 | 482 | $code = self::getCodeFromFileName( $file, 'Messages' ); |
483 | 483 | if ( $code && isset( $allNames[$code] ) ) { |
484 | 484 | $names[$code] = $allNames[$code]; |
485 | 485 | } |
486 | 486 | } |
487 | | - closedir( $dir ); |
| 487 | + |
488 | 488 | return $names; |
489 | 489 | } |
490 | 490 | |