63 $block = $user->getBlock();
64 if ( $block && $block->isSitewide() ) {
73 $forceLinkUpdate = $params[
'forcelinkupdate'];
74 $forceRecursiveLinkUpdate = $params[
'forcerecursivelinkupdate'];
75 $pageSet = $this->getPageSet();
78 $result = $pageSet->getInvalidTitlesAndRevisions();
79 $userName = $user->getName();
81 foreach ( $pageSet->getGoodPages() as $pageIdentity ) {
82 $title = $this->titleFormatter->getPrefixedText( $pageIdentity );
84 'ns' => $pageIdentity->getNamespace(),
87 $page = $this->wikiPageFactory->newFromTitle( $pageIdentity );
88 if ( !$user->pingLimiter(
'purge' ) ) {
96 if ( $forceLinkUpdate || $forceRecursiveLinkUpdate ) {
97 if ( !$user->pingLimiter(
'linkpurge' ) ) {
98 # Logging to better see expensive usage patterns
99 if ( $forceRecursiveLinkUpdate ) {
100 LoggerFactory::getInstance(
'RecursiveLinkPurge' )->info(
101 "Recursive link purge enqueued for {title}",
109 $page->updateParserCache( [
110 'causeAction' =>
'api-purge',
111 'causeAgent' => $userName,
113 $page->doSecondaryDataUpdates( [
114 'recursive' => $forceRecursiveLinkUpdate,
115 'causeAction' =>
'api-purge',
116 'causeAgent' => $userName,
117 'defer' => DeferredUpdates::PRESEND,
119 $r[
'linkupdate'] =
true;
122 $forceLinkUpdate =
false;
129 ApiResult::setIndexedTagName( $result,
'page' );
130 $apiResult->addValue(
null, $this->
getModuleName(), $result );
132 $values = $pageSet->getNormalizedTitlesAsResult( $apiResult );
134 $apiResult->addValue(
null,
'normalized', $values );
136 $values = $pageSet->getConvertedTitlesAsResult( $apiResult );
138 $apiResult->addValue(
null,
'converted', $values );
140 $values = $pageSet->getRedirectTitlesAsResult( $apiResult );
142 $apiResult->addValue(
null,
'redirects', $values );
146 $continuationManager->setContinuationIntoResult( $apiResult );