コード例 #1
0
 function dump($history)
 {
     # This shouldn't happen if on console... ;)
     header('Content-type: text/html; charset=UTF-8');
     # Notice messages will foul up your XML output even if they're
     # relatively harmless.
     ini_set('display_errors', false);
     $this->startTime = wfTime();
     $dbr =& wfGetDB(DB_SLAVE);
     $this->maxCount = $dbr->selectField('page', 'MAX(page_id)', '', 'BackupDumper::dump');
     $this->startTime = wfTime();
     $db =& $this->backupDb();
     $exporter = new WikiExporter($db, $history, MW_EXPORT_STREAM);
     $exporter->setPageCallback(array(&$this, 'reportPage'));
     $exporter->setRevisionCallback(array(&$this, 'revCount'));
     $exporter->openStream();
     if (is_null($this->pages)) {
         $exporter->allPages();
     } else {
         $exporter->pagesByName($this->pages);
     }
     $exporter->closeStream();
     $this->report(true);
 }