X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FdumpHTML.php;h=608893f700ed19e607de0b5d64e844901077f3ee;hb=430255078768b476d77cf16daf02ff64c33bf7bd;hp=7eaa058ddc86611513657cd3d659634fb4c46992;hpb=7bbe971aec2d548de981a12ed08a7b56a536dcdb;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/dumpHTML.php b/maintenance/dumpHTML.php index 7eaa058ddc..608893f700 100644 --- a/maintenance/dumpHTML.php +++ b/maintenance/dumpHTML.php @@ -9,19 +9,21 @@ * Usage: * php dumpHTML.php [options...] * - * -d destination directory - * -s start ID - * -e end ID - * --images only do image description pages - * --categories only do category pages - * --redirects only do redirects - * --special only do miscellaneous stuff - * --force-copy copy commons instead of symlink, needed for Wikimedia - * --interlang allow interlanguage links + * -d destination directory + * -s start ID + * -e end ID + * -k skin to use (defaults to htmldump) + * --images only do image description pages + * --categories only do category pages + * --redirects only do redirects + * --special only do miscellaneous stuff + * --force-copy copy commons instead of symlink, needed for Wikimedia + * --interlang allow interlanguage links + * --image-snapshot copy all images used to the destination directory */ -$optionsWithArgs = array( 's', 'd', 'e' ); +$optionsWithArgs = array( 's', 'd', 'e', 'k' ); $profiling = false; @@ -51,7 +53,7 @@ if ( !empty( $options['e'] ) ) { $end = $options['e']; } else { $dbr =& wfGetDB( DB_SLAVE ); - $end = $dbr->selectField( 'page', 'max(page_id)', false ); + $end = $dbr->selectField( 'page', 'max(page_id)', false ); } if ( !empty( $options['d'] ) ) { @@ -60,11 +62,15 @@ if ( !empty( $options['d'] ) ) { $dest = 'static'; } +$skin = isset( $options['k'] ) ? $options['k'] : 'htmldump'; + $wgHTMLDump = new DumpHTML( array( 'dest' => $dest, 'forceCopy' => $options['force-copy'], 'alternateScriptPath' => $options['interlang'], 'interwiki' => $options['interlang'], + 'skin' => $skin, + 'makeSnapshot' => $options['image-snapshot'], )); @@ -81,7 +87,8 @@ if ( $options['special'] ) { "Starting from page_id $start of $end.\n"); $dbr =& wfGetDB( DB_SLAVE ); - print "Using database {$dbr->mServer}\n"; + $server = $dbr->getProperty( 'mServer' ); + print "Using database {$server}\n"; $wgHTMLDump->doArticles( $start, $end ); if ( !isset( $options['e'] ) ) { @@ -89,7 +96,7 @@ if ( $options['special'] ) { $wgHTMLDump->doCategories(); $wgHTMLDump->doSpecials(); } - + /* if ( $end - $start > CHUNK_SIZE * 2 ) { // Split the problem into smaller chunks, run them in different PHP instances