Fix a bunch of call-time pass-by-reference errors
authorMax Semenik <maxsem.wiki@gmail.com>
Wed, 10 Feb 2016 22:11:30 +0000 (14:11 -0800)
committerMax Semenik <maxsem.wiki@gmail.com>
Wed, 10 Feb 2016 22:12:58 +0000 (14:12 -0800)
Change-Id: I3bd8e7c4d2dca465957a353cb7dc2a906699ff6a

maintenance/backup.inc
maintenance/cleanupTitles.php
maintenance/dumpIterator.php
maintenance/dumpTextPass.php
maintenance/importDump.php
maintenance/renderDump.php
maintenance/storage/checkStorage.php

index 9af9604..1306ae6 100644 (file)
@@ -138,7 +138,7 @@ class BackupDumper extends Maintenance {
                        require_once $file;
                }
                $register = array( $class, 'register' );
-               call_user_func_array( $register, array( &$this ) );
+               call_user_func_array( $register, array( $this ) );
        }
 
        function execute() {
index 574d5bd..1277e83 100644 (file)
@@ -90,7 +90,7 @@ class TitleCleanup extends TableCleanup {
        protected function moveIllegalPage( $row ) {
                $legal = 'A-Za-z0-9_/\\\\-';
                $legalized = preg_replace_callback( "!([^$legal])!",
-                       array( &$this, 'hexChar' ),
+                       array( $this, 'hexChar' ),
                        $row->page_title );
                if ( $legalized == '.' ) {
                        $legalized = '(dot)';
index eef535a..0f39513 100644 (file)
@@ -76,7 +76,7 @@ abstract class DumpIterator extends Maintenance {
                $importer = new WikiImporter( $source, $this->getConfig() );
 
                $importer->setRevisionCallback(
-                       array( &$this, 'handleRevision' ) );
+                       array( $this, 'handleRevision' ) );
 
                $this->from = $this->getOption( 'from', null );
                $this->count = 0;
index 8169ef5..12ccd0e 100644 (file)
@@ -426,10 +426,10 @@ TEXT
 
                xml_set_element_handler(
                        $parser,
-                       array( &$this, 'startElement' ),
-                       array( &$this, 'endElement' )
+                       array( $this, 'startElement' ),
+                       array( $this, 'endElement' )
                );
-               xml_set_character_data_handler( $parser, array( &$this, 'characterData' ) );
+               xml_set_character_data_handler( $parser, array( $this, 'characterData' ) );
 
                $offset = 0; // for context extraction on error reporting
                do {
index 7c452a6..3bf8b27 100644 (file)
@@ -297,13 +297,13 @@ TEXT
                                return false;
                        }
                }
-               $importer->setPageCallback( array( &$this, 'reportPage' ) );
+               $importer->setPageCallback( array( $this, 'reportPage' ) );
                $this->importCallback = $importer->setRevisionCallback(
-                       array( &$this, 'handleRevision' ) );
+                       array( $this, 'handleRevision' ) );
                $this->uploadCallback = $importer->setUploadCallback(
-                       array( &$this, 'handleUpload' ) );
+                       array( $this, 'handleUpload' ) );
                $this->logItemCallback = $importer->setLogItemCallback(
-                       array( &$this, 'handleLogItem' ) );
+                       array( $this, 'handleLogItem' ) );
                if ( $this->uploads ) {
                        $importer->setImportUploads( true );
                }
index 09b1b1c..33d6e50 100644 (file)
@@ -65,7 +65,7 @@ class DumpRenderer extends Maintenance {
                $importer = new WikiImporter( $source, $this->getConfig() );
 
                $importer->setRevisionCallback(
-                       array( &$this, 'handleRevision' ) );
+                       array( $this, 'handleRevision' ) );
 
                $importer->doImport();
 
index c0f6c7b..95e3ca7 100644 (file)
@@ -471,7 +471,7 @@ class CheckStorage {
                        $source,
                        ConfigFactory::getDefaultInstance()->makeConfig( 'main' )
                );
-               $importer->setRevisionCallback( array( &$this, 'importRevision' ) );
+               $importer->setRevisionCallback( array( $this, 'importRevision' ) );
                $importer->doImport();
        }