*/
class PoolWorkArticleView extends PoolCounterWork {
- /** @var Page */
+ /** @var WikiPage */
private $page;
/** @var string */
private $error = false;
/**
- * @param Page $page
+ * @param WikiPage $page
* @param ParserOptions $parserOptions ParserOptions to use for the parse
* @param int $revid ID of the revision being parsed.
* @param bool $useParserCache Whether to use the parser cache.
* @param Content|string $content Content to parse or null to load it; may
* also be given as a wikitext string, for BC.
*/
- public function __construct( Page $page, ParserOptions $parserOptions,
+ public function __construct( WikiPage $page, ParserOptions $parserOptions,
$revid, $useParserCache, $content = null
) {
if ( is_string( $content ) ) { // BC: old style call
// Timing hack
if ( $time > 3 ) {
- wfDebugLog( 'slow-parse', sprintf( "%-5.2f %s", $time,
- $this->page->getTitle()->getPrefixedDBkey() ) );
+ // TODO: Use Parser's logger (once it has one)
+ $logger = MediaWiki\Logger\LoggerFactory::getInstance( 'slow-parse' );
+ $logger->info( '{time} {title}', [
+ 'time' => number_format( $time, 2 ),
+ 'title' => $this->page->getTitle()->getPrefixedDBkey(),
+ 'trigger' => 'view',
+ ] );
}
if ( $this->cacheable && $this->parserOutput->isCacheable() && $isCurrent ) {
// Make sure file cache is not used on uncacheable content.
// Output that has magic words in it can still use the parser cache
// (if enabled), though it will generally expire sooner.
- if ( !$this->parserOutput->isCacheable() || $this->parserOutput->containsOldMagic() ) {
+ if ( !$this->parserOutput->isCacheable() ) {
$wgUseFileCache = false;
}