66 $this->cacheable = $useParserCache;
70 $keyPrefix = $this->cacheKey ?:
wfMemcKey(
'articleview',
'missingcachekey' );
71 parent::__construct(
'ArticleView', $keyPrefix .
':revid:' .
$revid );
110 $isCurrent = $this->revid === $this->
page->getLatest();
112 if ( $this->
content !==
null ) {
114 } elseif ( $isCurrent ) {
120 if (
$rev ===
null ) {
135 $time = - microtime(
true );
137 $this->
page->getTitle(),
141 $time += microtime(
true );
146 $logger = MediaWiki\Logger\LoggerFactory::getInstance(
'slow-parse' );
147 $logger->info(
'{time} {title}', [
148 'time' => number_format(
$time, 2 ),
149 'title' => $this->
page->getTitle()->getPrefixedDBkey(),
154 if ( $this->cacheable && $this->parserOutput->isCacheable() && $isCurrent ) {
156 $this->parserOutput, $this->
page, $this->parserOptions, $cacheTime, $this->revid );
162 if ( !$this->parserOutput->isCacheable() ) {
167 $this->
page->triggerOpportunisticLinksUpdate( $this->parserOutput );
179 if ( $this->parserOutput ===
false ) {
180 wfDebug( __METHOD__ .
": parser cache miss\n" );
183 wfDebug( __METHOD__ .
": parser cache hit\n" );
194 if ( $this->parserOutput ===
false ) {
196 wfDebug( __METHOD__ .
": no dirty cache\n" );
199 wfDebug( __METHOD__ .
": sending dirty output\n" );
200 wfDebugLog(
'dirty',
"dirty output {$this->cacheKey}" );
201 $this->isDirty =
true;
$wgUseFileCache
This will cache static pages for non-logged-in users to reduce database traffic on public sites.
wfDebug( $text, $dest='all', array $context=[])
Sends a line to the debug log if enabled or, optionally, to a comment in output.
wfTimestampNow()
Convenience function; returns MediaWiki timestamp for the present time.
wfMemcKey()
Make a cache key for the local wiki.
wfDebugLog( $logGroup, $text, $dest='all', array $context=[])
Send a line to a supplementary debug log file, if configured, or main debug log if not.
static makeContent( $text, Title $title=null, $modelId=null, $format=null)
Convenience function for creating a Content object from a given textual representation.
static singleton()
Get an instance of this object.
Set options of the Parser.
Class for dealing with PoolCounters using class members.
getError()
Get a Status object in case of error or false otherwise.
ParserOutput bool $parserOutput
ParserOptions $parserOptions
getParserOutput()
Get the ParserOutput from this object, or false in case of failure.
getIsDirty()
Get whether the ParserOutput is a dirty one (i.e.
__construct(WikiPage $page, ParserOptions $parserOptions, $revid, $useParserCache, $content=null)
static newFromTitle(LinkTarget $linkTarget, $id=0, $flags=0)
Load either the current, or a specified, revision that's attached to a given link target.
Generic operation result class Has warning/error list, boolean status and arbitrary value.
Class representing a MediaWiki article and history.
getRevision()
Get the latest revision.
getTitle()
Get the title object of the article.
per default it will return the text for text based content
when a variable name is used in a it is silently declared as a new local masking the global
this hook is for auditing only RecentChangesLinked and Watchlist RecentChangesLinked and Watchlist e g Watchlist removed from all revisions and log entries to which it was applied This gives extensions a chance to take it off their books as the deletion has already been partly carried out by this point or something similar the user will be unable to create the tag set $status
see documentation in includes Linker php for Linker::makeImageLink & $time
namespace are movable Hooks may change this value to override the return value of MWNamespace::isMovable(). 'NewDifferenceEngine' do that in ParserLimitReportFormat instead use this to modify the parameters of the image and a DIV can begin in one section and end in another Make sure your code can handle that case gracefully See the EditSectionClearerLink extension for an example zero but section is usually empty its values are the globals values before the output is cached one of or reset my talk page
presenting them properly to the user as errors is done by the caller return true use this to change the list i e etc $rev
injection txt This is an overview of how MediaWiki makes use of dependency injection The design described here grew from the discussion of RFC T384 The term dependency this means that anything an object needs to operate should be injected from the the object itself should only know narrow no concrete implementation of the logic it relies on The requirement to inject everything typically results in an architecture that based on two main types of and essentially stateless service objects that use other service objects to operate on the value objects As of the beginning MediaWiki is only starting to use the DI approach Much of the code still relies on global state or direct resulting in a highly cyclical dependency which acts as the top level factory for services in MediaWiki which can be used to gain access to default instances of various services MediaWikiServices however also allows new services to be defined and default services to be redefined Services are defined or redefined by providing a callback the instantiator that will return a new instance of the service When it will create an instance of MediaWikiServices and populate it with the services defined in the files listed by thereby bootstrapping the DI framework Per $wgServiceWiringFiles lists includes ServiceWiring php
Base interface for content objects.
getParserOutput(Title $title, $revId=null, ParserOptions $options=null, $generateHtml=true)
Parse the Content object and generate a ParserOutput from the result.