Go to the documentation of this file.
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(),
150 'ns' => $this->
page->getTitle()->getNamespace(),
155 if ( $this->cacheable && $this->parserOutput->isCacheable() && $isCurrent ) {
157 $this->parserOutput, $this->
page, $this->parserOptions, $cacheTime, $this->revid );
163 if ( !$this->parserOutput->isCacheable() ) {
168 $this->
page->triggerOpportunisticLinksUpdate( $this->parserOutput );
180 if ( $this->parserOutput ===
false ) {
181 wfDebug( __METHOD__ .
": parser cache miss\n" );
184 wfDebug( __METHOD__ .
": parser cache hit\n" );
195 if ( $this->parserOutput ===
false ) {
197 wfDebug( __METHOD__ .
": no dirty cache\n" );
200 wfDebug( __METHOD__ .
": sending dirty output\n" );
201 wfDebugLog(
'dirty',
"dirty output {$this->cacheKey}" );
202 $this->isDirty =
true;
Set options of the Parser.
per default it will return the text for text based content
this hook is for auditing only RecentChangesLinked and Watchlist RecentChangesLinked and Watchlist Do not use this to implement individual filters if they are compatible with the ChangesListFilter and ChangesListFilterGroup structure use sub classes of those in conjunction with the ChangesListSpecialPageStructuredFilters hook This hook can be used to implement filters that do not implement that or custom behavior that is not an individual filter e g Watchlist and Watchlist you will want to construct new ChangesListBooleanFilter or ChangesListStringOptionsFilter objects When constructing you specify which group they belong to You can reuse existing or create your you must register them with $special registerFilterGroup 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
Class representing a MediaWiki article and history.
__construct(WikiPage $page, ParserOptions $parserOptions, $revid, $useParserCache, $content=null)
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.
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
Generic operation result class Has warning/error list, boolean status and arbitrary value.
ParserOptions $parserOptions
static newFromTitle(LinkTarget $linkTarget, $id=0, $flags=0)
Load either the current, or a specified, revision that's attached to a given link target.
ParserOutput bool $parserOutput
wfMemcKey()
Make a cache key for the local wiki.
$wgUseFileCache
This will cache static pages for non-logged-in users to reduce database traffic on public sites.
getTitle()
Get the title object of the article.
see documentation in includes Linker php for Linker::makeImageLink & $time
when a variable name is used in a it is silently declared as a new masking the global
wfTimestampNow()
Convenience function; returns MediaWiki timestamp for the present time.
wfDebug( $text, $dest='all', array $context=[])
Sends a line to the debug log if enabled or, optionally, to a comment in output.
static makeContent( $text, Title $title=null, $modelId=null, $format=null)
Convenience function for creating a Content object from a given textual representation.
getError()
Get a Status object in case of error or false otherwise.
static singleton()
Get an instance of this object.
Base interface for content objects.
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 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
Class for dealing with PoolCounters using class members.
getParserOutput()
Get the ParserOutput from this object, or false in case of failure.
getParserOutput(Title $title, $revId=null, ParserOptions $options=null, $generateHtml=true)
Parse the Content object and generate a ParserOutput from the result.
getIsDirty()
Get whether the ParserOutput is a dirty one (i.e.