r101224 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r101223‎ | r101224 | r101225 >
Date:22:21, 28 October 2011
Author:aaron
Status:ok
Tags:
Comment:
FU r100716:
* Pass the File object in LocalFilePurgeThumbnails so handlers can use the getRel() functions and such
* Also added the hook to hooks.txt, as this could be useful for other caches or things in thumb_handler.php
Modified paths:
  • /trunk/phase3/docs/hooks.txt (modified) (history)
  • /trunk/phase3/includes/filerepo/LocalFile.php (modified) (history)

Diff [purge]

Index: trunk/phase3/docs/hooks.txt
@@ -1177,13 +1177,17 @@
11781178 &updater: A DatabaseUpdater subclass
11791179
11801180 'LocalFile::getHistory': called before file history query performed
1181 -$file: the file
 1181+$file: the File object
11821182 $tables: tables
11831183 $fields: select fields
11841184 $conds: conditions
11851185 $opts: query options
11861186 $join_conds: JOIN conditions
11871187
 1188+'LocalFilePurgeThumbnails': called before thumbnails for a local file a purged
 1189+$file: the File object
 1190+$type: either "current" or "archive"
 1191+
11881192 'LocalisationCacheRecache': Called when loading the localisation data into cache
11891193 $cache: The LocalisationCache object
11901194 $code: language code
Index: trunk/phase3/includes/filerepo/LocalFile.php
@@ -691,7 +691,7 @@
692692 */
693693 function purgeOldThumbnails( $archiveName ) {
694694 global $wgUseSquid;
695 - // get a list of old thumbnails and URLs
 695+ // Get a list of old thumbnails and URLs
696696 $files = $this->getThumbnails( $archiveName );
697697 $dir = array_shift( $files );
698698 $this->purgeThumbList( $dir, $files );
@@ -705,8 +705,8 @@
706706 }
707707 wfRestoreWarnings();
708708
709 - # Temporary hook for purging Swift thumbnail cache
710 - wfRunHooks( 'LocalFilePurgeThumbnails', array( $dir, 'old' ) );
 709+ // Purge any custom thumbnail caches
 710+ wfRunHooks( 'LocalFilePurgeThumbnails', array( $this, 'archive' ) );
711711
712712 // Purge the squid
713713 if ( $wgUseSquid ) {
@@ -730,8 +730,8 @@
731731 $dir = array_shift( $files );
732732 $this->purgeThumbList( $dir, $files );
733733
734 - # Temporary hook for purging Swift thumbnail cache
735 - wfRunHooks( 'LocalFilePurgeThumbnails', array( $dir, 'current' ) );
 734+ // Purge any custom thumbnail caches
 735+ wfRunHooks( 'LocalFilePurgeThumbnails', array( $this, 'current' ) );
736736
737737 // Purge the squid
738738 if ( $wgUseSquid ) {

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r100716Added temporary LocalFilePurgeThumbnails hook for bug 27641aaron17:19, 25 October 2011

Status & tagging log