Logging related to WikiExport cleanup and changes in T203424
authorBill Pirkle <bpirkle@wikimedia.org>
Thu, 20 Sep 2018 14:54:06 +0000 (09:54 -0500)
committerBill Pirkle <bpirkle@wikimedia.org>
Thu, 20 Sep 2018 14:54:06 +0000 (09:54 -0500)
T203424 (Replace the WikiExporter backup dump streaming mode with batched queries)
removed some outdated database usage techniques.  While making these
changes, we saw some potential cleanup opportunities related
to the $history parameter to WikiExporter.  Additional logging will
inform whether we can do the additional cleanup.  If so, it can be
performed under a separate task.

Bug: T203424
Change-Id: Ic4cef23520795665c89e03f325b891346d1340a9

includes/specials/SpecialExport.php

index be79cae..3a7e9cd 100644 (file)
@@ -24,6 +24,7 @@
  */
 
 use MediaWiki\MediaWikiServices;
+use MediaWiki\Logger\LoggerFactory;
 
 /**
  * A special page that allows users to export pages in a XML file
@@ -98,6 +99,15 @@ class SpecialExport extends SpecialPage {
                        $page = '';
                        $history = '';
                } elseif ( $request->wasPosted() && $par == '' ) {
+                       // Log to see if certain parameters are actually used.
+                       // If not, we could deprecate them and do some cleanup, here and in WikiExporter.
+                       LoggerFactory::getInstance( 'export' )->debug(
+                               'Special:Export POST, dir: [{dir}], offset: [{offset}], limit: [{limit}]', [
+                               'dir' => $request->getRawVal( 'dir' ),
+                               'offset' => $request->getRawVal( 'offset' ),
+                               'limit' => $request->getRawVal( 'limit' ),
+                       ] );
+
                        $page = $request->getText( 'pages' );
                        $this->curonly = $request->getCheck( 'curonly' );
                        $rawOffset = $request->getVal( 'offset' );