Introduce InterwikiLookupAdapter on top of SiteLookup
[lhc/web/wiklou.git] / includes / api / ApiPurge.php
index 822369a..5d1352c 100644 (file)
@@ -55,7 +55,12 @@ class ApiPurge extends ApiBase {
                        ApiQueryBase::addTitleInfo( $r, $title );
                        $page = WikiPage::factory( $title );
                        if ( !$user->pingLimiter( 'purge' ) ) {
-                               $page->doPurge(); // Directly purge and skip the UI part of purge().
+                               $flags = WikiPage::PURGE_ALL;
+                               if ( !$this->getRequest()->wasPosted() ) {
+                                       $flags ^= WikiPage::PURGE_GLOBAL_PCACHE; // skip DB_MASTER write
+                               }
+                               // Directly purge and skip the UI part of purge()
+                               $page->doPurge( $flags );
                                $r['purged'] = true;
                        } else {
                                $error = $this->parseMsg( [ 'actionthrottledtext' ] );
@@ -91,7 +96,9 @@ class ApiPurge extends ApiBase {
                                                # Update the links tables
                                                $updates = $content->getSecondaryDataUpdates(
                                                        $title, null, $forceRecursiveLinkUpdate, $p_result );
-                                               DataUpdate::runUpdates( $updates );
+                                               foreach ( $updates as $update ) {
+                                                       DeferredUpdates::addUpdate( $update, DeferredUpdates::PRESEND );
+                                               }
 
                                                $r['linkupdate'] = true;