* @return FileRepoStatus object.
*/
function delete( $reason, $suppress = false ) {
+ global $wgUseSquid;
if ( $this->getRepo()->getReadOnlyReason() !== false ) {
return $this->readOnlyFatalStatus();
}
$this->purgeOldThumbnails( $archiveName );
}
+ if ( $wgUseSquid ) {
+ // Purge the squid
+ $purgeUrls = array();
+ foreach ($archiveNames as $archiveName ) {
+ $purgeUrls[] = $this->getArchiveUrl( $archiveName );
+ }
+ SquidUpdate::purge( $purgeUrls );
+ }
+
return $status;
}
* @return FileRepoStatus object.
*/
function deleteOld( $archiveName, $reason, $suppress = false ) {
+ global $wgUseSquid;
if ( $this->getRepo()->getReadOnlyReason() !== false ) {
return $this->readOnlyFatalStatus();
}
$this->purgeHistory();
}
+ if ( $wgUseSquid ) {
+ // Purge the squid
+ SquidUpdate::purge( array( $this->getArchiveUrl( $archiveName ) ) );
+ }
+
return $status;
}
}
public function doPostCommitUpdates() {
+ global $wgUseSquid;
$file = wfLocalFile( $this->title );
$file->purgeCache();
$file->purgeDescription();
+ $purgeUrls = array();
foreach ( $this->ids as $timestamp ) {
- $file->purgeOldThumbnails( $timestamp . '!' . $this->title->getDBkey() );
+ $archiveName = $timestamp . '!' . $this->title->getDBkey();
+ $file->purgeOldThumbnails( $archiveName );
+ $purgeUrls[] = $file->getArchiveUrl( $archiveName );
+ }
+ if ( $wgUseSquid ) {
+ // purge full images from cache
+ SquidUpdate::purge( $purgeUrls );
}
return Status::newGood();
}