Remove forced dereferencements (new() returns a reference in PHP5)
authorAntoine Musso <hashar@users.mediawiki.org>
Tue, 11 Jul 2006 14:11:23 +0000 (14:11 +0000)
committerAntoine Musso <hashar@users.mediawiki.org>
Tue, 11 Jul 2006 14:11:23 +0000 (14:11 +0000)
18 files changed:
RELEASE-NOTES
includes/DifferenceEngine.php
includes/ImagePage.php
includes/Skin.php
includes/SpecialLog.php
includes/SpecialUndelete.php
includes/SpecialUserlogin.php
includes/Title.php
includes/normal/CleanUpTest.php
includes/normal/RandomTest.php
maintenance/FiveUpgrade.inc
maintenance/backup.inc
maintenance/diffLanguage.php
maintenance/parserTests.inc
maintenance/parserTests.php
tests/DatabaseTest.php
tests/RunTests.php
tests/SearchMySQL4Test.php

index 7634b14..1a92f67 100644 (file)
@@ -49,6 +49,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
   {{REVISIONID}} when Cite extension is used
 * (bug 6622) Removed deprecated function image::newFromTitle
 * (bug 6627) Fix regression in Special:Ipblocklist with table prefix
+* Removed forced dereferencements (new() returns a reference in PHP5)
 
 
 == Languages updated ==
index 741b719..4871a54 100644 (file)
@@ -411,8 +411,8 @@ CONTROL;
                # Native PHP diff
                $ota = explode( "\n", $wgContLang->segmentForDiff( $otext ) );
                $nta = explode( "\n", $wgContLang->segmentForDiff( $ntext ) );
-               $diffs =& new Diff( $ota, $nta );
-               $formatter =& new TableDiffFormatter();
+               $diffs = new Diff( $ota, $nta );
+               $formatter = new TableDiffFormatter();
                return $wgContLang->unsegmentForDiff( $formatter->format( $diffs ) );
        }
                
