r69941 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r69940‎ | r69941 | r69942 >
Date:13:30, 26 July 2010
Author:reedy
Status:ok (Comments)
Tags:
Comment:
More wrong static method calls fixed
Modified paths:
  • /trunk/extensions/CategoryTree/CategoryTreeFunctions.php (modified) (history)
  • /trunk/extensions/CategoryTree/CategoryTreePage.php (modified) (history)
  • /trunk/extensions/CentralAuth/SpecialGlobalGroupMembership.php (modified) (history)
  • /trunk/extensions/CentralNotice/CentralNotice.db.php (modified) (history)
  • /trunk/extensions/CentralNotice/SpecialCentralNotice.php (modified) (history)
  • /trunk/extensions/Cite/SpecialCite_body.php (modified) (history)
  • /trunk/extensions/CodeReview/backend/CodeRepository.php (modified) (history)
  • /trunk/extensions/CodeReview/ui/CodeAuthorListView.php (modified) (history)
  • /trunk/extensions/CrossNamespaceLinks/CrossNamespaceLinks_body.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/FlaggedArticleView.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/forms/PageStabilityForm.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/specialpages/QualityOversight_body.php (modified) (history)
  • /trunk/extensions/Gadgets/SpecialGadgets.php (modified) (history)
  • /trunk/extensions/GlobalBlocking/SpecialGlobalBlock.php (modified) (history)
  • /trunk/extensions/GlobalBlocking/SpecialGlobalBlockStatus.php (modified) (history)
  • /trunk/extensions/GlobalBlocking/SpecialRemoveGlobalBlock.php (modified) (history)
  • /trunk/extensions/OAI/OAIRepo_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CodeReview/backend/CodeRepository.php
@@ -126,7 +126,32 @@
127127 $wgMemc->set( $key, $authors, 3600 * 24 );
128128 return $authors;
129129 }
 130+
 131+ public function getAuthorCount() {
 132+ global $wgMemc;
 133+ $key = wfMemcKey( 'codereview', 'authorcount', $this->getId() );
 134+ $authorsCount = $wgMemc->get( $key );
 135+ if ( is_int( $authorsCount ) ) {
 136+ return $authorsCount;
 137+ }
 138+ $dbr = wfGetDB( DB_SLAVE );
 139+ $row = $dbr->select(
 140+ 'code_authors',
 141+ array( 'COUNT(cr_author) AS author_count' ),
 142+ array( 'cr_repo_id' => $this->getId() ),
 143+ __METHOD__
 144+ );
130145
 146+ if ( !$row ) {
 147+ throw new MWException( 'Failed to load expected author count' );
 148+ }
 149+
 150+ $authorsCount = $row->author_count;
 151+
 152+ $wgMemc->set( $key, $authorsCount, 3600 * 24 );
 153+ return $authorsCount;
 154+ }
 155+
131156 public function getTagList() {
132157 global $wgMemc;
133158 $key = wfMemcKey( 'codereview', 'tags', $this->getId() );
@@ -167,8 +192,9 @@
168193 ),
169194 __METHOD__
170195 );
171 - if ( !$row )
 196+ if ( !$row ) {
172197 throw new MWException( 'Failed to load expected revision data' );
 198+ }
173199 return CodeRevision::newFromRow( $this, $row );
174200 }
175201
Index: trunk/extensions/CodeReview/ui/CodeAuthorListView.php
@@ -12,7 +12,7 @@
1313 $authors = $this->mRepo->getAuthorList();
1414 $repo = $this->mRepo->getName();
1515 $text = wfMsg( 'code-authors-text' ) . "\n\n";
16 - $text .= '<strong>' . wfMsg( 'code-author-total', $wgLang->formatNum( count( $authors ) ) ) . "</strong>\n";
 16+ $text .= '<strong>' . wfMsg( 'code-author-total', $wgLang->formatNum( $this->mRepo->getAuthorCount() ) ) . "</strong>\n";
