Merge "Edit warning should get value from editors"
[lhc/web/wiklou.git] / includes / filerepo / RepoGroup.php
index 103e78e..fce3f78 100644 (file)
@@ -272,7 +272,7 @@ class RepoGroup {
        /**
         * Find all instances of files with this key
         *
-        * @param string $hash base 36 SHA-1 hash
+        * @param string $hash Base 36 SHA-1 hash
         * @return array Array of File objects
         */
        function findBySha1( $hash ) {
@@ -292,7 +292,7 @@ class RepoGroup {
        /**
         * Find all instances of files with this keys
         *
-        * @param array $hashes base 36 SHA-1 hashes
+        * @param array $hashes Base 36 SHA-1 hashes
         * @return array Array of array of File objects
         */
        function findBySha1s( array $hashes ) {
@@ -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://' ) {