* @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
* $a = $cf->run();
* print implode( ',' , $a );
* @endcode
- *
*/
class CategoryFinder {
/** @var int[] The original article IDs passed to the seed function */
* @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();
}
* 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(