More unpicking of r85288. I think this is all of the magic method calls, but they...
authorHappy-melon <happy-melon@users.mediawiki.org>
Fri, 3 Jun 2011 11:04:49 +0000 (11:04 +0000)
committerHappy-melon <happy-melon@users.mediawiki.org>
Fri, 3 Jun 2011 11:04:49 +0000 (11:04 +0000)
includes/RequestContext.php
includes/SpecialPage.php
includes/actions/DeleteAction.php
includes/api/ApiParse.php
maintenance/rebuildFileCache.php
tests/phpunit/includes/parser/NewParserTest.php
tests/phpunit/suites/UploadFromUrlTestSuite.php

index 908eba1..a796a63 100644 (file)
@@ -219,6 +219,7 @@ class RequestContext implements IContextSource {
         * @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();
@@ -232,6 +233,7 @@ class RequestContext implements IContextSource {
         * @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 );
index ee194e6..a5dfe77 100644 (file)
@@ -873,8 +873,8 @@ abstract class RedirectSpecialPage extends UnlistedSpecialPage {
                $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 );
                        }
                }
 
index 9f4d8cc..f0a3a9b 100644 (file)
@@ -236,7 +236,7 @@ class DeleteAction extends Action {
                $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;
                }
 
@@ -376,7 +376,7 @@ class DeleteAction extends Action {
                        $dbw->commit();
                }
 
-               wfRunHooks( 'ArticleDeleteComplete', array( &$page, &$context->user, $data['Reason'][0], $id ) );
+               wfRunHooks( 'ArticleDeleteComplete', array( &$page, $context->getUser(), $data['Reason'][0], $id ) );
                return true;
        }
 
index 71f4946..392ec73 100644 (file)
@@ -244,22 +244,22 @@ class ApiParse extends ApiBase {
 
                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() ) );
                        }
                }
 
index 82112ef..42897af 100644 (file)
@@ -79,7 +79,7 @@ class RebuildFileCache extends Maintenance {
                                        $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() ) {
index 0cae330..2ac38e4 100644 (file)
@@ -79,8 +79,8 @@ class NewParserTest extends MediaWikiTestCase {
                // $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;
 
@@ -312,10 +312,10 @@ class NewParserTest extends MediaWikiTestCase {
                $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;
 
index 9e6bf7f..c9729fb 100644 (file)
@@ -49,8 +49,8 @@ class UploadFromUrlTestSuite extends PHPUnit_Framework_TestSuite {
                // $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;