Index: trunk/phase3/includes/SpecialPage.php |
— | — | @@ -609,14 +609,6 @@ |
610 | 610 | static function capturePath( &$title ) { |
611 | 611 | global $wgOut, $wgTitle; |
612 | 612 | |
613 | | - // preload the skin - Sometimes the SpecialPage loads it at a bad point in time making a includable special page override the skin title |
614 | | - // This hack is ok for now. The plan is for |
615 | | - // - Skin to stop storing it's own title |
616 | | - // - includable special pages to stop using $wgTitle and $wgOut |
617 | | - // - and OutputPage to store it's own skin object instead of askin $wgUser |
618 | | - // Once just about any of those are implemented preloading will not be necessarily |
619 | | - $wgOut->getSkin(); |
620 | | - |
621 | 613 | $oldTitle = $wgTitle; |
622 | 614 | $oldOut = $wgOut; |
623 | 615 | |
Index: trunk/phase3/includes/RequestContext.php |
— | — | @@ -66,8 +66,7 @@ |
67 | 67 | */ |
68 | 68 | public function getOutput() { |
69 | 69 | if ( !isset( $this->mOutput ) ) { |
70 | | - $this->mOutput = new OutputPage; |
71 | | - $this->mOutput->setContext( $this ); |
| 70 | + $this->mOutput = new OutputPage( $this ); |
72 | 71 | } |
73 | 72 | return $this->mOutput; |
74 | 73 | } |
Index: trunk/phase3/includes/OutputPage.php |
— | — | @@ -190,12 +190,8 @@ |
191 | 191 | /// should be private. To include the variable {{REVISIONID}} |
192 | 192 | var $mRevisionId = null; |
193 | 193 | |
194 | | - /// Stores a Title object (of the current page). |
195 | | - protected $mTitle = null; |
| 194 | + private $mContext; |
196 | 195 | |
197 | | - /// Stores a User object (the one the page is being rendered for) |
198 | | - protected $mUser = null; |
199 | | - |
200 | 196 | /** |
201 | 197 | * An array of stylesheet filenames (relative from skins path), with options |
202 | 198 | * for CSS media, IE conditions, and RTL/LTR direction. |
— | — | @@ -219,6 +215,19 @@ |
220 | 216 | ); |
221 | 217 | |
222 | 218 | /** |
| 219 | + * Constructor for OutputPage. This should not be called directly. |
| 220 | + * Instead a new RequestContext should be created and it will implicitly create |
| 221 | + * a OutputPage tied to that context. |
| 222 | + */ |
| 223 | + function __construct( RequestContext $context=null ) { |
| 224 | + if ( !isset($context) ) { |
| 225 | + # Extensions should use `new RequestContext` instead of `new OutputPage` now. |
| 226 | + wfDeprecated( __METHOD__ ); |
| 227 | + } |
| 228 | + $this->mContext = $context; |
| 229 | + } |
| 230 | + |
| 231 | + /** |
223 | 232 | * Redirect to $url rather than displaying the normal page |
224 | 233 | * |
225 | 234 | * @param $url String: URL |
— | — | @@ -752,15 +761,6 @@ |
753 | 762 | } |
754 | 763 | |
755 | 764 | /** |
756 | | - * Set the RequestContext used in this instance |
757 | | - * |
758 | | - * @param RequestContext $context |
759 | | - */ |
760 | | - public function setContext( RequestContext $context ) { |
761 | | - $this->mContext = $context; |
762 | | - } |
763 | | - |
764 | | - /** |
765 | 765 | * Get the RequestContext used in this instance |
766 | 766 | * |
767 | 767 | * @return RequestContext |