39 $forceLinkUpdate = $params[
'forcelinkupdate'];
40 $forceRecursiveLinkUpdate = $params[
'forcerecursivelinkupdate'];
44 $result = $pageSet->getInvalidTitlesAndRevisions();
47 foreach ( $pageSet->getGoodTitles() as
$title ) {
49 ApiQueryBase::addTitleInfo( $r,
$title );
50 $page = WikiPage::factory(
$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(),
80 'defer' => DeferredUpdates::PRESEND,
82 $r[
'linkupdate'] =
true;
85 $forceLinkUpdate =
false;
92 ApiResult::setIndexedTagName( $result,
'page' );
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 );