* @return string
*/
public function __get( $name ) {
+ wfDeprecated( 'RequestContext::__get() is deprecated; use $context->getFoo() instead' );
if ( in_array( $name, array( 'request', 'title', 'output', 'user', 'lang', 'skin' ) ) ) {
$fname = 'get' . ucfirst( $name );
return $this->$fname();
* @return string
*/
public function __set( $name, $value ) {
+ wfDeprecated( 'RequestContext::__set() is deprecated; use $context->setFoo() instead' );
if ( in_array( $name, array( 'request', 'title', 'output', 'user', 'lang', 'skin' ) ) ) {
$fname = 'set' . ucfirst( $name );
return $this->$fname( $value );
$params = array();
foreach( $this->mAllowedRedirectParams as $arg ) {
- if( $this->getContext()->request->getVal( $arg, null ) !== null ){
- $params[$arg] = $this->getContext()->request->getVal( $arg );
+ if( $this->getRequest()->getVal( $arg, null ) !== null ){
+ $params[$arg] = $this->getRequest()->getVal( $arg );
}
}
$data['Reason'] = (array)$data['Reason'];
$error = null;
- if ( !wfRunHooks( 'ArticleDelete', array( &$page, &$context->user, &$data['Reason'][0], &$error ) ) ) {
+ if ( !wfRunHooks( 'ArticleDelete', array( &$page, $context->getUser(), &$data['Reason'][0], &$error ) ) ) {
return $error;
}
$dbw->commit();
}
- wfRunHooks( 'ArticleDeleteComplete', array( &$page, &$context->user, $data['Reason'][0], $id ) );
+ wfRunHooks( 'ArticleDeleteComplete', array( &$page, $context->getUser(), $data['Reason'][0], $id ) );
return true;
}
if ( isset( $prop['headitems'] ) || isset( $prop['headhtml'] ) ) {
$context = new RequestContext;
- $context->output->addParserOutputNoText( $p_result );
+ $context->getOutput()->addParserOutputNoText( $p_result );
if ( isset( $prop['headitems'] ) ) {
$headItems = $this->formatHeadItems( $p_result->getHeadItems() );
- $context->skin->setupUserCss( $context->output );
- $css = $this->formatCss( $context->output->buildCssLinksArray() );
+ $context->getSkin()->setupUserCss( $context->getOutput() );
+ $css = $this->formatCss( $context->getOutput()->buildCssLinksArray() );
- $scripts = array( $context->output->getHeadScripts( $context->skin ) );
+ $scripts = array( $context->getOutput()->getHeadScripts( $context->getSkin() ) );
$result_array['headitems'] = array_merge( $headItems, $css, $scripts );
}
if ( isset( $prop['headhtml'] ) ) {
$result_array['headhtml'] = array();
- $result->setContent( $result_array['headhtml'], $context->output->headElement( $context->skin ) );
+ $result->setContent( $result_array['headhtml'], $context->getOutput()->headElement( $context->getSkin() ) );
}
}
$this->output( "Page {$row->page_id} has bad title\n" );
continue; // broken title?
}
- $wgOut = $context->output; // set display title
+ $wgOut = $context->getOutput(); // set display title
$article = new Article( $wgTitle );
// If the article is cacheable, then load it
if ( $article->isFileCacheable() ) {
// $tmpGlobals['wgContLang'] = new StubContLang;
$tmpGlobals['wgUser'] = new User;
$context = new RequestContext();
- $tmpGlobals['wgLang'] = $context->lang;
- $tmpGlobals['wgOut'] = $context->output;
+ $tmpGlobals['wgLang'] = $context->getLang();
+ $tmpGlobals['wgOut'] = $context->getOutput();
$tmpGlobals['wgParser'] = new StubObject( 'wgParser', $GLOBALS['wgParserConf']['class'], array( $GLOBALS['wgParserConf'] ) );
$tmpGlobals['wgRequest'] = new WebRequest;
$langObj = Language::factory( $lang );
$GLOBALS['wgContLang'] = $langObj;
$context = new RequestContext();
- $GLOBALS['wgLang'] = $context->lang;
+ $GLOBALS['wgLang'] = $context->getLang();
$GLOBALS['wgMemc'] = new EmptyBagOStuff;
- $GLOBALS['wgOut'] = $context->output;
+ $GLOBALS['wgOut'] = $context->getOutput();
global $wgHooks;
// $wgContLang = new StubContLang;
$wgUser = new User;
$context = new RequestContext;
- $wgLang = $context->lang;
- $wgOut = $context->output;
+ $wgLang = $context->getLang();
+ $wgOut = $context->getOutput();
$wgParser = new StubObject( 'wgParser', $wgParserConf['class'], array( $wgParserConf ) );
$wgRequest = new WebRequest;