Merge "Sort result of FileRepo::findBySha1"
authorAaron Schulz <aschulz@wikimedia.org>
Fri, 13 Jul 2012 18:14:28 +0000 (18:14 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Fri, 13 Jul 2012 18:14:28 +0000 (18:14 +0000)
1  2 
includes/filerepo/file/File.php

@@@ -245,6 -245,18 +245,18 @@@ abstract class File 
                }
        }
  
+       /**
+        * Callback for usort() to do file sorts by title
+        *
+        * @param $a File
+        * @param $b File
+        *
+        * @return Integer: result of title comparison
+        */
+       public static function compare( File $a, File $b ) {
+               return Title::compare( $a->getTitle(), $b->getTitle() );
+       }
        /**
         * Return the name of this file
         *
        }
  
        /**
 -       * Get the deletion archive key, <sha1>.<ext>
 +       * Get the deletion archive key, "<sha1>.<ext>"
         *
         * @return string
         */