From: Bryan Tong Minh Date: Tue, 4 Aug 2009 08:40:38 +0000 (+0000) Subject: Overide getDB() method to make sure to make sure the repo's DB is used which may... X-Git-Tag: 1.31.0-rc.0~40519 X-Git-Url: http://git.cyclocoop.org/%24href?a=commitdiff_plain;h=c99341e5b4342bf0f8881b971d49628f5f1675b6;p=lhc%2Fweb%2Fwiklou.git 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. --- diff --git a/includes/api/ApiQueryAllimages.php b/includes/api/ApiQueryAllimages.php index a4962c80e1..88261afbe9 100644 --- a/includes/api/ApiQueryAllimages.php +++ b/includes/api/ApiQueryAllimages.php @@ -38,6 +38,17 @@ class ApiQueryAllimages extends ApiQueryGeneratorBase { public function __construct($query, $moduleName) { parent :: __construct($query, $moduleName, 'ai'); + $this->mRepo = RepoGroup::singleton()->getLocalRepo(); + } + + /** + * Overide parent method to make sure to make sure the repo's DB is used + * which may not necesarilly be the same as the local DB. + * + * TODO: allow querying non-local repos. + */ + protected function getDB() { + return $this->mRepo->getSlaveDB(); } public function execute() { @@ -52,7 +63,7 @@ class ApiQueryAllimages extends ApiQueryGeneratorBase { } private function run($resultPageSet = null) { - $repo = RepoGroup::singleton()->getLocalRepo(); + $repo = $this->mRepo; if ( !$repo instanceof LocalRepo ) $this->dieUsage('Local file repository does not support querying all images', 'unsupportedrepo');