/** * List all page titles */ private static function listPageTitlesCSV() { header("Content-Type: text/csv"); $dbr = wfGetDB(DB_SLAVE); $titles = TitleTests::dbListCustomTitles($dbr); print "page,title\n"; foreach ($titles as $custom) { $title = Title::newFromDBkey($custom['tt_page']); print '"http://www.wikihow.com/' . $title->getPartialUrl() . '","' . $custom['tt_custom'] . '"' . "\n"; } exit; }
static function getCustomTitles() { $dbr = wfGetDB(DB_SLAVE); $titles = TitleTests::dbListCustomTitles($dbr); $notFound = 0; $output = array(); foreach ($titles as $row) { $id = $row['tt_pageid']; $output[$id] = $row; } return $output; }