MediaWiki  REL1_24
WikiExporter Class Reference
Collaboration diagram for WikiExporter:

List of all members.

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.
 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.
 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.
 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.
 setOutputSink (&$sink)
 Set the DumpOutput or DumpFilter object which will receive various row objects and XML output for filtering.

Static Public Member Functions

static schemaVersion ()
 Returns the export schema version.

Public Attributes

string $author_list = ""
 *
int $buffer
 *
bool $dumpUploadFileContents = false
 *
bool $dumpUploads = false
 *
bool $list_authors = false
 Return distinct author list (when not returning full history) *.
DumpOutput $sink
 *
int $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.
 dumpFrom ($cond= '')
 outputLogStream ($resultset)
 outputPageStream ($resultset)
 Runs through a query result set dumping page and revision records.

Detailed Description

Definition at line 33 of file Export.php.


Constructor & Destructor Documentation

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.

Parameters:
DatabaseBase$db
int | array$historyOne of WikiExporter::FULL, WikiExporter::CURRENT, WikiExporter::RANGE or WikiExporter::STABLE, 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
int$bufferOne of WikiExporter::BUFFER or WikiExporter::STREAM
int$textOne of WikiExporter::TEXT or WikiExporter::STUB

Definition at line 84 of file Export.php.


Member Function Documentation

Definition at line 185 of file Export.php.

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.

Definition at line 110 of file Export.php.

WikiExporter::do_list_authors ( cond) [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.

Parameters:
array$cond

Definition at line 208 of file Export.php.

WikiExporter::dumpFrom ( cond = '') [protected]
Parameters:
string$cond
Exceptions:
MWException
Exception

Definition at line 243 of file Export.php.

WikiExporter::logsByRange ( start,
end 
)
Parameters:
int$start
int$end

Definition at line 193 of file Export.php.

Definition at line 105 of file Export.php.

WikiExporter::outputLogStream ( resultset) [protected]
Parameters:
ResultWrapper$resultset

Definition at line 463 of file Export.php.

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.

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.

Parameters:
ResultWrapper$resultset

Definition at line 428 of file Export.php.

Parameters:
string$name
Exceptions:
MWException

Definition at line 167 of file Export.php.

Parameters:
Title$title

Definition at line 157 of file Export.php.

Parameters:
array$names

Definition at line 179 of file Export.php.

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.

Parameters:
int$startInclusive lower limit (this id is included)
int$endExclusive upper limit (this id is not included) If 0, no upper limit.

Definition at line 131 of file Export.php.

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.

Parameters:
int$startInclusive lower limit (this id is included)
int$endExclusive upper limit (this id is not included) If 0, no upper limit.

Definition at line 146 of file Export.php.

static WikiExporter::schemaVersion ( ) [static]

Returns the export schema version.

Returns:
string

Definition at line 64 of file Export.php.

Referenced by ExportDemoTest\testExportDemo().

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.

Parameters:
DumpOutput$sink

Definition at line 101 of file Export.php.


Member Data Documentation

string WikiExporter::$author_list = ""

*

Definition at line 40 of file Export.php.

int WikiExporter::$buffer

*

Definition at line 54 of file Export.php.

bool WikiExporter::$dumpUploadFileContents = false

*

Definition at line 38 of file Export.php.

bool WikiExporter::$dumpUploads = false

*

Definition at line 36 of file Export.php.

bool WikiExporter::$list_authors = false

Return distinct author list (when not returning full history) *.

Definition at line 34 of file Export.php.

DumpOutput WikiExporter::$sink

*

Definition at line 58 of file Export.php.

int WikiExporter::$text

*

Definition at line 56 of file Export.php.

Definition at line 48 of file Export.php.

Referenced by SpecialExport\doExport().

const WikiExporter::RANGE = 16

Definition at line 46 of file Export.php.

Definition at line 44 of file Export.php.

Definition at line 49 of file Export.php.

Referenced by SpecialExport\doExport().


The documentation for this class was generated from the following file: