Let's try limiting the language object cache... see if that fixes our problem with...
authorBrion Vibber <brion@users.mediawiki.org>
Tue, 25 Nov 2008 19:38:22 +0000 (19:38 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Tue, 25 Nov 2008 19:38:22 +0000 (19:38 +0000)
languages/Language.php

index 8e4c576..49a37ea 100644 (file)
@@ -135,6 +135,10 @@ class Language {
         */
        static function factory( $code ) {
                if ( !isset( self::$mLangObjCache[$code] ) ) {
+                       if( count( self::$mLangObjCache ) > 10 ) {
+                               // Don't keep a billion objects around, that's stupid.
+                               self::$mLangObjCache = array();
+                       }
                        self::$mLangObjCache[$code] = self::newFromCode( $code );
                }
                return self::$mLangObjCache[$code];