Add ResourceLoaderContext::newDummyContext() function
authorRoan Kattouw <catrope@users.mediawiki.org>
Thu, 1 Sep 2011 13:02:20 +0000 (13:02 +0000)
committerRoan Kattouw <catrope@users.mediawiki.org>
Thu, 1 Sep 2011 13:02:20 +0000 (13:02 +0000)
includes/resourceloader/ResourceLoaderContext.php

index 05ab434..ba64942 100644 (file)
@@ -97,6 +97,13 @@ class ResourceLoaderContext {
                }
                return $retval;
        }
+       
+       /**
+        * Return a dummy ResourceLoaderContext object suitable for passing into things that don't "really" need a context
+        */
+       public static function newDummyContext() {
+               return new self( null, new FauxRequest( array() ) );
+       }
 
        /**
         * @return ResourceLoader