MediaWiki  REL1_21
ContextSource.php
Go to the documentation of this file.
00001 <?php
00030 abstract class ContextSource implements IContextSource {
00034         private $context;
00035 
00041         public function getContext() {
00042                 if ( $this->context === null ) {
00043                         $class = get_class( $this );
00044                         wfDebug( __METHOD__ . " ($class): called and \$context is null. Using RequestContext::getMain() for sanity\n" );
00045                         $this->context = RequestContext::getMain();
00046                 }
00047                 return $this->context;
00048         }
00049 
00056         public function setContext( IContextSource $context ) {
00057                 $this->context = $context;
00058         }
00059 
00066         public function getRequest() {
00067                 return $this->getContext()->getRequest();
00068         }
00069 
00076         public function getTitle() {
00077                 return $this->getContext()->getTitle();
00078         }
00079 
00088         public function canUseWikiPage() {
00089                 return $this->getContext()->canUseWikiPage();
00090         }
00091 
00101         public function getWikiPage() {
00102                 return $this->getContext()->getWikiPage();
00103         }
00104 
00111         public function getOutput() {
00112                 return $this->getContext()->getOutput();
00113         }
00114 
00121         public function getUser() {
00122                 return $this->getContext()->getUser();
00123         }
00124 
00131         public function getLang() {
00132                 wfDeprecated( __METHOD__, '1.19' );
00133                 return $this->getLanguage();
00134         }
00135 
00142         public function getLanguage() {
00143                 return $this->getContext()->getLanguage();
00144         }
00145 
00152         public function getSkin() {
00153                 return $this->getContext()->getSkin();
00154         }
00155 
00163         public function msg( /* $args */ ) {
00164                 $args = func_get_args();
00165                 return call_user_func_array( array( $this->getContext(), 'msg' ), $args );
00166         }
00167 
00175         public function exportSession() {
00176                 return $this->getContext()->exportSession();
00177         }
00178 }