EditPage already has access to a IContextSource object via
$this->mArticle->getContext(), but no code ever uses it. Add a
$this->getContext() helper function and $this->context member variable
so developers are aware that RequestContext is available and should be
used instead of globals. This is the first step to de-globalifying
EditPage.
Change-Id: I17130bdaf214e9bbe0577a0ee5564ca4760c99e1
*/
private $enableApiEditOverride = false;
+ /**
+ * @var IContextSource
+ */
+ protected $context;
+
/**
* @param Article $article
*/
$this->mArticle = $article;
$this->page = $article->getPage(); // model object
$this->mTitle = $article->getTitle();
+ $this->context = $article->getContext();
$this->contentModel = $this->mTitle->getContentModel();
return $this->mArticle;
}
+ /**
+ * @since 1.28
+ * @return IContextSource
+ */
+ public function getContext() {
+ return $this->context;
+ }
+
/**
* @since 1.19
* @return Title