/** * Get the IContextSource in use here * @return IContextSource */ public final function getContext() { if ($this->context instanceof IContextSource) { return $this->context; } return $this->page->getContext(); }
/** * Get the IContextSource in use here * @return IContextSource */ final public function getContext() { if ( $this->context instanceof IContextSource ) { return $this->context; } else if ( $this->page instanceof Article ) { // NOTE: $this->page can be a WikiPage, which does not have a context. wfDebug( __METHOD__ . ': no context known, falling back to Article\'s context.' ); return $this->page->getContext(); } wfWarn( __METHOD__ . ': no context known, falling back to RequestContext::getMain().' ); return RequestContext::getMain(); }