r100906 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r100905‎ | r100906 | r100907 >
Date:23:34, 26 October 2011
Author:johnduhart
Status:resolved (Comments)
Tags:
Comment:
Followup 100905, fixing usages of getContext()
Modified paths:
  • /trunk/phase3/includes/api/ApiBase.php (modified) (history)
  • /trunk/phase3/includes/api/ApiPurge.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiPurge.php
@@ -68,7 +68,7 @@
6969 $result[] = $r;
7070 continue;
7171 }
72 - $context = $this->createContext();
 72+ $context = new DerivativeContext( $this->getContext() );
7373 $context->setTitle( $title );
7474 $article = Article::newFromTitle( $title, $context );
7575 $article->doPurge(); // Directly purge and skip the UI part of purge().
Index: trunk/phase3/includes/api/ApiBase.php
@@ -183,11 +183,11 @@
184184 * The object will have the WebRequest and the User object set to the ones
185185 * used in this instance.
186186 *
187 - * @deprecated 1.19 use getContext to get the current context
188 - * @return RequestContext
 187+ * @deprecated since 1.19 use getContext to get the current context
 188+ * @return DerivativeContext
189189 */
190190 public function createContext() {
191 - return $this->getContext();
 191+ return new DerivativeContext( $this->getContext() );
192192 }
193193
194194 /**

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r100905Adding context to the API...johnduhart23:27, 26 October 2011

Comments

#Comment by 😂 (talk | contribs)   01:41, 27 October 2011
#Comment by Catrope (talk | contribs)   20:36, 1 November 2011

Unit tests aren't failing any more, setting to resolved.

#Comment by Catrope (talk | contribs)   20:36, 1 November 2011

I meant setting to new.

Status & tagging log