From 4d13f0383d80730fb104903ca8ce93f997a6f38e Mon Sep 17 00:00:00 2001 From: Bryan Tong Minh Date: Fri, 18 Jun 2010 20:00:27 +0000 Subject: [PATCH] (bug 23666) FileRepo: Moved File::isLocal() to FileRepo::isLocal(). Patch by Umherirrender --- includes/filerepo/File.php | 3 ++- includes/filerepo/FileRepo.php | 12 +++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) 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. -- 2.20.1