コード例 #1
0
ファイル: RepoGroup.php プロジェクト: Tarendai/spring-website
 /**
  * Find all instances of files with this keys
  *
  * @param array $hashes base 36 SHA-1 hashes
  * @return array of array of File objects
  */
 function findBySha1s(array $hashes)
 {
     if (!$this->reposInitialised) {
         $this->initialiseRepos();
     }
     $result = $this->localRepo->findBySha1s($hashes);
     foreach ($this->foreignRepos as $repo) {
         $result = array_merge_recursive($result, $repo->findBySha1s($hashes));
     }
     //sort the merged (and presorted) sublist of each hash
     foreach ($result as $hash => $files) {
         usort($result[$hash], 'File::compare');
     }
     return $result;
 }