context === null ) { $class = get_class( $this ); wfDebug( __METHOD__ . " ($class): called and \$context is null. Using RequestContext::getMain() for sanity\n" ); $this->context = RequestContext::getMain(); } return $this->context; } /** * Set the IContextSource object * * @param $context IContextSource */ public function setContext( IContextSource $context ) { $this->context = $context; } /** * Get the WebRequest object * * @return WebRequest */ public function getRequest() { return $this->getContext()->getRequest(); } /** * Get the Title object * * @return Title */ public function getTitle() { return $this->getContext()->getTitle(); } /** * Get the OutputPage object * * @return OutputPage object */ public function getOutput() { return $this->getContext()->getOutput(); } /** * Get the User object * * @return User */ public function getUser() { return $this->getContext()->getUser(); } /** * Get the Language object * * @return Language */ public function getLang() { return $this->getContext()->getLang(); } /** * Get the Skin object * * @return Skin */ public function getSkin() { return $this->getContext()->getSkin(); } /** * Get a Message object with context set * Parameters are the same as wfMessage() * * @return Message object */ public function msg( /* $args */ ) { $args = func_get_args(); return call_user_func_array( array( $this->getContext(), 'msg' ), $args ); } }