Remove $wgColorErrors. Apparently unused at least since r17991 at 2006-11-29
[lhc/web/wiklou.git] / includes / LocalisationCache.php
index efe5ab8..12925b6 100644 (file)
@@ -232,6 +232,28 @@ class LocalisationCache {
                }
        }
 
+       /**
+        * Get the list of subitem keys for a given item.
+        *
+        * This is faster than array_keys($lc->getItem(...)) for the items listed in 
+        * self::$splitKeys.
+        *
+        * Will return null if the item is not found, or false if the item is not an 
+        * array.
+        */
+       public function getSubitemList( $code, $key ) {
+               if ( in_array( $key, self::$splitKeys ) ) {
+                       return $this->getSubitem( $code, 'list', $key );
+               } else {
+                       $item = $this->getItem( $code, $key );
+                       if ( is_array( $item ) ) {
+                               return array_keys( $item );
+                       } else {
+                               return false;
+                       }
+               }
+       }
+
        /**
         * Load an item into the cache.
         */
@@ -564,9 +586,6 @@ class LocalisationCache {
                        $allData['defaultUserOptionOverrides'] = array();
                }
 
-               # Set the preload key
-               $allData['preload'] = $this->buildPreload( $allData );
-
                # Set the list keys
                $allData['list'] = array();
                foreach ( self::$splitKeys as $key ) {
@@ -581,6 +600,9 @@ class LocalisationCache {
                                'Check that your languages/messages/MessagesEn.php file is intact.' );
                }
 
+               # Set the preload key
+               $allData['preload'] = $this->buildPreload( $allData );
+
                # Save to the process cache and register the items loaded
                $this->data[$code] = $allData;
                foreach ( $allData as $key => $item ) {