/** * Runs through a query result set dumping page and revision records. * The result set should be sorted/grouped by page to avoid duplicate * page records in the output. * * Should be safe for * streaming (non-buffered) queries, as long as it was made on a * separate database connection not managed by LoadBalancer; some * blob storage types will make queries to pull source data. * * @param ResultWrapper $resultset */ protected function outputPageStream($resultset) { $last = null; foreach ($resultset as $row) { if ($last === null || $last->page_namespace != $row->page_namespace || $last->page_title != $row->page_title) { if ($last !== null) { $output = ''; if ($this->dumpUploads) { $output .= $this->writer->writeUploads($last, $this->dumpUploadFileContents); } $output .= $this->writer->closePage(); $this->sink->writeClosePage($output); } $output = $this->writer->openPage($row); $this->sink->writeOpenPage($row, $output); $last = $row; } $output = $this->writer->writeRevision($row); $this->sink->writeRevision($row, $output); } if ($last !== null) { $output = ''; if ($this->dumpUploads) { $output .= $this->writer->writeUploads($last, $this->dumpUploadFileContents); } $output .= $this->author_list; $output .= $this->writer->closePage(); $this->sink->writeClosePage($output); } }
/** * @param object $rev * @param string $string */ function writeLogItem($rev, $string) { $this->sink->writeRevision($rev, $string); }