return 'rev_id';
}
+ public static function getRestriction() {
+ return 'deleterevision';
+ }
+
+ public static function getRevdelConstant() {
+ return Revision::DELETED_TEXT;
+ }
+
+ public static function suggestTarget( $target, array $ids ) {
+ $rev = Revision::newFromId( $ids[0] );
+ return $rev ? $rev->getTitle() : $target;
+ }
+
/**
* @param $db DatabaseBase
* @return mixed
return 'oi_archive_name';
}
+ public static function getRestriction() {
+ return 'deleterevision';
+ }
+
+ public static function getRevdelConstant() {
+ return File::DELETED_FILE;
+ }
+
var $storeBatch, $deleteBatch, $cleanupBatch;
/**
}
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();
}
return 'log_id';
}
+ public static function getRestriction() {
+ return 'deletelogentry';
+ }
+
+ public static function getRevdelConstant() {
+ return LogPage::DELETED_ACTION;
+ }
+
+ public static function suggestTarget( $target, array $ids ) {
+ $result = wfGetDB( DB_SLAVE )->select( 'logging',
+ 'log_type',
+ array( 'log_id' => $ids ),
+ __METHOD__,
+ array( 'DISTINCT' )
+ );
+ if ( $result->numRows() == 1 ) {
+ // If there's only one type, the target can be set to include it.
+ return SpecialPage::getTitleFor( 'Log', $result->current()->log_type );
+ }
+ return SpecialPage::getTitleFor( 'Log' );
+ }
+
/**
* @param $db DatabaseBase
* @return mixed