1717 foreach ( $authors as $committer ) {
1818 if ( $committer ) {
1919 $text .= "* [[Special:Code/$repo/author/$committer|$committer]]";
Index: trunk/extensions/OAI/OAIRepo_body.php
@@ -17,7 +17,7 @@
1818
1919 class SpecialOAIRepository extends UnlistedSpecialPage {
2020 function __construct() {
21 - UnlistedSpecialPage::UnlistedSpecialPage( 'OAIRepository' );
 21+ parent::UnlistedSpecialPage( 'OAIRepository' );
2222 }
2323
2424 function setHeaders() {
Index: trunk/extensions/CentralNotice/SpecialCentralNotice.php
@@ -11,7 +11,7 @@
1212
1313 function CentralNotice() {
1414 // Register special page
15 - SpecialPage::SpecialPage( 'CentralNotice' );
 15+ parent::SpecialPage( 'CentralNotice' );
1616
1717 // Internationalization
1818 wfLoadExtensionMessages( 'CentralNotice' );
Index: trunk/extensions/CentralNotice/CentralNotice.db.php
@@ -11,7 +11,7 @@
1212
1313 function CentralNoticeDB() {
1414 // Register special page
15 - SpecialPage::SpecialPage( 'CentralNotice' );
 15+ parent::SpecialPage( 'CentralNotice' );
1616
1717 // Internationalization
1818 wfLoadExtensionMessages( 'CentralNotice' );
Index: trunk/extensions/GlobalBlocking/SpecialRemoveGlobalBlock.php
@@ -5,7 +5,7 @@
66
77 function __construct() {
88 wfLoadExtensionMessages('GlobalBlocking');
9 - SpecialPage::SpecialPage( 'RemoveGlobalBlock', 'globalunblock' );
 9+ parent::SpecialPage( 'RemoveGlobalBlock', 'globalunblock' );
1010 }
1111
1212 function execute( $par ) {
Index: trunk/extensions/GlobalBlocking/SpecialGlobalBlock.php
@@ -7,7 +7,7 @@
88
99 function __construct() {
1010 wfLoadExtensionMessages('GlobalBlocking');
11 - SpecialPage::SpecialPage( 'GlobalBlock', 'globalblock' );
 11+ parent::SpecialPage( 'GlobalBlock', 'globalblock' );
1212 }
1313
1414 function execute( $par ) {
Index: trunk/extensions/GlobalBlocking/SpecialGlobalBlockStatus.php
@@ -5,7 +5,7 @@
66
77 function __construct() {
88 wfLoadExtensionMessages('GlobalBlocking');
9 - SpecialPage::SpecialPage( 'GlobalBlockStatus', 'globalblock-whitelist' );
 9+ parent::SpecialPage( 'GlobalBlockStatus', 'globalblock-whitelist' );
1010 }
1111
1212 function execute( $par ) {
Index: trunk/extensions/Gadgets/SpecialGadgets.php
@@ -23,7 +23,7 @@
2424 * Constructor
2525 */
2626 function __construct() {
27 - SpecialPage::SpecialPage( 'Gadgets', '', true );
 27+ parent::SpecialPage( 'Gadgets', '', true );
2828 }
2929
3030 /**
Index: trunk/extensions/Cite/SpecialCite_body.php
@@ -10,7 +10,7 @@
1111
1212 class SpecialCite extends SpecialPage {
1313 function SpecialCite() {
14 - SpecialPage::SpecialPage( 'Cite' );
 14+ parent::SpecialPage( 'Cite' );
1515 }
1616
1717 function execute( $par ) {
Index: trunk/extensions/CategoryTree/CategoryTreePage.php
@@ -23,7 +23,7 @@
2424 * Constructor
2525 */
2626 function __construct() {
27 - SpecialPage::SpecialPage( 'CategoryTree', '', true );
 27+ parent::SpecialPage( 'CategoryTree', '', true );
2828 wfLoadExtensionMessages( 'CategoryTree' );
2929 }
3030
Index: trunk/extensions/CategoryTree/CategoryTreeFunctions.php
@@ -387,7 +387,7 @@
388388 }
389389 else {
390390 if ( !$hideroot ) {
391 - $html .= CategoryTree::renderNode( $title, $depth, $wgCategoryTreeDynamicTag );
 391+ $html .= $this->renderNode( $title, $depth, $wgCategoryTreeDynamicTag );
392392 } else if ( !$wgCategoryTreeDynamicTag ) {
393393 $html .= $this->renderChildren( $title, $depth );
394394 } else {
Index: trunk/extensions/CentralAuth/SpecialGlobalGroupMembership.php
@@ -9,7 +9,7 @@
1010 var $mGlobalUser;
1111
1212 function SpecialGlobalGroupMembership() {
13 - SpecialPage::SpecialPage( 'GlobalGroupMembership' );
 13+ parent::SpecialPage( 'GlobalGroupMembership' );
1414 wfLoadExtensionMessages( 'SpecialCentralAuth' );
1515
1616 global $wgUser;
Index: trunk/extensions/FlaggedRevs/forms/PageStabilityForm.php
@@ -502,7 +502,7 @@
503503 'FOR UPDATE'
504504 );
505505 # Check if this is not the same config as the existing row (if any)
506 - $changed = self::configIsDifferent( $oldRow,
 506+ $changed = $this->configIsDifferent( $oldRow,
507507 $this->select, $this->override, $this->autoreview, $dbExpiry );
508508 # If the new config is different, replace the old row...
509509 if ( $changed ) {
@@ -618,7 +618,7 @@
619619 'FOR UPDATE'
620620 );
621621 # Check if this is not the same config as the existing row (if any)
622 - $changed = self::configIsDifferent( $oldRow,
 622+ $changed = $this->configIsDifferent( $oldRow,
623623 $this->override, $this->autoreview, $dbExpiry );
624624 # If the new config is different, replace the old row...
625625 if ( $changed ) {
Index: trunk/extensions/FlaggedRevs/specialpages/QualityOversight_body.php
@@ -7,7 +7,7 @@
88 class QualityOversight extends SpecialPage
99 {
1010 public function __construct() {
11 - SpecialPage::SpecialPage( 'QualityOversight' );
 11+ parent::SpecialPage( 'QualityOversight' );
1212 }
1313
1414 public function execute( $par ) {
Index: trunk/extensions/FlaggedRevs/FlaggedArticleView.php
@@ -401,7 +401,7 @@
402402 $revsSince = $this->article->getPendingRevCount();
403403 $tooltip = wfMsgHtml( 'revreview-draft-title' );
404404 $pending = $prot;
405 - if ( self::showRatingIcon() ) {
 405+ if ( $this->showRatingIcon() ) {
406406 $pending .= FlaggedRevsXML::draftStatusIcon();
407407 }
408408 $pending .= wfMsgExt( 'revreview-edited',
Index: trunk/extensions/CrossNamespaceLinks/CrossNamespaceLinks_body.php
@@ -10,7 +10,7 @@
1111 * Constructor
1212 */
1313 function CrossNamespaceLinks() {
14 - SpecialPage::SpecialPage( 'CrossNamespaceLinks' );
 14+ parent::SpecialPage( 'CrossNamespaceLinks' );
1515 }
1616
1717 /**

Follow-up revisions

RevisionCommit summaryAuthorDate
r69954Partial revert of r69941 - Remove accidentally commited code to CodeReviewreedy18:30, 26 July 2010

Comments

#Comment by Nikerabbit (talk | contribs)   14:33, 26 July 2010

Could these be even parent::__construct()?

#Comment by Bryan (talk | contribs)   17:49, 26 July 2010

You have an unrelated change to CodeReview in.

#Comment by Reedy (talk | contribs)   18:21, 26 July 2010

Cheers Bryan, will revert. I thought I'd made a patch of this and reverted the changes locally. Seems not.

Status & tagging log