Merge "Use config instead of globals for ImageGallery"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Fri, 22 Aug 2014 23:53:13 +0000 (23:53 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Fri, 22 Aug 2014 23:53:13 +0000 (23:53 +0000)
1  2 
includes/context/RequestContext.php

@@@ -123,10 -123,10 +123,10 @@@ class RequestContext implements IContex
        /**
         * Set the Title object
         *
 -       * @param Title $t
 +       * @param Title $title
         */
 -      public function setTitle( Title $t ) {
 -              $this->title = $t;
 +      public function setTitle( Title $title ) {
 +              $this->title = $title;
                // Erase the WikiPage so a new one with the new title gets created.
                $this->wikipage = null;
        }
                return self::$instance;
        }
  
+       /**
+        * Get the RequestContext object associated with the main request
+        * and gives a warning to the log, to find places, where a context maybe is missing.
+        *
+        * @return RequestContext
+        * @since 1.24
+        */
+       public static function getMainAndWarn( $func = __METHOD__ ) {
+               wfDebug( $func . ' called without context. ' .
+                       "Using RequestContext::getMain() for sanity\n" );
+               return self::getMain();
+       }
        /**
         * Resets singleton returned by getMain(). Should be called only from unit tests.
         */