Go to the documentation of this file.
32 parent::__construct(
"dbzip2",
$file );
78 $this->stderr = fopen(
"php://stderr",
"wt" );
99 $this->outputTypes[
$name] = $class;
107 $this->filterTypes[
$name] = $class;
121 $register =
array( $class,
'register' );
122 call_user_func_array( $register,
array( &$this ) );
134 if ( preg_match(
'/^--(.+?)(?:=(.+?)(?::(.+?))?)?$/', $arg,
$matches ) ) {
141 if ( !is_null(
$sink ) ) {
144 if ( !isset( $this->outputTypes[$val] ) ) {
145 $this->
fatalError(
"Unrecognized output sink type '$val'" );
147 $type = $this->outputTypes[$val];
151 if ( is_null(
$sink ) ) {
154 if ( !isset( $this->filterTypes[$val] ) ) {
155 $this->
fatalError(
"Unrecognized filter type '$val'" );
157 $type = $this->filterTypes[$val];
166 $this->reportingInterval = intval( $val );
172 if ( !function_exists(
'utf8_normalize' ) ) {
173 $this->
fatalError(
"UTF-8 normalization extension not loaded. " .
174 "Install or remove --force-normal parameter to use slower code." );
183 if ( is_null(
$sink ) ) {
188 if ( count( $sinks ) > 1 ) {
200 # Notice messages will foul up your XML output even if they're
201 # relatively harmless.
202 if ( ini_get(
'display_errors' ) ) {
203 ini_set(
'display_errors',
'stderr' );
214 $exporter->setOutputSink( $wrapper );
217 $exporter->openStream();
219 # Log item dumps: all or by range
221 if ( $this->startId || $this->endId ) {
222 $exporter->logsByRange( $this->startId, $this->endId );
224 $exporter->allLogs();
226 # Page dumps: all or by page ID range
227 } elseif ( is_null( $this->
pages ) ) {
228 if ( $this->startId || $this->endId ) {
229 $exporter->pagesByRange( $this->startId, $this->endId );
230 } elseif ( $this->revStartId || $this->revEndId ) {
231 $exporter->revsByRange( $this->revStartId, $this->revEndId );
233 $exporter->allPages();
235 # Dump of specific pages
237 $exporter->pagesByName( $this->
pages );
241 $exporter->closeStream();
258 if ( $this->forcedDb ===
null ) {
261 $this->maxCount =
$dbr->selectField( $table,
"MAX($field)",
'', __METHOD__ );
262 $this->startTime = microtime(
true );
263 $this->lastTime = $this->startTime;
264 $this->
ID = getmypid();
274 if ( $this->forcedDb !==
null ) {
279 $db = $this->lb->getConnection(
DB_SLAVE,
'dump' );
283 $db->setSessionOptions(
array(
'connTimeout' => 3600 * 24 ) );
297 $this->forcedDb = $db;
301 if ( isset( $this->lb ) ) {
302 $this->lb->closeAll();
322 function report( $final =
false ) {
323 if ( $final xor ( $this->
revCount % $this->reportingInterval == 0 ) ) {
329 if ( $this->reporting ) {
331 $nowts = microtime(
true );
332 $deltaAll = $nowts - $this->startTime;
338 $portion = $this->
revCount / $this->maxCount;
339 $eta = $this->startTime + $deltaAll / $portion;
341 $pageRate = $this->pageCount / $deltaAll;
342 $revRate = $this->
revCount / $deltaAll;
349 $pageRatePart = $this->pageCountPart / $deltaPart;
350 $revRatePart = $this->revCountPart / $deltaPart;
355 $this->
progress( sprintf(
"%s: %s (ID %d) %d pages (%0.1f|%0.1f/sec all|curr), %d revs (%0.1f|%0.1f/sec all|curr), ETA %s [max %d]",
356 $now,
wfWikiID(), $this->
ID, $this->pageCount, $pageRate, $pageRatePart, $this->
revCount, $revRate, $revRatePart, $etats, $this->maxCount ) );
357 $this->lastTime = $nowts;
363 fwrite( $this->stderr, $string .
"\n" );
374 parent::__construct(
$sink );
375 $this->progress = $progress;
379 parent::writeClosePage( $string );
380 $this->progress->reportPage();
384 parent::writeRevision(
$rev, $string );
385 $this->progress->revCount();
registerOutput( $name, $class)
occurs before session is loaded can be modified ID
skin txt MediaWiki includes four core it has been set as the default in MediaWiki since the replacing Monobook it had been been the default skin since before being replaced by Vector largely rewritten in while keeping its appearance Several legacy skins were removed in the as the burden of supporting them became too heavy to bear Those in etc for skin dependent CSS etc for skin dependent JavaScript These can also be customised on a per user by etc This feature has led to a wide variety of user styles becoming that gallery is a good place to ending in php
& wfGetDB( $db, $groups=array(), $wiki=false)
Get a Database object.
wfTimestamp( $outputtype=TS_UNIX, $ts=0)
Get a timestamp string in one of various formats.
DatabaseBase null $forcedDb
The dependency-injected database to use.
writeRevision( $rev, $string)
const TS_DB
MySQL DATETIME (YYYY-MM-DD HH:MM:SS)
The ContentHandler facility adds support for arbitrary content types on wiki pages
Base class for output stream; prints to stdout or buffer or wherever.
loadPlugin( $class, $file)
Load a plugin and register it.
setDb(DatabaseBase $db=null)
Force the dump to use the provided database connection for database operations, wherever possible.
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
when a variable name is used in a it is silently declared as a new masking the global
Base class for output stream; prints to stdout or buffer or wherever.
processOption( $opt, $val, $param)
deferred txt A few of the database updates required by various functions here can be deferred until after the result page is displayed to the user For updating the view updating the linked to tables after a etc PHP does not yet have any way to tell the server to actually return and disconnect while still running these but it might have such a feature in the future We handle these by creating a deferred update object and putting those objects on a global list
Database load balancing object.
initProgress( $history=WikiExporter::FULL)
Initialise starting time and maximum revision count.
wfWikiID()
Get an ASCII string identifying this wiki This is used as a prefix in memcached keys.
Allows to change the fields on the form that will be generated $name
if(!defined( 'MEDIAWIKI')) if(!isset( $wgVersion)) $matches
__construct(&$sink, &$progress)
Database abstraction object.
Dump output filter class.
DumpOutput $sink
FIXME will need to be made protected whenever legacy code is updated.
if(PHP_SAPI !='cli') $file
presenting them properly to the user as errors is done by the caller return true use this to change the list i e etc $rev
& wfGetLBFactory()
Get the load balancer factory object.
Stream outputter to send data to a file via some filter program.
This document is intended to provide useful advice for parties seeking to redistribute MediaWiki to end users It s targeted particularly at maintainers for Linux since it s been observed that distribution packages of MediaWiki often break We ve consistently had to recommend that users seeking support use official tarballs instead of their distribution s and this often solves whatever problem the user is having It would be nice if this could such as
dump( $history, $text=WikiExporter::TEXT)
This document is intended to provide useful advice for parties seeking to redistribute MediaWiki to end users It s targeted particularly at maintainers for Linux since it s been observed that distribution packages of MediaWiki often break We ve consistently had to recommend that users seeking support use official tarballs instead of their distribution s and this often solves whatever problem the user is having It would be nice if this could such and we might be restricted by PHP settings such as safe mode or open_basedir We cannot assume that the software even has read access anywhere useful Many shared hosts run all users web applications under the same so they can t rely on Unix and must forbid reads to even standard directories like tmp lest users read each others files We cannot assume that the user has the ability to install or run any programs not written as web accessible PHP scripts Since anything that works on cheap shared hosting will work if you have shell or root access MediaWiki s design is based around catering to the lowest common denominator Although we support higher end setups as the way many things work by default is tailored toward shared hosting These defaults are unconventional from the point of view of and they certainly aren t ideal for someone who s installing MediaWiki as MediaWiki does not conform to normal Unix filesystem layout Hopefully we ll offer direct support for standard layouts in the but for now *any change to the location of files is unsupported *Moving things and leaving symlinks will *probably *not break but it is *strongly *advised not to try any more intrusive changes to get MediaWiki to conform more closely to your filesystem hierarchy Any such attempt will almost certainly result in unnecessary bugs The standard recommended location to install relative to the web is it should be possible to enable the appropriate rewrite rules by if you can reconfigure the web server
if(isset( $options['quiet'])) if(isset( $options['pagelist'])) if(isset( $options['start'])) if(isset( $options['end'])) if(isset( $options['revstart'])) if(isset( $options['revend'])) $dumper skipHeader
registerFilter( $name, $class)