[FileRepo] Use the backend sha1 function for getting sha1s.
authorAaron Schulz <aschulz@wikimedia.org>
Fri, 17 Aug 2012 03:00:24 +0000 (20:00 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Fri, 17 Aug 2012 03:00:24 +0000 (20:00 -0700)
Change-Id: I1ad1e25c3c9edfe132416d66f37aa284a448c503

includes/filerepo/FileRepo.php

index 32ef5a9..1563a58 100644 (file)
@@ -1388,18 +1388,14 @@ class FileRepo {
        }
 
        /**
-        * Get the sha1 of a file with a given virtual URL/storage path
+        * Get the sha1 (base 36) of a file with a given virtual URL/storage path
         *
         * @param $virtualUrl string
         * @return string|bool
         */
        public function getFileSha1( $virtualUrl ) {
                $path = $this->resolveToStoragePath( $virtualUrl );
-               $tmpFile = $this->backend->getLocalReference( array( 'src' => $path ) );
-               if ( !$tmpFile ) {
-                       return false;
-               }
-               return $tmpFile->getSha1Base36();
+               return $this->backend->getFileSha1Base36( array( 'src' => $path ) );
        }
 
        /**