(bug 23666) FileRepo: Moved File::isLocal() to FileRepo::isLocal(). Patch by Umherirr...
authorBryan Tong Minh <btongminh@users.mediawiki.org>
Fri, 18 Jun 2010 20:00:27 +0000 (20:00 +0000)
committerBryan Tong Minh <btongminh@users.mediawiki.org>
Fri, 18 Jun 2010 20:00:27 +0000 (20:00 +0000)
includes/filerepo/File.php
includes/filerepo/FileRepo.php

index 4cf7d3a..ad69519 100644 (file)
@@ -911,7 +911,8 @@ abstract class File {
         * @return bool
         */
        function isLocal() {
-               return $this->getRepoName() == 'local';
+               $repo = $this->getRepo();
+               return $repo && $repo->isLocal();
        }
 
        /**
index 957930e..c97423c 100644 (file)
@@ -621,7 +621,7 @@ abstract class FileRepo {
         */
        public function getDisplayName() {
                // We don't name our own repo, return nothing
-               if ( $this->name == 'local' ) {
+               if ( $this->isLocal() ) {
                        return null;
                }
                // 'shared-repo-name-wikimediacommons' is used when $wgUseInstantCommons = true
@@ -632,6 +632,16 @@ abstract class FileRepo {
                return wfMsg( 'shared-repo' );
        }
 
+       /**
+        * Returns true if this the local file repository.
+        *
+        * @return bool
+        */
+       function isLocal() {
+               return $this->getName() == 'local';
+       }
+
+
        /**
         * Get a key on the primary cache for this repository.
         * Returns false if the repository's cache is not accessible at this site.