MediaWiki  REL1_24
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. " .
00045                 "Using RequestContext::getMain() for sanity\n" );
00046             $this->context = RequestContext::getMain();
00047         }
00048 
00049         return $this->context;
00050     }
00051 
00058     public function setContext( IContextSource $context ) {
00059         $this->context = $context;
00060     }
00061 
00068     public function getConfig() {
00069         return $this->getContext()->getConfig();
00070     }
00071 
00078     public function getRequest() {
00079         return $this->getContext()->getRequest();
00080     }
00081 
00088     public function getTitle() {
00089         return $this->getContext()->getTitle();
00090     }
00091 
00100     public function canUseWikiPage() {
00101         return $this->getContext()->canUseWikiPage();
00102     }
00103 
00113     public function getWikiPage() {
00114         return $this->getContext()->getWikiPage();
00115     }
00116 
00123     public function getOutput() {
00124         return $this->getContext()->getOutput();
00125     }
00126 
00133     public function getUser() {
00134         return $this->getContext()->getUser();
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 
00167         return call_user_func_array( array( $this->getContext(), 'msg' ), $args );
00168     }
00169 
00177     public function exportSession() {
00178         return $this->getContext()->exportSession();
00179     }
00180 }