r54350 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r54349‎ | r54350 | r54351 >
Date:08:40, 4 August 2009
Author:btongminh
Status:ok
Tags:
Comment:
Overide getDB() method to make sure to make sure the repo's DB is used which may not necesarilly be the same as the local DB.
Modified paths:
  • /trunk/phase3/includes/api/ApiQueryAllimages.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiQueryAllimages.php
@@ -38,7 +38,18 @@
3939
4040 public function __construct($query, $moduleName) {
4141 parent :: __construct($query, $moduleName, 'ai');
 42+ $this->mRepo = RepoGroup::singleton()->getLocalRepo();
4243 }
 44+
 45+ /**
 46+ * Overide parent method to make sure to make sure the repo's DB is used
 47+ * which may not necesarilly be the same as the local DB.
 48+ *
 49+ * TODO: allow querying non-local repos.
 50+ */
 51+ protected function getDB() {
 52+ return $this->mRepo->getSlaveDB();
 53+ }
4354
4455 public function execute() {
4556 $this->run();
@@ -52,7 +63,7 @@
5364 }
5465
5566 private function run($resultPageSet = null) {
56 - $repo = RepoGroup::singleton()->getLocalRepo();
 67+ $repo = $this->mRepo;
5768 if ( !$repo instanceof LocalRepo )
5869 $this->dieUsage('Local file repository does not support querying all images', 'unsupportedrepo');
5970

Follow-up revisions

RevisionCommit summaryAuthorDate
r84412Typo from r54350: Overide > Overridekrinkle19:09, 20 March 2011

Status & tagging log