* Usage:
* php dumpHTML.php [options...]
*
- * -d <dest> destination directory
- * -s <start> start ID
- * -e <end> 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 <dest> destination directory
+ * -s <start> start ID
+ * -e <end> end ID
+ * -k <skin> 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;
$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'] ) ) {
$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'],
));
"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'] ) ) {
$wgHTMLDump->doCategories();
$wgHTMLDump->doSpecials();
}
-
+
/*
if ( $end - $start > CHUNK_SIZE * 2 ) {
// Split the problem into smaller chunks, run them in different PHP instances