X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2Ffilerepo%2FRepoGroup.php;h=6b31b7e54d6dfcd3874e79ee1523dd35ea4951eb;hb=d6e31f68b168d49c6382654055955744625d936c;hp=0def2d83850f3b930dd99d4c8df5d4903b8c9463;hpb=3d7f9d6fee486a2bd8dd5037bb0d2dac9c57644d;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/filerepo/RepoGroup.php b/includes/filerepo/RepoGroup.php index 0def2d8385..6b31b7e54d 100644 --- a/includes/filerepo/RepoGroup.php +++ b/includes/filerepo/RepoGroup.php @@ -165,6 +165,10 @@ class RepoGroup { return $image; } + /** + * @param $inputItems array + * @return array + */ function findFiles( $inputItems ) { if ( !$this->reposInitialised ) { $this->initialiseRepos(); @@ -196,6 +200,7 @@ class RepoGroup { /** * Interface for FileRepo::checkRedirect() + * @param $title Title * @return bool */ function checkRedirect( Title $title ) { @@ -254,11 +259,13 @@ class RepoGroup { foreach ( $this->foreignRepos as $repo ) { $result = array_merge( $result, $repo->findBySha1( $hash ) ); } + usort( $result, 'File::compare' ); return $result; } /** * Get the repo instance with a given key. + * @param $index string|int * @return bool|LocalRepo */ function getRepo( $index ) { @@ -273,8 +280,10 @@ class RepoGroup { return false; } } + /** * Get the repo instance by its name + * @param $name string * @return bool */ function getRepoByName( $name ) { @@ -282,8 +291,9 @@ class RepoGroup { $this->initialiseRepos(); } foreach ( $this->foreignRepos as $repo ) { - if ( $repo->name == $name) + if ( $repo->name == $name ) { return $repo; + } } return false; } @@ -351,6 +361,7 @@ class RepoGroup { /** * Split a virtual URL into repo, zone and rel parts * @param $url string + * @throws MWException * @return array containing repo, zone and rel */ function splitVirtualUrl( $url ) { @@ -365,6 +376,10 @@ class RepoGroup { return $bits; } + /** + * @param $fileName string + * @return array + */ function getFileProps( $fileName ) { if ( FileRepo::isVirtualUrl( $fileName ) ) { list( $repoName, /* $zone */, /* $rel */ ) = $this->splitVirtualUrl( $fileName );