Last modified: 2011-07-26 21:34:15 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T30583, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 28583 - Remove all /* private */ declarations in MediaWiki core
Remove all /* private */ declarations in MediaWiki core
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Documentation (Other open bugs)
1.18.x
All All
: Low minor (vote)
: ---
Assigned To: Yuvi Panda
: patch, patch-need-review
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-04-17 15:31 UTC by Yuvi Panda
Modified: 2011-07-26 21:34 UTC (History)
5 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments
ImagePage.php, SearchUpdate.php and LinkCache.php cleanup (1.62 KB, patch)
2011-04-17 15:36 UTC, Yuvi Panda
Details
Extension DeleteBatch cleanup (656 bytes, patch)
2011-04-17 15:40 UTC, Yuvi Panda
Details
ImagePage.php, SearchUpdate.php and LinkCache.php cleanup (1.58 KB, patch)
2011-04-17 19:14 UTC, Yuvi Panda
Details
ImagePage.php, SearchUpdate.php, LinkCache.php and (partial) Title.php cleanup (1.98 KB, patch)
2011-04-17 22:05 UTC, Yuvi Panda
Details
Extension DeleteBatch cleanup (2.29 KB, patch)
2011-04-17 22:05 UTC, Yuvi Panda
Details
Fix for LoadBalancer.php (1.84 KB, patch)
2011-04-18 21:34 UTC, Yuvi Panda
Details
Fixes access to private members of LoadBalancer in Extensions. (1.38 KB, patch)
2011-04-18 21:35 UTC, Yuvi Panda
Details
Fixes for constructor of Title (2.88 KB, patch)
2011-04-18 22:51 UTC, Yuvi Panda
Details
Extension Fixes for making Title's constructor Private (4.86 KB, patch)
2011-04-18 22:54 UTC, Yuvi Panda
Details
Fix for LoadBalancer.php (1.84 KB, patch)
2011-04-18 23:02 UTC, Yuvi Panda
Details

Description Yuvi Panda 2011-04-17 15:31:27 UTC
Remove the /* private */ declarations in Mediawiki core, replacing it with 'private' wherever necessary. If any extensions in trunk/extensions are accessing the methods/variables marked private, fix them as necessary.
Comment 1 Yuvi Panda 2011-04-17 15:36:22 UTC
Created attachment 8411 [details]
ImagePage.php, SearchUpdate.php and LinkCache.php cleanup
Comment 2 Yuvi Panda 2011-04-17 15:40:12 UTC
Created attachment 8412 [details]
Extension DeleteBatch cleanup

Depended on private $img of ImagePage.
Comment 4 Yuvi Panda 2011-04-17 19:14:48 UTC
Created attachment 8413 [details]
ImagePage.php, SearchUpdate.php and LinkCache.php cleanup

