From: Bryan Tong Minh Date: Fri, 18 Jun 2010 20:00:27 +0000 (+0000) Subject: (bug 23666) FileRepo: Moved File::isLocal() to FileRepo::isLocal(). Patch by Umherirr... X-Git-Tag: 1.31.0-rc.0~36471 X-Git-Url: http://git.cyclocoop.org/%24href?a=commitdiff_plain;h=4d13f0383d80730fb104903ca8ce93f997a6f38e;p=lhc%2Fweb%2Fwiklou.git (bug 23666) FileRepo: Moved File::isLocal() to FileRepo::isLocal(). Patch by Umherirrender --- diff --git a/includes/filerepo/File.php b/includes/filerepo/File.php index 4cf7d3a2a4..ad69519f46 100644 --- a/includes/filerepo/File.php +++ b/includes/filerepo/File.php @@ -911,7 +911,8 @@ abstract class File { * @return bool */ function isLocal() { - return $this->getRepoName() == 'local'; + $repo = $this->getRepo(); + return $repo && $repo->isLocal(); } /** diff --git a/includes/filerepo/FileRepo.php b/includes/filerepo/FileRepo.php index 957930e44f..c97423c80b 100644 --- a/includes/filerepo/FileRepo.php +++ b/includes/filerepo/FileRepo.php @@ -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.