X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FdumpHTML.php;h=bd94958eb6ad0a77b21cccc04d18ad250117f144;hb=1b4d4f82a78ee43eaf1787385abc5b45b6679d98;hp=f8d7b3b61cca74d65ec57de81a25715914cf5f24;hpb=3c4585c1f373762544f0200f688129cf490ec073;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/dumpHTML.php b/maintenance/dumpHTML.php index f8d7b3b61c..bd94958eb6 100644 --- a/maintenance/dumpHTML.php +++ b/maintenance/dumpHTML.php @@ -1,126 +1,7 @@ - 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 - */ +WebDAV/SVN: +http://svn.wikimedia.org/svnroot/mediawiki/trunk/extensions/DumpHTML/ - -$optionsWithArgs = array( 's', 'd', 'e' ); - -$profiling = false; - -if ( $profiling ) { - define( 'MW_CMDLINE_CALLBACK', 'wfSetupDump' ); - function wfSetupDump() { - global $wgProfiling, $wgProfileToDatabase, $wgProfileSampleRate; - $wgProfiling = true; - $wgProfileToDatabase = false; - $wgProfileSampleRate = 1; - } -} - -require_once( "commandLine.inc" ); -require_once( "dumpHTML.inc" ); - -error_reporting( E_ALL & (~E_NOTICE) ); -define( 'CHUNK_SIZE', 50 ); - -if ( !empty( $options['s'] ) ) { - $start = $options['s']; -} else { - $start = 1; -} - -if ( !empty( $options['e'] ) ) { - $end = $options['e']; -} else { - $dbr =& wfGetDB( DB_SLAVE ); - $end = $dbr->selectField( 'page', 'max(page_id)', false ); -} - -if ( !empty( $options['d'] ) ) { - $dest = $options['d']; -} else { - $dest = 'static'; -} - -$d = new DumpHTML( array( - 'dest' => $dest, - 'forceCopy' => $options['force-copy'], - 'alternateScriptPath' => $options['interlang'], - 'interwiki' => $options['interlang'], -)); - - -if ( $options['special'] ) { - $d->doSpecials(); -} elseif ( $options['images'] ) { - $d->doImageDescriptions(); -} elseif ( $options['categories'] ) { - $d->doCategories(); -} elseif ( $options['redirects'] ) { - $d->doRedirects(); -} else { - print("Creating static HTML dump in directory $dest. \n". - "Starting from page_id $start of $end.\n"); - - $dbr =& wfGetDB( DB_SLAVE ); - print "Using database {$dbr->mServer}\n"; - - $d->doArticles( $start, $end ); - if ( !isset( $options['e'] ) ) { - $d->doImageDescriptions(); - $d->doCategories(); - $d->doSpecials(); - } - - /* - if ( $end - $start > CHUNK_SIZE * 2 ) { - // Split the problem into smaller chunks, run them in different PHP instances - // This is a memory/resource leak workaround - print("Creating static HTML dump in directory $dest. \n". - "Starting from page_id $start of $end.\n"); - - chdir( "maintenance" ); - for ( $chunkStart = $start; $chunkStart < $end; $chunkStart += CHUNK_SIZE ) { - $chunkEnd = $chunkStart + CHUNK_SIZE - 1; - if ( $chunkEnd > $end ) { - $chunkEnd = $end; - } - passthru( "php dumpHTML.php -d " . wfEscapeShellArg( $dest ) . " -s $chunkStart -e $chunkEnd" ); - } - chdir( ".." ); - $d->doImageDescriptions(); - $d->doCategories(); - $d->doMainPage( $dest ); - } else { - $d->doArticles( $start, $end ); - } - */ -} - -if ( isset( $options['debug'] ) ) { - print_r($GLOBALS); -} - -if ( $profiling ) { - echo $wgProfiler->getOutput(); -} - -?> +Web: +http://svn.wikimedia.org/viewvc/mediawiki/trunk/extensions/DumpHTML/