X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2Ffilerepo%2FRepoGroup.php;h=fce3f7854bcf8e38a10bba230e810d5cb6b75505;hb=88bed6898f3162f46a92f75e7b917b0599d3e4f2;hp=18432a1572430c22f43be4528ca598544a580503;hpb=36fc07f47aad4d870932bfdcc1bbe55c2a43d94b;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/filerepo/RepoGroup.php b/includes/filerepo/RepoGroup.php index 18432a1572..fce3f7854b 100644 --- a/includes/filerepo/RepoGroup.php +++ b/includes/filerepo/RepoGroup.php @@ -90,7 +90,7 @@ class RepoGroup { * Construct a group of file repositories. * * @param array $localInfo Associative array for local repo's info - * @param array $foreignInfo of repository info arrays. + * @param array $foreignInfo Array of repository info arrays. * Each info array is an associative array with the 'class' member * giving the class name. The entire array is passed to the repository * constructor as the first parameter. @@ -105,7 +105,7 @@ class RepoGroup { * Search repositories for an image. * You can also use wfFindFile() to do this. * - * @param $title Title|string Title object or string + * @param Title|string $title Title object or string * @param array $options Associative array of options: * time: requested time for an archived image, or false for the * current version. An image object will be returned which was @@ -185,7 +185,7 @@ class RepoGroup { * @return array Map of (file name => File objects) for matches * * @param array $inputItems - * @param integer $flags + * @param int $flags * @return array */ function findFiles( array $inputItems, $flags = 0 ) { @@ -220,7 +220,7 @@ class RepoGroup { /** * Interface for FileRepo::checkRedirect() - * @param $title Title + * @param Title $title * @return bool */ function checkRedirect( Title $title ) { @@ -247,9 +247,9 @@ class RepoGroup { * Find an instance of the file with this key, created at the specified time * Returns false if the file does not exist. * - * @param string $hash base 36 SHA-1 hash + * @param string $hash Base 36 SHA-1 hash * @param array $options Option array, same as findFile() - * @return File object or false if it is not found + * @return File|bool File object or false if it is not found */ function findFileFromKey( $hash, $options = array() ) { if ( !$this->reposInitialised ) { @@ -272,8 +272,8 @@ class RepoGroup { /** * Find all instances of files with this key * - * @param string $hash base 36 SHA-1 hash - * @return Array of File objects + * @param string $hash Base 36 SHA-1 hash + * @return array Array of File objects */ function findBySha1( $hash ) { if ( !$this->reposInitialised ) { @@ -292,8 +292,8 @@ class RepoGroup { /** * Find all instances of files with this keys * - * @param array $hashes base 36 SHA-1 hashes - * @return array of array of File objects + * @param array $hashes Base 36 SHA-1 hashes + * @return array Array of array of File objects */ function findBySha1s( array $hashes ) { if ( !$this->reposInitialised ) { @@ -367,6 +367,9 @@ class RepoGroup { * @return bool */ function forEachForeignRepo( $callback, $params = array() ) { + if ( !$this->reposInitialised ) { + $this->initialiseRepos(); + } foreach ( $this->foreignRepos as $repo ) { $args = array_merge( array( $repo ), $params ); if ( call_user_func_array( $callback, $args ) ) { @@ -382,6 +385,9 @@ class RepoGroup { * @return bool */ function hasForeignRepos() { + if ( !$this->reposInitialised ) { + $this->initialiseRepos(); + } return (bool)$this->foreignRepos; } @@ -414,7 +420,7 @@ class RepoGroup { * Split a virtual URL into repo, zone and rel parts * @param string $url * @throws MWException - * @return array containing repo, zone and rel + * @return array Containing repo, zone and rel */ function splitVirtualUrl( $url ) { if ( substr( $url, 0, 9 ) != 'mwrepo://' ) {