Go to the documentation of this file.
39 $forceLinkUpdate = $params[
'forcelinkupdate'];
40 $forceRecursiveLinkUpdate = $params[
'forcerecursivelinkupdate'];
44 $result = $pageSet->getInvalidTitlesAndRevisions();
47 foreach ( $pageSet->getGoodTitles() as
$title ) {
51 if ( !$user->pingLimiter(
'purge' ) ) {
59 if ( $forceLinkUpdate || $forceRecursiveLinkUpdate ) {
60 if ( !$user->pingLimiter(
'linkpurge' ) ) {
61 # Logging to better see expensive usage patterns
62 if ( $forceRecursiveLinkUpdate ) {
63 LoggerFactory::getInstance(
'RecursiveLinkPurge' )->info(
64 "Recursive link purge enqueued for {title}",
66 'user' => $this->
getUser()->getName(),
67 'title' =>
$title->getPrefixedText()
72 $page->updateParserCache( [
73 'causeAction' =>
'api-purge',
74 'causeAgent' => $this->
getUser()->getName(),
76 $page->doSecondaryDataUpdates( [
77 'recursive' => $forceRecursiveLinkUpdate,
78 'causeAction' =>
'api-purge',
79 'causeAgent' => $this->
getUser()->getName(),
82 $r[
'linkupdate'] =
true;
85 $forceLinkUpdate =
false;
93 $apiResult->addValue(
null, $this->
getModuleName(), $result );
95 $values = $pageSet->getNormalizedTitlesAsResult( $apiResult );
97 $apiResult->addValue(
null,
'normalized', $values );
99 $values = $pageSet->getConvertedTitlesAsResult( $apiResult );
101 $apiResult->addValue(
null,
'converted', $values );
103 $values = $pageSet->getRedirectTitlesAsResult( $apiResult );
105 $apiResult->addValue(
null,
'redirects', $values );
109 $continuationManager->setContinuationIntoResult( $apiResult );
117 if ( $this->mPageSet ===
null ) {
134 'forcelinkupdate' =>
false,
135 'forcerecursivelinkupdate' =>
false,
141 $result += $this->
getPageSet()->getFinalParams( $flags );
149 'action=purge&titles=Main_Page|API'
150 =>
'apihelp-purge-example-simple',
151 'action=purge&generator=allpages&gapnamespace=0&gaplimit=10'
152 =>
'apihelp-purge-example-generator',
157 return 'https://www.mediawiki.org/wiki/Special:MyLanguage/API:Purge';
addWarning( $msg, $code=null, $data=null)
Add a warning for this module.
This manages continuation state.
const PARAM_HELP_MSG
(string|array|Message) Specify an alternative i18n documentation message for this parameter.
getResult()
Get the result object.
setContinuationManager(ApiContinuationManager $manager=null)
Set the continuation manager.
This class contains a list of pages that the client has requested.
This abstract class implements many basic API functions, and is the base of all API classes.
isWriteMode()
Indicates whether this module requires write mode.
getPageSet()
Get a cached instance of an ApiPageSet object.
static factory(Title $title)
Create a WikiPage object of the appropriate class for the given title.
execute()
Purges the cache of a page.
mustBePosted()
Indicates whether this module must be called with a POST request.
extractRequestParams( $options=[])
Using getAllowedParams(), this function makes an array of the values provided by the user,...
getHelpUrls()
Return links to more detailed help pages about the module.
static setIndexedTagName(array &$arr, $tag)
Set the tag name for numeric-keyed values in XML format.
getModuleName()
Get the name of the module being executed by this instance.
getAllowedParams( $flags=0)
API interface for page purging.
getExamplesMessages()
Returns usage examples for this module.
static addTitleInfo(&$arr, $title, $prefix='')
Add information (title and namespace) about a Title object to a result array.