'uploadFromUrl' => 'UploadFromUrlJob',
);
-/**
- * Extensions of "thumbnails" that are very expensive to regenerate and should be
- * excluded from normal action=purge thumbnail removal.
- */
-$wgExcludeFromThumbnailPurge = array();
-
/**
* Jobs that must be explicitly requested, i.e. aren't run by job runners unless special flags are set.
* Purge shared caches such as thumbnails and DB data caching
* STUB
* Overridden by LocalFile
- * @param array $options Array with options, currently undefined
*/
- function purgeCache( $options = array() ) {}
+ function purgeCache() {}
/**
* Purge the file description page, but don't go after
return $files;
}
- /**
- * @see File::purgeCache()
- */
- function purgeCache( $options = array() ) {
- $this->purgeThumbnails( $options );
+ function purgeCache() {
+ $this->purgeThumbnails();
$this->purgeDescriptionPage();
}
$wgMemc->delete( $key );
}
- function purgeThumbnails( $options = array() ) {
+ function purgeThumbnails() {
global $wgMemc;
$key = $this->repo->getLocalCacheKey( 'ForeignAPIRepo', 'ThumbUrl', $this->getName() );
$wgMemc->delete( $key );
-
$files = $this->getThumbnails();
- // Give media handler a chance to filter the purge list
- $handler = $this->getHandler();
- if ( $handler ) {
- $handler->filterThumbnailPurgeList( $files, $options );
- }
-
$dir = $this->getThumbPath( $this->getName() );
foreach ( $files as $file ) {
unlink( $dir . $file );
/**
* Delete all previously generated thumbnails, refresh metadata in memcached and purge the squid
*/
- function purgeCache( $options = array() ) {
+ function purgeCache() {
// Refresh metadata cache
$this->purgeMetadataCache();
// Delete thumbnails
- $this->purgeThumbnails( $options );
+ $this->purgeThumbnails();
// Purge squid cache for this file
SquidUpdate::purge( array( $this->getURL() ) );
/**
* Delete cached transformed files for the current version only.
*/
- function purgeThumbnails( $options = array() ) {
+ function purgeThumbnails() {
global $wgUseSquid;
-
- // Get a list of thumbnails and URLs
+
+ // Delete thumbnails
$files = $this->getThumbnails();
-
- // Give media handler a chance to filter the purge list
- $handler = $this->getHandler();
- if ( $handler ) {
- $handler->filterThumbnailPurgeList( $files, $options );
- }
-
$dir = array_shift( $files );
$this->purgeThumbList( $dir, $files );
* @param $files array of strings: relative filenames (to $dir)
*/
protected function purgeThumbList($dir, $files) {
- global $wgExcludeFromThumbnailPurge;
-
wfDebug( __METHOD__ . ": " . var_export( $files, true ) . "\n" );
foreach ( $files as $file ) {
- // Only remove files not in the $wgExcludeFromThumbnailPurge configuration variable
- $ext = pathinfo( "$dir/$file", PATHINFO_EXTENSION );
- if ( in_array( $ext, $wgExcludeFromThumbnailPurge ) ) {
- continue;
- }
-
# Check that the base file name is part of the thumb name
# This is a basic sanity check to avoid erasing unrelated directories
if ( strpos( $file, $this->getName() ) !== false ) {