MediaWiki  REL1_19
ContextSource.php
Go to the documentation of this file.
00001 <?php
00030 abstract class ContextSource implements IContextSource {
00031 
00035         private $context;
00036 
00042         public function getContext() {
00043                 if ( $this->context === null ) {
00044                         $class = get_class( $this );
00045                         wfDebug( __METHOD__  . " ($class): called and \$context is null. Using RequestContext::getMain() for sanity\n" );
00046                         $this->context = RequestContext::getMain();
00047                 }
00048                 return $this->context;
00049         }
00050 
00057         public function setContext( IContextSource $context ) {
00058                 $this->context = $context;
00059         }
00060 
00067         public function getRequest() {
00068                 return $this->getContext()->getRequest();
00069         }
00070 
00077         public function getTitle() {
00078                 return $this->getContext()->getTitle();
00079         }
00080 
00089         public function canUseWikiPage() {
00090                 return $this->getContext()->canUseWikiPage();
00091         }
00092 
00102         public function getWikiPage() {
00103                 return $this->getContext()->getWikiPage();
00104         }
00105 
00112         public function getOutput() {
00113                 return $this->getContext()->getOutput();
00114         }
00115 
00122         public function getUser() {
00123                 return $this->getContext()->getUser();
00124         }
00125 
00132         public function getLang() {
00133                 wfDeprecated( __METHOD__, '1.19' );
00134                 return $this->getLanguage();
00135         }
00136 
00143         public function getLanguage() {
00144                 return $this->getContext()->getLanguage();
00145         }
00146 
00153         public function getSkin() {
00154                 return $this->getContext()->getSkin();
00155         }
00156 
00164         public function msg( /* $args */ ) {
00165                 $args = func_get_args();
00166                 return call_user_func_array( array( $this->getContext(), 'msg' ), $args );
00167         }
00168         
00169 }
00170