62 $block = $user->getBlock();
63 if ( $block && $block->isSitewide() ) {
72 $forceLinkUpdate = $params[
'forcelinkupdate'];
73 $forceRecursiveLinkUpdate = $params[
'forcerecursivelinkupdate'];
74 $pageSet = $this->getPageSet();
77 $result = $pageSet->getInvalidTitlesAndRevisions();
78 $userName = $user->getName();
80 foreach ( $pageSet->getGoodPages() as $pageIdentity ) {
81 $title = $this->titleFormatter->getPrefixedText( $pageIdentity );
83 'ns' => $pageIdentity->getNamespace(),
86 $page = $this->wikiPageFactory->newFromTitle( $pageIdentity );
87 if ( !$user->pingLimiter(
'purge' ) ) {
95 if ( $forceLinkUpdate || $forceRecursiveLinkUpdate ) {
96 if ( !$user->pingLimiter(
'linkpurge' ) ) {
97 # Logging to better see expensive usage patterns
98 if ( $forceRecursiveLinkUpdate ) {
99 LoggerFactory::getInstance(
'RecursiveLinkPurge' )->info(
100 "Recursive link purge enqueued for {title}",
108 $page->updateParserCache( [
109 'causeAction' =>
'api-purge',
110 'causeAgent' => $userName,
112 $page->doSecondaryDataUpdates( [
113 'recursive' => $forceRecursiveLinkUpdate,
114 'causeAction' =>
'api-purge',
115 'causeAgent' => $userName,
116 'defer' => DeferredUpdates::PRESEND,
118 $r[
'linkupdate'] =
true;
121 $forceLinkUpdate =
false;
128 ApiResult::setIndexedTagName( $result,
'page' );
129 $apiResult->addValue(
null, $this->
getModuleName(), $result );
131 $values = $pageSet->getNormalizedTitlesAsResult( $apiResult );
133 $apiResult->addValue(
null,
'normalized', $values );
135 $values = $pageSet->getConvertedTitlesAsResult( $apiResult );
137 $apiResult->addValue(
null,
'converted', $values );
139 $values = $pageSet->getRedirectTitlesAsResult( $apiResult );
141 $apiResult->addValue(
null,
'redirects', $values );
145 $continuationManager->setContinuationIntoResult( $apiResult );