| Index: trunk/phase3/includes/api/ApiQueryAllimages.php |
| — | — | @@ -38,7 +38,18 @@ |
| 39 | 39 | |
| 40 | 40 | public function __construct($query, $moduleName) { |
| 41 | 41 | parent :: __construct($query, $moduleName, 'ai'); |
| | 42 | + $this->mRepo = RepoGroup::singleton()->getLocalRepo(); |
| 42 | 43 | } |
| | 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 | + } |
| 43 | 54 | |
| 44 | 55 | public function execute() { |
| 45 | 56 | $this->run(); |
| — | — | @@ -52,7 +63,7 @@ |
| 53 | 64 | } |
| 54 | 65 | |
| 55 | 66 | private function run($resultPageSet = null) { |
| 56 | | - $repo = RepoGroup::singleton()->getLocalRepo(); |
| | 67 | + $repo = $this->mRepo; |
| 57 | 68 | if ( !$repo instanceof LocalRepo ) |
| 58 | 69 | $this->dieUsage('Local file repository does not support querying all images', 'unsupportedrepo'); |
| 59 | 70 | |