37 $block = $user->getBlock();
38 if ( $block && $block->isSitewide() ) {
47 $forceLinkUpdate = $params[
'forcelinkupdate'];
48 $forceRecursiveLinkUpdate = $params[
'forcerecursivelinkupdate'];
52 $result = $pageSet->getInvalidTitlesAndRevisions();
54 foreach ( $pageSet->getGoodTitles() as
$title ) {
56 ApiQueryBase::addTitleInfo( $r,
$title );
57 $page = WikiPage::factory(
$title );
58 if ( !$user->pingLimiter(
'purge' ) ) {
66 if ( $forceLinkUpdate || $forceRecursiveLinkUpdate ) {
67 if ( !$user->pingLimiter(
'linkpurge' ) ) {
68 # Logging to better see expensive usage patterns
69 if ( $forceRecursiveLinkUpdate ) {
70 LoggerFactory::getInstance(
'RecursiveLinkPurge' )->info(
71 "Recursive link purge enqueued for {title}",
73 'user' => $this->
getUser()->getName(),
74 'title' =>
$title->getPrefixedText()
79 $page->updateParserCache( [
80 'causeAction' =>
'api-purge',
81 'causeAgent' => $this->
getUser()->getName(),
83 $page->doSecondaryDataUpdates( [
84 'recursive' => $forceRecursiveLinkUpdate,
85 'causeAction' =>
'api-purge',
86 'causeAgent' => $this->
getUser()->getName(),
87 'defer' => DeferredUpdates::PRESEND,
89 $r[
'linkupdate'] =
true;
92 $forceLinkUpdate =
false;
99 ApiResult::setIndexedTagName( $result,
'page' );
100 $apiResult->addValue(
null, $this->
getModuleName(), $result );
102 $values = $pageSet->getNormalizedTitlesAsResult( $apiResult );
104 $apiResult->addValue(
null,
'normalized', $values );
106 $values = $pageSet->getConvertedTitlesAsResult( $apiResult );
108 $apiResult->addValue(
null,
'converted', $values );
110 $values = $pageSet->getRedirectTitlesAsResult( $apiResult );
112 $apiResult->addValue(
null,
'redirects', $values );
116 $continuationManager->setContinuationIntoResult( $apiResult );