/// should be private. To include the variable {{REVISIONID}}
var $mRevisionId = null;
- /// Stores a Title object (of the current page).
- protected $mTitle = null;
-
- /// Stores a User object (the one the page is being rendered for)
- protected $mUser = null;
+ private $mContext;
/**
* An array of stylesheet filenames (relative from skins path), with options
'Cookie' => null
);
+ /**
+ * Constructor for OutputPage. This should not be called directly.
+ * Instead a new RequestContext should be created and it will implicitly create
+ * a OutputPage tied to that context.
+ */
+ function __construct( RequestContext $context=null ) {
+ if ( !isset($context) ) {
+ # Extensions should use `new RequestContext` instead of `new OutputPage` now.
+ wfDeprecated( __METHOD__ );
+ }
+ $this->mContext = $context;
+ }
+
/**
* Redirect to $url rather than displaying the normal page
*
return $this->mPagetitle;
}
- /**
- * Set the RequestContext used in this instance
- *
- * @param RequestContext $context
- */
- public function setContext( RequestContext $context ) {
- $this->mContext = $context;
- }
-
/**
* Get the RequestContext used in this instance
*
*/
public function getOutput() {
if ( !isset( $this->mOutput ) ) {
- $this->mOutput = new OutputPage;
- $this->mOutput->setContext( $this );
+ $this->mOutput = new OutputPage( $this );
}
return $this->mOutput;
}
static function capturePath( &$title ) {
global $wgOut, $wgTitle;
- // preload the skin - Sometimes the SpecialPage loads it at a bad point in time making a includable special page override the skin title
- // This hack is ok for now. The plan is for
- // - Skin to stop storing it's own title
- // - includable special pages to stop using $wgTitle and $wgOut
- // - and OutputPage to store it's own skin object instead of askin $wgUser
- // Once just about any of those are implemented preloading will not be necessarily
- $wgOut->getSkin();
-
$oldTitle = $wgTitle;
$oldOut = $wgOut;