Followup 100905, fixing usages of getContext()
authorJohn Du Hart <johnduhart@users.mediawiki.org>
Wed, 26 Oct 2011 23:34:31 +0000 (23:34 +0000)
committerJohn Du Hart <johnduhart@users.mediawiki.org>
Wed, 26 Oct 2011 23:34:31 +0000 (23:34 +0000)
includes/api/ApiBase.php
includes/api/ApiPurge.php

index 15f0078..861da5b 100644 (file)
@@ -183,11 +183,11 @@ abstract class ApiBase extends ContextSource {
         * The object will have the WebRequest and the User object set to the ones
         * used in this instance.
         *
-        * @deprecated 1.19 use getContext to get the current context
-        * @return RequestContext
+        * @deprecated since 1.19 use getContext to get the current context
+        * @return DerivativeContext
         */
        public function createContext() {
-               return $this->getContext();
+               return new DerivativeContext( $this->getContext() );
        }
 
        /**
index 2d30c9f..89885b3 100644 (file)
@@ -68,7 +68,7 @@ class ApiPurge extends ApiBase {
                                $result[] = $r;
                                continue;
                        }
-                       $context = $this->createContext();
+                       $context = new DerivativeContext( $this->getContext() );
                        $context->setTitle( $title );
                        $article = Article::newFromTitle( $title, $context );
                        $article->doPurge(); // Directly purge and skip the UI part of purge().