index dac9602..8a865a9 100644 (file)
@@ -373,7 +373,7 @@ END
                $line = $this->img->nextHistoryLine();
 
                if ( $line ) {
-                       $list =& new ImageHistoryList( $sk );
+                       $list = new ImageHistoryList( $sk );
                        $s = $list->beginImageHistoryList() .
                                $list->imageHistoryLine( true, wfTimestamp(TS_MW, $line->img_timestamp),
                                        $this->mTitle->getDBkey(),  $line->img_user,
index 1631f1a..c0a75a6 100644 (file)
@@ -133,7 +133,7 @@ class Skin extends Linker {
                        $className = 'SkinStandard';
                        require_once( "{$wgStyleDirectory}/Standard.php" );
                }
-               $skin =& new $className;
+               $skin = new $className;
                return $skin;
        }
 
index a9e8573..e32d224 100644 (file)
  */
 function wfSpecialLog( $par = '' ) {
        global $wgRequest;
-       $logReader =& new LogReader( $wgRequest );
+       $logReader = new LogReader( $wgRequest );
        if( $wgRequest->getVal( 'type' ) == '' && $par != '' ) {
                $logReader->limitType( $par );
        }
-       $logViewer =& new LogViewer( $logReader );
+       $logViewer = new LogViewer( $logReader );
        $logViewer->show();
 }
 
index 695c8c2..e01e36d 100644 (file)
@@ -500,7 +500,7 @@ class UndeleteForm {
 
                if(!preg_match("/[0-9]{14}/",$timestamp)) return 0;
 
-               $archive =& new PageArchive( $this->mTargetObj );
+               $archive = new PageArchive( $this->mTargetObj );
                $text = $archive->getRevisionText( $timestamp );
 
                $wgOut->setPagetitle( wfMsg( "undeletepage" ) );
@@ -620,7 +620,7 @@ class UndeleteForm {
                # Show relevant lines from the deletion log:
                $wgOut->addHTML( "<h2>" . htmlspecialchars( LogPage::logName( 'delete' ) ) . "</h2>\n" );
                require_once( 'SpecialLog.php' );
-               $logViewer =& new LogViewer(
+               $logViewer = new LogViewer(
                        new LogReader(
                                new FauxRequest(
                                        array( 'page' => $this->mTargetObj->getPrefixedText(),
index 5f72ee9..c66947c 100644 (file)
@@ -522,12 +522,12 @@ class LoginForm {
                require_once( 'templates/Userlogin.php' );
 
                if ( $this->mType == 'signup' ) {
-                       $template =& new UsercreateTemplate();
+                       $template = new UsercreateTemplate();
                        $q = 'action=submitlogin&type=signup';
                        $linkq = 'type=login';
                        $linkmsg = 'gotaccount';
                } else {
-                       $template =& new UserloginTemplate();
+                       $template = new UserloginTemplate();
                        $q = 'action=submitlogin&type=login';
                        $linkq = 'type=signup';
                        $linkmsg = 'nologin';
index 2ac2e64..8cb51de 100644 (file)
@@ -132,7 +132,7 @@ class Title {
                 */
                $filteredText = Sanitizer::decodeCharReferences( $text );
 
-               $t =& new Title();
+               $t = new Title();
                $t->mDbkeyform = str_replace( ' ', '_', $filteredText );
                $t->mDefaultNamespace = $defaultNamespace;
 
@@ -234,7 +234,7 @@ class Title {
         * @access public
         */
        public static function &makeTitle( $ns, $title ) {
-               $t =& new Title();
+               $t = new Title();
                $t->mInterwiki = '';
                $t->mFragment = '';
                $t->mNamespace = intval( $ns );
index 4e147cf..30ec6a9 100644 (file)
@@ -412,7 +412,7 @@ class CleanUpTest extends PHPUnit_TestCase {
 }
 
 
-$suite =& new PHPUnit_TestSuite( 'CleanUpTest' );
+$suite = new PHPUnit_TestSuite( 'CleanUpTest' );
 $result = PHPUnit::run( $suite );
 echo $result->toString();
 
index 3a5a407..e260136 100644 (file)
@@ -65,8 +65,8 @@ function showDiffs( $a, $b ) {
        $ota = explode( "\n", str_replace( "\r\n", "\n", $a ) );
        $nta = explode( "\n", str_replace( "\r\n", "\n", $b ) );
 
-       $diffs =& new Diff( $ota, $nta );
-       $formatter =& new TableDiffFormatter();
+       $diffs = new Diff( $ota, $nta );
+       $formatter = new TableDiffFormatter();
        $funky = $formatter->format( $diffs );
        preg_match_all( '/<span class="diffchange">(.*?)<\/span>/', $funky, $matches );
        foreach( $matches[1] as $bit ) {
@@ -104,4 +104,4 @@ while( true ) {
        $norm = '';
 }
 
-?>
\ No newline at end of file
+?>
index 7caf681..f56e62b 100644 (file)
@@ -64,7 +64,7 @@ class FiveUpgrade {
        function &newConnection() {
                global $wgDBadminuser, $wgDBadminpassword;
                global $wgDBserver, $wgDBname;
-               $db =& new Database( $wgDBserver, $wgDBadminuser, $wgDBadminpassword, $wgDBname );
+               $db = new Database( $wgDBserver, $wgDBadminuser, $wgDBadminpassword, $wgDBname );
                return $db;
        }
 
index d3603bd..12dab66 100644 (file)
@@ -221,7 +221,7 @@ class BackupDumper {
                global $wgDBadminuser, $wgDBadminpassword;
                global $wgDBname, $wgDebugDumpSql;
                $flags = ($wgDebugDumpSql ? DBO_DEBUG : 0) | DBO_DEFAULT; // god-damn hack
-               $db =& new Database( $this->backupServer(), $wgDBadminuser, $wgDBadminpassword, $wgDBname, false, $flags );
+               $db = new Database( $this->backupServer(), $wgDBadminuser, $wgDBadminpassword, $wgDBname, false, $flags );
                $timeout = 3600 * 24;
                $db->query( "SET net_read_timeout=$timeout" );
                $db->query( "SET net_write_timeout=$timeout" );
index eb87b3b..92af31e 100644 (file)
@@ -128,7 +128,7 @@ if ( isset($args[0]) ) {
 }
 
 /** parsertest is used to do differences */
-$myParserTest =& new ParserTest();
+$myParserTest = new ParserTest();
 
 # Get all references messages and check if they exist in the tested language
 $i = 0;
index 30cba31..c27f010 100644 (file)
@@ -238,7 +238,7 @@ class ParserTest {
 
                $this->setupGlobals($opts);
 
-               $user =& new User();
+               $user = new User();
                $options = ParserOptions::newFromUser( $user );
 
                if (preg_match('/\\bmath\\b/i', $opts)) {
@@ -255,7 +255,7 @@ class ParserTest {
 
                $noxml = (bool)preg_match( '~\\b noxml \\b~x', $opts );
 
-               $parser =& new Parser();
+               $parser = new Parser();
                foreach( $this->hooks as $tag => $callback ) {
                        $parser->setHook( $tag, $callback );
                }
index eac7adb..309bf2e 100644 (file)
@@ -49,7 +49,7 @@ END;
 # refer to $wgTitle directly, but instead use the title
 # passed to it.
 $wgTitle = Title::newFromText( 'Parser test script do not use' );
-$tester =& new ParserTest();
+$tester = new ParserTest();
 
 if( isset( $options['file'] ) ) {
        $file = $options['file'];
index a721c98..edb785d 100644 (file)
@@ -13,7 +13,7 @@ class DatabaseTest extends PHPUnit_TestCase {
        }
 
        function setUp() {
-               $this->db =& new Database();
+               $this->db = new Database();
        }
 
        function tearDown() {
@@ -90,4 +90,4 @@ class DatabaseTest extends PHPUnit_TestCase {
 
 }
 
-?>
\ No newline at end of file
+?>
index ec04fc0..2b539a4 100644 (file)
@@ -57,7 +57,7 @@ foreach( $tests as $test ) {
 function &buildTestDatabase( $serverType, $tables ) {
        global $testOptions, $wgDBprefix;
        $wgDBprefix = 'parsertest';
-       $db =& new Database(
+       $db = new Database(
                $testOptions[$serverType]['server'],
                $testOptions[$serverType]['user'],
                $testOptions[$serverType]['password'],
index 545af23..a18e22c 100644 (file)
@@ -18,7 +18,7 @@ class SearchMySQL4Test extends SearchEngine_TestCase {
                if( $this->db ) {
                        $this->insertSearchData();
                }
-               $this->search =& new SearchMySQL4( $this->db );
+               $this->search = new SearchMySQL4( $this->db );
        }
 
        function tearDown() {
@@ -31,4 +31,4 @@ class SearchMySQL4Test extends SearchEngine_TestCase {
 
 }
 
-?>
\ No newline at end of file
+?>