Add File::getDescriptionTouched() method
[lhc/web/wiklou.git] / includes / filerepo / file / File.php
index 58311d3..6ca61b2 100644 (file)
@@ -138,10 +138,10 @@ abstract class File {
        /** @var Title */
        protected $redirectTitle;
 
-       /** @var bool Wether the output of transform() for this file is likely to be valid. */
+       /** @var bool Whether the output of transform() for this file is likely to be valid. */
        protected $canRender;
 
-       /** @var bool Wether this media file is in a format that is unlikely to
+       /** @var bool Whether this media file is in a format that is unlikely to
         *    contain viruses or malicious content
         */
        protected $isSafeFile;
@@ -471,8 +471,6 @@ abstract class File {
        public function getThumbnailBucket( $desiredWidth, $page = 1 ) {
                global $wgThumbnailBuckets, $wgThumbnailMinimumBucketDistance;
 
-               wfDebugLog( 'thumbnail', 'thumbnail buckets ' . json_encode( $wgThumbnailBuckets ) );
-
                $imageWidth = $this->getWidth( $page );
 
                if ( $imageWidth === false ) {
@@ -998,7 +996,6 @@ abstract class File {
        function transform( $params, $flags = 0 ) {
                global $wgThumbnailEpoch;
 
-               wfProfileIn( __METHOD__ );
                do {
                        if ( !$this->canRender() ) {
                                $thumb = $this->iconThumb();
@@ -1071,8 +1068,6 @@ abstract class File {
                        }
                } while ( false );
 
-               wfProfileOut( __METHOD__ );
-
                return is_object( $thumb ) ? $thumb : false;
        }
 
@@ -1102,9 +1097,7 @@ abstract class File {
                }
 
                // Actually render the thumbnail...
-               wfProfileIn( __METHOD__ . '-doTransform' );
                $thumb = $handler->doTransform( $this, $tmpThumbPath, $thumbUrl, $transformParams );
-               wfProfileOut( __METHOD__ . '-doTransform' );
                $tmpFile->bind( $thumb ); // keep alive with $thumb
 
                if ( !$thumb ) { // bad params?
@@ -1460,7 +1453,7 @@ abstract class File {
 
        /**
         * Get the path of the file relative to the public zone root.
-        * This function is overriden in OldLocalFile to be like getArchiveRel().
+        * This function is overridden in OldLocalFile to be like getArchiveRel().
         *
         * @return string
         */
@@ -1504,7 +1497,7 @@ abstract class File {
 
        /**
         * Get urlencoded path of the file relative to the public zone root.
-        * This function is overriden in OldLocalFile to be like getArchiveUrl().
+        * This function is overridden in OldLocalFile to be like getArchiveUrl().
         *
         * @return string
         */
@@ -2053,6 +2046,17 @@ abstract class File {
                return $this->repo->getFileTimestamp( $this->getPath() );
        }
 
+       /**
+        * Returns the timestamp (in TS_MW format) of the last change of the description page.
+        * Returns false if the file does not have a description page, or retrieving the timestamp
+        * would be expensive.
+        * @since 1.25
+        * @return string|bool
+        */
+       public function getDescriptionTouched() {
+               return false;
+       }
+
        /**
         * Get the SHA-1 base 36 hash of the file
         *