// Tool functions
// --------------
-/// Forces a regeneration of region overview pages
+/// Forces a regeneration of region overview pages ('Tirol', 'Vorarlberg', ...)
function wrRecacheRegions() {
- // TODO: Better implementation - it's a "quick fix" now.
- $title = Title::newFromText('Tirol');
- $title->invalidateCache();
-
- $title = Title::newFromText('Vorarlberg');
- $title->invalidateCache();
+ $dbr = wfGetDB(DB_SLAVE);
+ // SELECT cl_from FROM categorylinks where cl_to = 'Region'
+ $res = $dbr->select('categorylinks', 'cl_from', array('cl_to' => 'Region'));
+ $page_ids = array();
+ while ($row = $dbr->fetchObject($res)) $page_ids[] = $row->cl_from;
+ $dbr->freeResult($res);
- $title = Title::newFromText('Steiermark');
- $title->invalidateCache();
+ $titles = Title::newFromIDs($page_ids);
+ foreach ($titles as $title) $title->invalidateCache();
}