Fixed misunderstanding of var keyword.
Comment 5 Yuvi Panda 2011-04-17 22:05:07 UTC
Created attachment 8414 [details]
ImagePage.php, SearchUpdate.php, LinkCache.php and (partial) Title.php cleanup
Comment 6 Yuvi Panda 2011-04-17 22:05:54 UTC
Created attachment 8415 [details]
Extension DeleteBatch cleanup
Comment 7 Happy-melon 2011-04-17 23:17:35 UTC
(In reply to comment #6)
> Created attachment 8415 [details]
> Extension DeleteBatch cleanup

The change in DeleteBatch seems to substantially change the codeflow, going to File::delete() directly instead of through FileDeleteForm.  Since ImagePage::delete() calls ImagePage::loadFile(), invalidating the removed comment, is it necessary to manually delete the file separately from the ImagePage?
Comment 8 Happy-melon 2011-04-17 23:19:39 UTC
(In reply to comment #6)
> Created attachment 8415 [details]
> Extension DeleteBatch cleanup

The other two changes in this look good. I wouldn't have been able to resist the temptation to do more major refactoring in DPL, but I guess you have more restraint than me :D
Comment 9 Yuvi Panda 2011-04-18 09:34:53 UTC
I just followed what maintenance/deleteBatch.php did (http://svn.wikimedia.org/viewvc/mediawiki/trunk/phase3/maintenance/deleteBatch.php?view=markup#l88). Extension:DeleteBatch specified that it was just an extension form of the maintenance script.

And laziness can sometimes be mistaken for restraint :D
Comment 10 Happy-melon 2011-04-18 19:04:10 UTC
Patches 8415 and 8413 applied in r86335.  How many more of these are there?
Comment 11 Yuvi Panda 2011-04-18 19:25:54 UTC
The ones remaining are for the various database doQuery methods (which I'm sane enough not to touch), LoadBalancer.php (which I'm investigating now) and the constructor for Title (which is weirding me out, needs more investigation).
Comment 12 Yuvi Panda 2011-04-18 21:34:22 UTC
Created attachment 8423 [details]
Fix for LoadBalancer.php

Added new setter method.
Comment 13 Yuvi Panda 2011-04-18 21:35:56 UTC
Created attachment 8424 [details]
Fixes access to private members of LoadBalancer in Extensions.
Comment 14 Yuvi Panda 2011-04-18 22:51:58 UTC
Created attachment 8425 [details]
Fixes for constructor of Title
Comment 15 Yuvi Panda 2011-04-18 22:54:36 UTC
Created attachment 8426 [details]
Extension Fixes for making Title's constructor Private

Removed line 90 in Wikilog/WikilogCommentsPage.php since it is noted in comments that setPermalinkTitle is 'optional'.
Comment 16 Yuvi Panda 2011-04-18 23:02:39 UTC
Created attachment 8427 [details]
Fix for LoadBalancer.php

Typo :D
Comment 17 Sam Reed (reedy) 2011-04-18 23:05:33 UTC
Comment on attachment 8423 [details]
Fix for LoadBalancer.php

>Index: maintenance/eval.php
>===================================================================
>--- maintenance/eval.php	(revision 86345)
>+++ maintenance/eval.php	(working copy)
>@@ -45,8 +45,11 @@
> 	}
> 	if ( $d > 1 ) {
> 		$lb = wfGetLB();
>-		foreach ( $lb->mServers as $i => $server ) {
>-			$lb->mServers[$i]['flags'] |= DBO_DEBUG;
>+		$serverCount = $lb->getServerCount(); 
>+		for ( $i = 0; $i < $serverCount; $i++ ) {
>+			$server = $lb->getServerInfo( $i );
>+			$server['flags'] |= DBO_DEBUG;
>+			$lb->setServerInfo( $i, $server );
> 		}
> 	}
> 	if ( $d > 2 ) {
>Index: includes/db/LoadBalancer.php
>===================================================================
>--- includes/db/LoadBalancer.php	(revision 86345)
>+++ includes/db/LoadBalancer.php	(working copy)
>@@ -13,13 +13,13 @@
>  * @ingroup Database
>  */
> class LoadBalancer {
>-	/* private */ var $mServers, $mConns, $mLoads, $mGroupLoads;
>-	/* private */ var $mErrorConnection;
>-	/* private */ var $mReadIndex, $mAllowLagged;
>-	/* private */ var $mWaitForPos, $mWaitTimeout;
>-	/* private */ var $mLaggedSlaveMode, $mLastError = 'Unknown error';
>-	/* private */ var $mParentInfo, $mLagTimes;
>-	/* private */ var $mLoadMonitorClass, $mLoadMonitor;
>+	private $mServers, $mConns, $mLoads, $mGroupLoads;
>+	private $mErrorConnection;
>+	private $mReadIndex, $mAllowLagged;
>+	private $mWaitForPos, $mWaitTimeout;
>+	private $mLaggedSlaveMode, $mLastError = 'Unknown error';
>+	private $mParentInfo, $mLagTimes;
>+	private $mLoadMonitorClass, $mLoadMonitor;
> 
> 	/**
> 	 * @param $params Array with keys:
>@@ -740,6 +740,13 @@
> 	}
> 
> 	/**
>+	 * Sets the server info structure for the given index. Entry at index $i is created if it doesn't exist
>+	 */
>+	function getServerInfo( $i, $serverInfo ) {
>+		$this->mServers[i] = $serverInfo;
>+	}
>+
>+	/**
> 	 * Get the current master position for chronology control purposes
> 	 * @return mixed
> 	 */
Comment 18 Sam Reed (reedy) 2011-04-18 23:21:12 UTC
LoadBalancer - r86363
Extension Title - r86365
phase3 Title - r86367
Comment 19 Antoine "hashar" Musso (WMF) 2011-07-26 21:32:50 UTC
SpecialPage::mName made explicitly private with r93249
Extensions corrected with r93250
Comment 20 Antoine "hashar" Musso (WMF) 2011-07-26 21:34:15 UTC
Using:
ack '\/\*\s*private'
I have only found one occurrence of /* private */ in languages/Names.php and it is there for a good reason.

Marking bug as FIXED.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links