Index: trunk/phase3/includes/api/ApiPurge.php |
— | — | @@ -68,6 +68,26 @@ |
69 | 69 | $article = MediaWiki::articleFromTitle( $title ); |
70 | 70 | $article->doPurge(); // Directly purge and skip the UI part of purge(). |
71 | 71 | $r['purged'] = ''; |
| 72 | + |
| 73 | + if( $params['forcelinkupdate'] ) { |
| 74 | + if ( !$wgUser->pingLimiter() ) { |
| 75 | + global $wgParser, $wgEnableParserCache; |
| 76 | + $popts = new ParserOptions(); |
| 77 | + $p_result = $wgParser->parse( $article->getContent(), $title, $popts ); |
| 78 | + |
| 79 | + # Update the links tables |
| 80 | + $u = new LinksUpdate( $title, $p_result ); |
| 81 | + $u->doUpdate(); |
| 82 | + |
| 83 | + $r['linkupdate'] = ''; |
| 84 | + |
| 85 | + if ( $wgEnableParserCache ) { |
| 86 | + $pcache = ParserCache::singleton(); |
| 87 | + $pcache->save( $p_result, $article, $popts ); |
| 88 | + } |
| 89 | + } |
| 90 | + } |
| 91 | + |
72 | 92 | $result[] = $r; |
73 | 93 | } |
74 | 94 | $this->getResult()->setIndexedTagName( $result, 'page' ); |
— | — | @@ -83,13 +103,15 @@ |
84 | 104 | 'titles' => array( |
85 | 105 | ApiBase::PARAM_ISMULTI => true, |
86 | 106 | ApiBase::PARAM_REQUIRED => true |
87 | | - ) |
| 107 | + ), |
| 108 | + 'forcelinkupdate' => false, |
88 | 109 | ); |
89 | 110 | } |
90 | 111 | |
91 | 112 | public function getParamDescription() { |
92 | 113 | return array( |
93 | 114 | 'titles' => 'A list of titles', |
| 115 | + 'forcelinkupdate' => 'Update the links tables', |
94 | 116 | ); |
95 | 117 | } |
96 | 118 | |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -73,6 +73,7 @@ |
74 | 74 | * (bug 25135) add "normalized" to action=parse |
75 | 75 | * (bug 26460) Add support for listing category members by category pageid |
76 | 76 | * (bug 26482) add a imimages param to prop=images |
| 77 | +* (bug 26498) allow LinksUpdate with API |
77 | 78 | |
78 | 79 | === Languages updated in 1.18 === |
79 | 80 | |