* @param $parserOptions ParserOptions to use for the parse operation
* @param $oldid Revision ID to get the text from, passing null or 0 will
* get the current revision (default value)
- * @param $context IContextSource context for parsing
*
* @return ParserOutput or false if the revision was not found
*/
- public function getParserOutput( ParserOptions $parserOptions, $oldid = null, IContextSource $context = null ) {
+ public function getParserOutput( ParserOptions $parserOptions, $oldid = null ) {
wfProfileIn( __METHOD__ );
$useParserCache = $this->isParserCacheUsed( $parserOptions, $oldid );
$oldid = $this->getLatest();
}
- $pool = new PoolWorkArticleView( $this, $parserOptions, $oldid, $useParserCache, null, $context );
+ $pool = new PoolWorkArticleView( $this, $parserOptions, $oldid, $useParserCache, null );
$pool->execute();
wfProfileOut( __METHOD__ );
$edit->popts = $this->makeParserOptions( 'canonical' );
- // TODO: is there no better way to obtain a context here?
- $context = RequestContext::getMain();
- $context->setTitle( $this->mTitle );
- $edit->output = $edit->pstContent->getParserOutput( $context, $revid, $edit->popts );
- $edit->updates = $edit->pstContent->getSecondaryDataUpdate( $context );
+ $edit->output = $edit->pstContent->getParserOutput( $this->mTitle, $revid, $edit->popts );
$edit->newContent = $content;
$edit->oldContent = $this->getContent( Revision::RAW );
}
# Update the links tables and other secondary data
- $updates = $editInfo->updates;
+ $updates = $editInfo->output->getSecondaryDataUpdates( $this->getTitle() );
DataUpdate::runUpdates( $updates );
wfRunHooks( 'ArticleEditUpdates', array( &$this, &$editInfo, $options['changed'] ) );
private $parserOptions;
/**
- * @var string|null
+ * @var Content|null
*/
- private $text;
+ private $content = null;
/**
* @var ParserOutput|bool
* @param $useParserCache Boolean: whether to use the parser cache
* @param $parserOptions parserOptions to use for the parse operation
* @param $content Content|String: content to parse or null to load it; may also be given as a wikitext string, for BC
- * @param $context IContextSource context for parsing
*/
- function __construct( Page $page, ParserOptions $parserOptions, $revid, $useParserCache, $content = null, IContextSource $context = null ) {
+ function __construct( Page $page, ParserOptions $parserOptions, $revid, $useParserCache, $content = null ) {
if ( is_string($content) ) { #BC: old style call
$modelId = $page->getRevision()->getContentModel();
$format = $page->getRevision()->getContentFormat();
$content = ContentHandler::makeContent( $content, $page->getTitle(), $modelId, $format );
}
- if ( is_null( $context ) ) {
- $context = RequestContext::getMain();
- #XXX: clone and then set title?
- }
-
$this->page = $page;
$this->revid = $revid;
- $this->context = $context;
$this->cacheable = $useParserCache;
$this->parserOptions = $parserOptions;
$this->content = $content;
$time = - microtime( true );
// TODO: page might not have this method? Hard to tell what page is supposed to be here...
- $this->parserOutput = $content->getParserOutput( $this->context, $this->revid, $this->parserOptions );
+ $this->parserOutput = $content->getParserOutput( $this->page->getTitle(), $this->revid, $this->parserOptions );
$time += microtime( true );
# Timing hack