Added --shared-desc and --no-shared-desc options, for strict job ordering when slicing.
authorTim Starling <tstarling@users.mediawiki.org>
Wed, 15 Nov 2006 09:52:49 +0000 (09:52 +0000)
committerTim Starling <tstarling@users.mediawiki.org>
Wed, 15 Nov 2006 09:52:49 +0000 (09:52 +0000)
maintenance/dumpHTML.inc
maintenance/dumpHTML.php

index 8213fa9..52c8bcb 100644 (file)
@@ -38,6 +38,9 @@ class DumpHTML {
        # Make a copy of all images encountered
        var $makeSnapshot = false;
 
+       # Don't image description pages in doEverything()
+       var $noSharedDesc = false;
+
        # Make links assuming the script path is in the same directory as
        # the destination
        var $alternateScriptPath = false;
@@ -130,7 +133,10 @@ class DumpHTML {
                        $this->doSpecials();
                }
                $this->doLocalImageDescriptions();
-               $this->doSharedImageDescriptions();
+
+               if ( !$this->noSharedDesc ) {
+                       $this->doSharedImageDescriptions();
+               }
 
                $this->setCheckpoint( 'everything', 'done' );
        }
@@ -224,7 +230,9 @@ class DumpHTML {
 
        function doImageDescriptions() {
                $this->doLocalImageDescriptions();
-               $this->doSharedImageDescriptions();
+               if ( !$this->noSharedDesc ) {
+                       $this->doSharedImageDescriptions();
+               }
        }
 
        /**
index 5e347e4..12b6fc2 100644 (file)
@@ -17,6 +17,8 @@
  * --checkpoint <file>  use a checkpoint file to allow restarting of interrupted dumps
  * --slice <n/m>        split the job into m segments and do the n'th one
  * --images             only do image description pages
+ * --shared-desc        only do shared (commons) image description pages
+ * --no-shared-desc     don't do shared image description pages
  * --categories         only do category pages
  * --redirects          only do redirects
  * --special            only do miscellaneous stuff
@@ -93,6 +95,7 @@ $wgHTMLDump = new DumpHTML( array(
        'sliceDenominator' => $sliceDenominator,
        'noOverwrite' => $options['no-overwrite'],
        'compress' => $options['compress'],
+       'noSharedDesc' => $options['no-shared-desc'],
 ));
 
 
@@ -104,6 +107,8 @@ if ( $options['special'] ) {
        $wgHTMLDump->doCategories();
 } elseif ( $options['redirects'] ) {
        $wgHTMLDump->doRedirects();
+} elseif ( $options['shared-desc'] ) {
+       $wgHTMLDump->doSharedImageDescriptions();
 } else {
        print "Creating static HTML dump in directory $dest. \n";
        $dbr =& wfGetDB( DB_SLAVE );