MediaWiki
1.23.2
|
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. More... | |
allLogs () | |
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. More... | |
closeStream () | |
logsByRange ( $start, $end) | |
openStream () | |
pageByName ( $name) | |
pageByTitle ( $title) | |
pagesByName ( $names) | |
pagesByRange ( $start, $end) | |
Dumps a series of page and revision records for those pages in the database falling within the page_id range given. More... | |
revsByRange ( $start, $end) | |
Dumps a series of page and revision records for those pages in the database with revisions falling within the rev_id range given. More... | |
setOutputSink (&$sink) | |
Set the DumpOutput or DumpFilter object which will receive various row objects and XML output for filtering. More... | |
Static Public Member Functions | |
static | schemaVersion () |
Returns the export schema version. More... | |
Public Attributes | |
$author_list = "" | |
$buffer | |
$dumpUploadFileContents = false | |
$dumpUploads = false | |
$list_authors = false | |
DumpOutput | $sink |
$text | |
const | BUFFER = 0 |
const | CURRENT = 2 |
const | FULL = 1 |
const | LOGS = 8 |
const | RANGE = 16 |
const | STABLE = 4 |
const | STREAM = 1 |
const | STUB = 1 |
const | TEXT = 0 |
Protected Member Functions | |
do_list_authors ( $cond) | |
Generates the distinct list of authors of an article Not called by default (depends on $this->list_authors) Can be set by Special:Export when not exporting whole history. More... | |
dumpFrom ( $cond='') | |
outputLogStream ( $resultset) | |
outputPageStream ( $resultset) | |
Runs through a query result set dumping page and revision records. More... | |
Definition at line 33 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.
DatabaseBase | $db | |
int | array | $history | One of WikiExporter::FULL, WikiExporter::CURRENT, WikiExporter::RANGE or WikiExporter::STABLE, or an associative array:
|
int | $buffer | One of WikiExporter::BUFFER or WikiExporter::STREAM |
int | $text | One of WikiExporter::TEXT or WikiExporter::STUB |
Definition at line 84 of file Export.php.
WikiExporter::allLogs | ( | ) |
Definition at line 185 of file Export.php.
References dumpFrom().
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 120 of file Export.php.
References dumpFrom().
WikiExporter::closeStream | ( | ) |
Definition at line 110 of file Export.php.
|
protected |
Generates the distinct list of authors of an article Not called by default (depends on $this->list_authors) Can be set by Special:Export when not exporting whole history.
$cond |
Definition at line 208 of file Export.php.
References $res, array(), as, Revision\DELETED_USER, wfProfileIn(), and wfProfileOut().
Referenced by dumpFrom().
|
protected |
$cond | string |
MWException | |
Exception |
Definition at line 243 of file Export.php.
References $e, $tables, array(), CURRENT, do_list_authors(), FULL, LogEventsList\getExcludeClause(), outputLogStream(), outputPageStream(), RANGE, STABLE, STREAM, STUB, text, wfProfileIn(), wfProfileOut(), and wfRunHooks().
Referenced by allLogs(), allPages(), logsByRange(), pageByTitle(), pagesByRange(), and revsByRange().
WikiExporter::logsByRange | ( | $start, | |
$end | |||
) |
WikiExporter::openStream | ( | ) |
Definition at line 105 of file Export.php.
|
protected |
$resultset | array |
Definition at line 465 of file Export.php.
References $output, as, and writer.
Referenced by dumpFrom().
|
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.
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 430 of file Export.php.
References $author_list, $last, $output, as, dumpUploadFileContents, dumpUploads, and writer.
Referenced by dumpFrom().
WikiExporter::pageByName | ( | $name | ) |
$name | string |
MWException |
Definition at line 167 of file Export.php.
References $name, $title, Title\newFromText(), and pageByTitle().
Referenced by pagesByName().
WikiExporter::pageByTitle | ( | $title | ) |
$title | Title |
Definition at line 157 of file Export.php.
References $title, and dumpFrom().
Referenced by pageByName().
WikiExporter::pagesByName | ( | $names | ) |
$names | array |
Definition at line 179 of file Export.php.
References $name, as, and pageByName().
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.
int | $start | inclusive lower limit (this id is included) |
int | $end | Exclusive upper limit (this id is not included) If 0, no upper limit. |
Definition at line 131 of file Export.php.
References dumpFrom().
WikiExporter::revsByRange | ( | $start, | |
$end | |||
) |
Dumps a series of page and revision records for those pages in the database with revisions falling within the rev_id range given.
int | $start | inclusive lower limit (this id is included) |
int | $end | Exclusive upper limit (this id is not included) If 0, no upper limit. |
Definition at line 146 of file Export.php.
References dumpFrom().
|
static |
Returns the export schema version.
Definition at line 64 of file Export.php.
Referenced by XmlDumpWriter\openStream(), XmlDumpWriter\schemaVersion(), and ExportDemoTest\testExportDemo().
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 101 of file Export.php.
References $sink.
WikiExporter::$author_list = "" |
Definition at line 35 of file Export.php.
Referenced by outputPageStream().
WikiExporter::$buffer |
Definition at line 52 of file Export.php.
Referenced by __construct().
WikiExporter::$dumpUploadFileContents = false |
Definition at line 38 of file Export.php.
WikiExporter::$dumpUploads = false |
Definition at line 37 of file Export.php.
WikiExporter::$list_authors = false |
Definition at line 34 of file Export.php.
DumpOutput WikiExporter::$sink |
Definition at line 58 of file Export.php.
Referenced by setOutputSink().
WikiExporter::$text |
Definition at line 54 of file Export.php.
Referenced by __construct().
const WikiExporter::BUFFER = 0 |
Definition at line 46 of file Export.php.
Referenced by SpecialExport\doExport().
const WikiExporter::CURRENT = 2 |
Definition at line 41 of file Export.php.
Referenced by SpecialExport\doExport(), dumpFrom(), SpecialExport\execute(), BackupDumper\initProgress(), TextPassDumper\processOption(), BackupDumperPageTest\testCurrentStubGzip(), and BackupDumperPageTest\testCurrentStubPlain().
const WikiExporter::FULL = 1 |
Definition at line 40 of file Export.php.
Referenced by TextPassDumperTest\checkpointHelper(), SpecialExport\doExport(), dumpFrom(), SpecialExport\execute(), TextPassDumper\processOption(), BackupDumperPageTest\testFullStubPlain(), BackupDumperPageTest\testFullTextPlain(), TextPassDumperTest\testPlain(), TextPassDumperTest\testPrefetchPlain(), and BackupDumperPageTest\testXmlDumpsBackupUseCase().
const WikiExporter::LOGS = 8 |
Definition at line 43 of file Export.php.
Referenced by BackupDumper\dump(), BackupDumperLoggerTest\testPlain(), and BackupDumperLoggerTest\testXmlDumpsBackupUseCaseLogging().
const WikiExporter::RANGE = 16 |
Definition at line 44 of file Export.php.
Referenced by dumpFrom().
const WikiExporter::STABLE = 4 |
Definition at line 42 of file Export.php.
Referenced by dumpFrom().
const WikiExporter::STREAM = 1 |
Definition at line 47 of file Export.php.
Referenced by SpecialExport\doExport(), BackupDumper\dump(), and dumpFrom().
const WikiExporter::STUB = 1 |
Definition at line 50 of file Export.php.
Referenced by dumpFrom(), BackupDumperPageTest\testCurrentStubGzip(), BackupDumperPageTest\testCurrentStubPlain(), BackupDumperPageTest\testFullStubPlain(), and BackupDumperPageTest\testXmlDumpsBackupUseCase().
const WikiExporter::TEXT = 0 |
Definition at line 49 of file Export.php.
Referenced by TextPassDumperTest\checkpointHelper(), BackupDumperPageTest\testFullTextPlain(), TextPassDumperTest\testPlain(), BackupDumperLoggerTest\testPlain(), TextPassDumperTest\testPrefetchPlain(), and BackupDumperLoggerTest\testXmlDumpsBackupUseCaseLogging().