r68235 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r68234‎ | r68235 | r68236 >
Date:20:00, 18 June 2010
Author:btongminh
Status:ok
Tags:
Comment:
(bug 23666) FileRepo: Moved File::isLocal() to FileRepo::isLocal(). Patch by Umherirrender
Modified paths:
  • /trunk/phase3/includes/filerepo/File.php (modified) (history)
  • /trunk/phase3/includes/filerepo/FileRepo.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/filerepo/FileRepo.php
@@ -621,7 +621,7 @@
622622 */
623623 public function getDisplayName() {
624624 // We don't name our own repo, return nothing
625 - if ( $this->name == 'local' ) {
 625+ if ( $this->isLocal() ) {
626626 return null;
627627 }
628628 // 'shared-repo-name-wikimediacommons' is used when $wgUseInstantCommons = true
@@ -633,6 +633,16 @@
634634 }
635635
636636 /**
 637+ * Returns true if this the local file repository.
 638+ *
 639+ * @return bool
 640+ */
 641+ function isLocal() {
 642+ return $this->getName() == 'local';
 643+ }
 644+
 645+
 646+ /**
637647 * Get a key on the primary cache for this repository.
638648 * Returns false if the repository's cache is not accessible at this site.
639649 * The parameters are the parts of the key, as for wfMemcKey().
Index: trunk/phase3/includes/filerepo/File.php
@@ -911,7 +911,8 @@
912912 * @return bool
913913 */
914914 function isLocal() {
915 - return $this->getRepoName() == 'local';
 915+ $repo = $this->getRepo();
 916+ return $repo && $repo->isLocal();
916917 }
917918
918919 /**

Status & tagging log