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 );
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() ) {
163 $wgUseFileCache =
false;
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;
ParserOutput bool $parserOutput
per default it will return the text for text based content
Set options of the Parser.
__construct(WikiPage $page, ParserOptions $parserOptions, $revid, $useParserCache, $content=null)
when a variable name is used in a it is silently declared as a new local masking the global
getIsDirty()
Get whether the ParserOutput is a dirty one (i.e.
static newFromTitle(LinkTarget $linkTarget, $id=0, $flags=0)
Load either the current, or a specified, revision that's attached to a given link target...
wfDebug($text, $dest= 'all', array $context=[])
Sends a line to the debug log if enabled or, optionally, to a comment in output.
getParserOutput()
Get the ParserOutput from this object, or false in case of failure.
getRevision()
Get the latest revision.
wfDebugLog($logGroup, $text, $dest= 'all', array $context=[])
Send a line to a supplementary debug log file, if configured, or main debug log if not...
$wgUseFileCache
This will cache static pages for non-logged-in users to reduce database traffic on public sites...
wfTimestampNow()
Convenience function; returns MediaWiki timestamp for the present time.
getTitle()
Get the title object of the article.
static makeContent($text, Title $title=null, $modelId=null, $format=null)
Convenience function for creating a Content object from a given textual representation.
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
static singleton()
Get an instance of this object.
Class representing a MediaWiki article and history.
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
getError()
Get a Status object in case of error or false otherwise.
ParserOptions $parserOptions
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
wfMemcKey()
Make a cache key for the local wiki.
getParserOutput(Title $title, $revId=null, ParserOptions $options=null, $generateHtml=true)
Parse the Content object and generate a ParserOutput from the result.
Class for dealing with PoolCounters using class members.
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
see documentation in includes Linker php for Linker::makeImageLink & $time