* glob() is horribly unreliable and doesn't work on some systems, including
authorBrion Vibber <brion@users.mediawiki.org>
Wed, 8 Aug 2007 23:08:54 +0000 (23:08 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Wed, 8 Aug 2007 23:08:54 +0000 (23:08 +0000)
  free.fr shared hosting. No longer using it in Language::getLanguageNames()

RELEASE-NOTES
languages/Language.php

index bbccd3b..b90e13b 100644 (file)
@@ -369,6 +369,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * Fix comments in contributions and log pages for RTL languages
 * Make installer include_path-independent, so it should work on hosts which
   disable user setting of PHP include_path setting
+* glob() is horribly unreliable and doesn't work on some systems, including
+  free.fr shared hosting. No longer using it in Language::getLanguageNames()
 
 
 == API changes since 1.10 ==
index 1da78d3..6862fd4 100644 (file)
@@ -338,9 +338,9 @@ class Language {
                }
                
                global $IP;
-               $messageFiles = glob( "$IP/languages/messages/Messages*.php" );
                $names = array();
-               foreach ( $messageFiles as $file ) {
+               $dir = opendir( "$IP/languages/messages" );
+               while( false !== ( $file = readdir( $dir ) ) ) {
                        $m = array();
                        if( preg_match( '/Messages([A-Z][a-z_]+)\.php$/', $file, $m ) ) {
                                $code = str_replace( '_', '-', strtolower( $m[1] ) );
@@ -349,6 +349,7 @@ class Language {
                                }
                        }
                }
+               closedir( $dir );
                return $names;
        }