Public Member Functions | |
__construct (&$db, $history=WikiExporter::CURRENT, $buffer=WikiExporter::BUFFER, $text=WikiExporter::TEXT) | |
If using WikiExporter::STREAM to stream a large amount of data, provide a database connection which is not managed by LoadBalancer to read from: some history blob types will make additional queries to pull source data while the main query is still running. | |
setOutputSink (&$sink) | |
Set the DumpOutput or DumpFilter object which will receive various row objects and XML output for filtering. | |
openStream () | |
closeStream () | |
allPages () | |
Dumps a series of page and revision records for all pages in the database, either including complete history or only the most recent version. | |
pagesByRange ($start, $end) | |
Dumps a series of page and revision records for those pages in the database falling within the page_id range given. | |
pageByTitle ($title) | |
pageByName ($name) | |
pagesByName ($names) | |
allLogs () | |
logsByRange ($start, $end) | |
Public Attributes | |
$list_authors = false | |
$author_list = "" | |
$dumpUploads = false | |
const | FULL = 1 |
const | CURRENT = 2 |
const | STABLE = 4 |
const | LOGS = 8 |
const | BUFFER = 0 |
const | STREAM = 1 |
const | TEXT = 0 |
const | STUB = 1 |
Protected Member Functions | |
do_list_authors ($page, $revision, $cond) | |
dumpFrom ($cond= '') | |
outputPageStream ($resultset) | |
Runs through a query result set dumping page and revision records. | |
outputLogStream ($resultset) |
Definition at line 27 of file Export.php.
WikiExporter::__construct | ( | &$ | db, | |
$ | history = WikiExporter::CURRENT , |
|||
$ | buffer = WikiExporter::BUFFER , |
|||
$ | text = WikiExporter::TEXT | |||
) |
If using WikiExporter::STREAM to stream a large amount of data, provide a database connection which is not managed by LoadBalancer to read from: some history blob types will make additional queries to pull source data while the main query is still running.
$db | Database | |
$history | Mixed: one of WikiExporter::FULL or WikiExporter::CURRENT, or an associative array: offset: non-inclusive offset at which to start the query limit: maximum number of rows to return dir: "asc" or "desc" timestamp order | |
$buffer | Int: one of WikiExporter::BUFFER or WikiExporter::STREAM |
Definition at line 59 of file Export.php.
References $text.
WikiExporter::allLogs | ( | ) |
WikiExporter::allPages | ( | ) |
Dumps a series of page and revision records for all pages in the database, either including complete history or only the most recent version.
Definition at line 95 of file Export.php.
References dumpFrom().
WikiExporter::closeStream | ( | ) |
WikiExporter::do_list_authors | ( | $ | page, | |
$ | revision, | |||
$ | cond | |||
) | [protected] |
Definition at line 153 of file Export.php.
References $fname, $result, $row, $sql, wfProfileIn(), and wfProfileOut().
Referenced by dumpFrom().
WikiExporter::dumpFrom | ( | $ | cond = '' |
) | [protected] |
Definition at line 178 of file Export.php.
References $page, $result, $revision, CURRENT, do_list_authors(), FULL, LogEventsList::getExcludeClause(), outputLogStream(), outputPageStream(), STABLE, STREAM, STUB, wfProfileIn(), wfProfileOut(), and wfRunHooks().
Referenced by allLogs(), allPages(), logsByRange(), pageByTitle(), and pagesByRange().
WikiExporter::logsByRange | ( | $ | start, | |
$ | end | |||
) |
WikiExporter::openStream | ( | ) |
WikiExporter::outputLogStream | ( | $ | resultset | ) | [protected] |
WikiExporter::outputPageStream | ( | $ | resultset | ) | [protected] |
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.
The result set will be freed once complete. 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.
$resultset | ResultWrapper |
Definition at line 298 of file Export.php.
References $output, $row, and dumpUploads.
Referenced by dumpFrom().
WikiExporter::pageByName | ( | $ | name | ) |
Definition at line 123 of file Export.php.
References $name, $title, Title::newFromText(), and pageByTitle().
Referenced by pagesByName().
WikiExporter::pageByTitle | ( | $ | title | ) |
$title | Title |
Definition at line 117 of file Export.php.
References $title, and dumpFrom().
Referenced by pageByName().
WikiExporter::pagesByName | ( | $ | names | ) |
WikiExporter::pagesByRange | ( | $ | start, | |
$ | end | |||
) |
Dumps a series of page and revision records for those pages in the database falling within the page_id range given.
$start | Int: inclusive lower limit (this id is included) | |
$end | Int: Exclusive upper limit (this id is not included) If 0, no upper limit. |
Definition at line 106 of file Export.php.
References $end, $start, and dumpFrom().
WikiExporter::setOutputSink | ( | &$ | sink | ) |
Set the DumpOutput or DumpFilter object which will receive various row objects and XML output for filtering.
Filters can be chained or used as callbacks.
$sink | mixed |
Definition at line 76 of file Export.php.
WikiExporter::$author_list = "" |
Definition at line 29 of file Export.php.
WikiExporter::$dumpUploads = false |
Definition at line 31 of file Export.php.
WikiExporter::$list_authors = false |
Definition at line 28 of file Export.php.
const WikiExporter::BUFFER = 0 |
const WikiExporter::CURRENT = 2 |
Definition at line 34 of file Export.php.
Referenced by SpecialExport::doExport(), dumpFrom(), SpecialExport::execute(), BackupDumper::initProgress(), and TextPassDumper::processOption().
const WikiExporter::FULL = 1 |
Definition at line 33 of file Export.php.
Referenced by dumpFrom(), SpecialExport::execute(), and TextPassDumper::processOption().
const WikiExporter::LOGS = 8 |
const WikiExporter::STABLE = 4 |
const WikiExporter::STREAM = 1 |
Definition at line 39 of file Export.php.
Referenced by SpecialExport::doExport(), BackupDumper::dump(), and dumpFrom().
const WikiExporter::STUB = 1 |
const WikiExporter::TEXT = 0 |
Definition at line 41 of file Export.php.