r86335 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r86334‎ | r86335 | r86336 >
Date:19:03, 18 April 2011
Author:happy-melon
Status:ok (Comments)
Tags:
Comment:
(bug 28583) chase down and beat to death external calls of functions marked /*private*/, and make those declarations actually binding. Patch by yuvipanda.
Modified paths:
  • /trunk/extensions/DeleteBatch/DeleteBatch.body.php (modified) (history)
  • /trunk/extensions/DynamicPageList/DPLMain.php (modified) (history)
  • /trunk/extensions/ReplaceText/SpecialReplaceText.php (modified) (history)
  • /trunk/phase3/includes/ImagePage.php (modified) (history)
  • /trunk/phase3/includes/LinkCache.php (modified) (history)
  • /trunk/phase3/includes/Title.php (modified) (history)
  • /trunk/phase3/includes/search/SearchUpdate.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/search/SearchUpdate.php
@@ -15,8 +15,8 @@
1616 */
1717 class SearchUpdate {
1818
19 - /* private */ var $mId = 0, $mNamespace, $mTitle, $mText;
20 - /* private */ var $mTitleWords;
 19+ private $mId = 0, $mNamespace, $mTitle, $mText;
 20+ private $mTitleWords;
2121
2222 function __construct( $id, $title, $text = false ) {
2323 $nt = Title::newFromText( $title );
Index: trunk/phase3/includes/ImagePage.php
@@ -10,13 +10,10 @@
1111 /**
1212 * @var File
1313 */
14 - /* private */ var $img;
15 - /**
16 - * @var File
17 - */
18 - /* private */ var $displayImg;
19 - /* private */ var $repo;
20 - /* private */ var $fileLoaded;
 14+ private $img;
 15+ private $displayImg;
 16+ private $repo;
 17+ private $fileLoaded;
2118
2219 var $mExtraDescription = false;
2320 var $dupes;
Index: trunk/phase3/includes/Title.php
@@ -2498,7 +2498,7 @@
24992499 * @return String the prefixed text
25002500 * @private
25012501 */
2502 - /* private */ function prefix( $name ) {
 2502+ private function prefix( $name ) {
25032503 $p = '';
25042504 if ( $this->mInterwiki != '' ) {
25052505 $p = $this->mInterwiki . ':';
Index: trunk/phase3/includes/LinkCache.php
@@ -7,10 +7,10 @@
88 class LinkCache {
99 // Increment $mClassVer whenever old serialized versions of this class
1010 // becomes incompatible with the new version.
11 - /* private */ var $mClassVer = 4;
 11+ private $mClassVer = 4;
1212
13 - /* private */ var $mGoodLinks, $mBadLinks;
14 - /* private */ var $mForUpdate;
 13+ private $mGoodLinks, $mBadLinks;
 14+ private $mForUpdate;
1515
1616 /**
1717 * Get an instance of this class
Index: trunk/extensions/DeleteBatch/DeleteBatch.body.php
@@ -310,9 +310,6 @@
311311 /* this stuff goes like articleFromTitle in Wiki.php */
312312 if ( $page->getNamespace() == NS_FILE ) {
313313 $art = new ImagePage( $page );
314 - /*this is absolutely required - creating a new ImagePage object does not automatically
315 - provide it with image */
316 - $art->img = wfFindFile( $art->mTitle );
317314 } else {
318315 $art = new Article( $page );
319316 }
Index: trunk/extensions/ReplaceText/SpecialReplaceText.php
@@ -397,7 +397,7 @@
398398 foreach ( $titles_for_move as $title ) {
399399 $wgOut->addHTML(
400400 Xml::check( 'move-' . $title->getArticleID(), true ) .
401 - $skin->makeLinkObj( $title, $title->prefix( $title->getText() ) ) . "<br />\n"
 401+ $skin->makeLinkObj( $title, $title->getPrefixedText() ) . "<br />\n"
402402 );
403403 }
404404 $wgOut->addHTML( '<br />' );
Index: trunk/extensions/DynamicPageList/DPLMain.php
@@ -2984,6 +2984,9 @@
29852985 $dplArticle = new DPLArticle( $title, $pageNamespace );
29862986 // Page link
29872987 $sTitleText = $title->getText();
 2988+ if ( $bShowNamespace ) {
 2989+ $sTitleText = $title->getPrefixedText();
 2990+ }
29882991 if ( $aReplaceInTitle[0] != '' ) {
29892992 $sTitleText = preg_replace( $aReplaceInTitle[0], $aReplaceInTitle[1], $sTitleText );
29902993 }
@@ -2992,9 +2995,6 @@
29932996 if ( isset( $iTitleMaxLen ) && ( strlen( $sTitleText ) > $iTitleMaxLen ) ) {
29942997 $sTitleText = substr( $sTitleText, 0, $iTitleMaxLen ) . '...';
29952998 }
2996 - if ( $bShowNamespace ) {
2997 - $sTitleText = str_replace( '_', ' ', $title->prefix( $sTitleText ) );
2998 - }
29992999 if ( $bShowCurID && isset( $row->page_id ) ) {
30003000 $articleLink = '<html>' . $sk->makeKnownLinkObj( $title, htmlspecialchars( $sTitleText ), 'curid=' . $row->page_id ) . '</html>';
30013001 } elseif ( !$bEscapeLinks && ( $pageNamespace == 14 || $pageNamespace == 6 ) ) {

Follow-up revisions

RevisionCommit summaryAuthorDate
r86363Apply LoadBalancer related fixes...reedy23:12, 18 April 2011
r86365Apply Extension related new constructor fixes...reedy23:17, 18 April 2011
r86367Apply phase3 related Title fixes. With one minor addition, Title constructor ...reedy23:20, 18 April 2011

Comments

#Comment by Aaron Schulz (talk | contribs)   18:20, 21 June 2011

$sTitleText = substr( $sTitleText, 0, $iTitleMaxLen ) . '...'; doesn't work the same as it used to (now on the title with the prefix).

#Comment by Happy-melon (talk | contribs)   14:00, 27 June 2011

I'd say that's a good thing; the actual maximum length of the text of a title shouldn't depend on whether the namespace happens to have an unusually long name.

#Comment by MarkAHershberger (talk | contribs)   14:10, 16 August 2011

Removing FIXME after discussing with Chad.

Status & tagging log