X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FCategoryFinder.php;h=89bf5c7327058dd3bfd643d5b8ed5f82642aa7d7;hb=f629d095f0469dc9fa29143a8efdc498ee634730;hp=3d5e6c58ab8acacd25303b88277bc2b6675938b0;hpb=b42a366b66c75898d70b0b70eb9be7e73cf0bc35;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/CategoryFinder.php b/includes/CategoryFinder.php index 3d5e6c58ab..89bf5c7327 100644 --- a/includes/CategoryFinder.php +++ b/includes/CategoryFinder.php @@ -20,6 +20,8 @@ * @file */ +use Wikimedia\Rdbms\IDatabase; + /** * The "CategoryFinder" class takes a list of articles, creates an internal * representation of all their parent categories (as well as parents of @@ -40,7 +42,6 @@ * $a = $cf->run(); * print implode( ',' , $a ); * @endcode - * */ class CategoryFinder { /** @var int[] The original article IDs passed to the seed function */ @@ -64,7 +65,7 @@ class CategoryFinder { /** @var string "AND" or "OR" */ protected $mode; - /** @var IDatabase Read-DB slave */ + /** @var IDatabase Read-DB replica DB */ protected $dbr; /** @@ -96,7 +97,7 @@ class CategoryFinder { * @return array Array of page_ids (those given to seed() that match the conditions) */ public function run() { - $this->dbr = wfGetDB( DB_SLAVE ); + $this->dbr = wfGetDB( DB_REPLICA ); while ( count( $this->next ) > 0 ) { $this->scanNextLayer(); } @@ -185,7 +186,6 @@ class CategoryFinder { * Scans a "parent layer" of the articles/categories in $this->next */ private function scanNextLayer() { - # Find all parents of the article currently in $this->next $layer = []; $res = $this->dbr->select(