Some cleanup work
authorTrevor Parscal <tparscal@users.mediawiki.org>
Tue, 19 Oct 2010 23:47:56 +0000 (23:47 +0000)
committerTrevor Parscal <tparscal@users.mediawiki.org>
Tue, 19 Oct 2010 23:47:56 +0000 (23:47 +0000)
includes/resourceloader/ResourceLoaderFileModule.php

index 54811a4..02d38b0 100644 (file)
@@ -226,22 +226,24 @@ class ResourceLoaderFileModule extends ResourceLoaderModule {
                }
                wfProfileIn( __METHOD__ );
                
-               // Sort of nasty way we can get a flat list of files depended on by all styles
-               $styles = array();
-               foreach ( self::collateFilePathListByOption( $this->styles, 'media', 'all' ) as $styleFiles ) {
-                       $styles = array_merge( $styles, $styleFiles );
+               $files = array();
+               
+               // Flatten style files into $files
+               $styles = self::collateFilePathListByOption( $this->styles, 'media', 'all' );
+               foreach ( $styles as $styleFiles ) {
+                       $files = array_merge( $files, $styleFiles );
                }
                $skinFiles = self::tryForKey(
                        self::collateFilePathListByOption( $this->skinStyles, 'media', 'all' ), $context->getSkin(), 'default'
                );
                foreach ( $skinFiles as $styleFiles ) {
-                       $styles = array_merge( $styles, $styleFiles );
+                       $files = array_merge( $files, $styleFiles );
                }
                
                // Final merge, this should result in a master list of dependent files
                $files = array_merge(
+                       $files,
                        $this->scripts,
-                       $styles,
                        $context->getDebug() ? $this->debugScripts : array(),
                        self::tryForKey( $this->languageScripts, $context->getLanguage() ),
                        self::tryForKey( $this->skinScripts, $context->getSkin(), 'default' ),