MediaWiki
REL1_23
|
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 getLang() { 00144 wfDeprecated( __METHOD__, '1.19' ); 00145 00146 return $this->getLanguage(); 00147 } 00148 00155 public function getLanguage() { 00156 return $this->getContext()->getLanguage(); 00157 } 00158 00165 public function getSkin() { 00166 return $this->getContext()->getSkin(); 00167 } 00168 00176 public function msg( /* $args */ ) { 00177 $args = func_get_args(); 00178 00179 return call_user_func_array( array( $this->getContext(), 'msg' ), $args ); 00180 } 00181 00189 public function exportSession() { 00190 return $this->getContext()->exportSession(); 00191 } 00192 }