Drop "left in" debugging var_dump from WikiImporter
authorThiemo Mättig <thiemo.maettig@wikimedia.de>
Fri, 22 Aug 2014 14:11:30 +0000 (16:11 +0200)
committerThiemo Mättig <thiemo.maettig@wikimedia.de>
Fri, 22 Aug 2014 14:11:30 +0000 (16:11 +0200)
I found this on accident when searching for a var_dump I forgot
somewhere in my own code. We are maintaining production code here,
right? Debugging and testing should be somewhere else.

Also note the stray print before the var_dump.

Change-Id: I98725b277039f55db9ff95399e9559a477b43c26

includes/Import.php

index e6b5dc2..3880e25 100644 (file)
@@ -429,53 +429,12 @@ class WikiImporter {
                return '';
        }
 
-       # --------------
-
-       /** Left in for debugging */
-       private function dumpElement() {
-               static $lookup = null;
-               if ( !$lookup ) {
-                       $xmlReaderConstants = array(
-                               "NONE",
-                               "ELEMENT",
-                               "ATTRIBUTE",
-                               "TEXT",
-                               "CDATA",
-                               "ENTITY_REF",
-                               "ENTITY",
-                               "PI",
-                               "COMMENT",
-                               "DOC",
-                               "DOC_TYPE",
-                               "DOC_FRAGMENT",
-                               "NOTATION",
-                               "WHITESPACE",
-                               "SIGNIFICANT_WHITESPACE",
-                               "END_ELEMENT",
-                               "END_ENTITY",
-                               "XML_DECLARATION",
-                       );
-                       $lookup = array();
-
-                       foreach ( $xmlReaderConstants as $name ) {
-                               $lookup[constant( "XmlReader::$name" )] = $name;
-                       }
-               }
-
-               print var_dump(
-                       $lookup[$this->reader->nodeType],
-                       $this->reader->name,
-                       $this->reader->value
-               ) . "\n\n";
-       }
-
        /**
         * Primary entry point
         * @throws MWException
         * @return bool
         */
        public function doImport() {
-
                // Calls to reader->read need to be wrapped in calls to
                // libxml_disable_entity_loader() to avoid local file
                // inclusion attacks (bug 46932).