X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Frevisiondelete%2FRevDelFileList.php;h=75e1885b0c2a5e152f0bc8e2e8d83a11e797f539;hb=5120937028f768749d058aa91dde82a96de0af1c;hp=2295eaa106cbe9da13479f50aee045a3d4975a84;hpb=a300fabb68430e6204eebceb2af9ddbffd72017a;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/revisiondelete/RevDelFileList.php b/includes/revisiondelete/RevDelFileList.php index 2295eaa106..6a6b86c099 100644 --- a/includes/revisiondelete/RevDelFileList.php +++ b/includes/revisiondelete/RevDelFileList.php @@ -19,6 +19,8 @@ * @ingroup RevisionDelete */ +use Wikimedia\Rdbms\IDatabase; + /** * List for oldimage table items */ @@ -53,20 +55,22 @@ class RevDelFileList extends RevDelList { * @return mixed */ public function doQuery( $db ) { - $archiveNames = array(); + $archiveNames = []; foreach ( $this->ids as $timestamp ) { $archiveNames[] = $timestamp . '!' . $this->title->getDBkey(); } + $oiQuery = OldLocalFile::getQueryInfo(); return $db->select( - 'oldimage', - OldLocalFile::selectFields(), - array( + $oiQuery['tables'], + $oiQuery['fields'], + [ 'oi_name' => $this->title->getDBkey(), 'oi_archive_name' => $archiveNames - ), + ], __METHOD__, - array( 'ORDER BY' => 'oi_timestamp DESC' ) + [ 'ORDER BY' => 'oi_timestamp DESC' ], + $oiQuery['joins'] ); } @@ -75,9 +79,9 @@ class RevDelFileList extends RevDelList { } public function clearFileOps() { - $this->deleteBatch = array(); - $this->storeBatch = array(); - $this->cleanupBatch = array(); + $this->deleteBatch = []; + $this->storeBatch = []; + $this->cleanupBatch = []; } public function doPreCommitUpdates() { @@ -104,20 +108,22 @@ class RevDelFileList extends RevDelList { return $status; } - public function doPostCommitUpdates() { + public function doPostCommitUpdates( array $visibilityChangeMap ) { $file = wfLocalFile( $this->title ); $file->purgeCache(); $file->purgeDescription(); - $purgeUrls = array(); + + // Purge full images from cache + $purgeUrls = []; foreach ( $this->ids as $timestamp ) { $archiveName = $timestamp . '!' . $this->title->getDBkey(); $file->purgeOldThumbnails( $archiveName ); $purgeUrls[] = $file->getArchiveUrl( $archiveName ); } - if ( $this->getConfig()->get( 'UseSquid' ) ) { - // purge full images from cache - SquidUpdate::purge( $purgeUrls ); - } + DeferredUpdates::addUpdate( + new CdnCacheUpdate( $purgeUrls ), + DeferredUpdates::PRESEND + ); return Status::newGood(); }