r29980 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r29979‎ | r29980 | r29981 >
Date:12:48, 20 January 2008
Author:vasilievvv
Status:old
Tags:
Comment:
* Fix image caching
Modified paths:
  • /trunk/phase3/includes/filerepo/LocalFile.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/filerepo/LocalFile.php
@@ -5,7 +5,7 @@
66 /**
77 * Bump this number when serialized cache records may be incompatible.
88 */
9 -define( 'MW_FILE_VERSION', 5 );
 9+define( 'MW_FILE_VERSION', 6 );
1010
1111 /**
1212 * Class to represent a local file in the wiki's own database
@@ -157,7 +157,7 @@
158158
159159 function getCacheFields( $prefix = 'img_' ) {
160160 static $fields = array( 'size', 'width', 'height', 'bits', 'media_type',
161 - 'major_mime', 'minor_mime', 'metadata', 'timestamp', 'sha1', 'user', 'user_text' );
 161+ 'major_mime', 'minor_mime', 'metadata', 'timestamp', 'sha1', 'user', 'user_text', 'description' );
162162 static $results = array();
163163 if ( $prefix == '' ) {
164164 return $fields;
@@ -720,6 +720,9 @@
721721 if ( !$props ) {
722722 $props = $this->repo->getFileProps( $this->getVirtualUrl() );
723723 }
 724+ $props['description'] = $comment;
 725+ $props['user'] = $wgUser->getID();
 726+ $props['user_text'] = $wgUser->getName();
724727 $this->setProps( $props );
725728
726729 // Delete thumbnails and refresh the metadata cache

Status & tagging log