Merge "Various simple optimizations for the chunked upload process."
[lhc/web/wiklou.git] / includes / filerepo / FileRepo.php
index 5201552..cbcc6c8 100644 (file)
@@ -1420,6 +1420,17 @@ class FileRepo {
                return $this->backend->getFileTimestamp( array( 'src' => $path ) );
        }
 
+       /**
+        * Get the size of a file with a given virtual URL/storage path
+        *
+        * @param $virtualUrl string
+        * @return integer|bool False on failure
+        */
+       public function getFileSize( $virtualUrl ) {
+               $path = $this->resolveToStoragePath( $virtualUrl );
+               return $this->backend->getFileSize( array( 'src' => $path ) );
+       }
+
        /**
         * Get the sha1 (base 36) of a file with a given virtual URL/storage path
         *