| Index: trunk/extensions/CodeReview/backend/CodeRepository.php |
| — | — | @@ -126,32 +126,7 @@ |
| 127 | 127 | $wgMemc->set( $key, $authors, 3600 * 24 ); |
| 128 | 128 | return $authors; |
| 129 | 129 | } |
| 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 | | - ); |
| 145 | 130 | |
| 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 | | - |
| 156 | 131 | public function getTagList() { |
| 157 | 132 | global $wgMemc; |
| 158 | 133 | $key = wfMemcKey( 'codereview', 'tags', $this->getId() ); |
| — | — | @@ -192,9 +167,8 @@ |
| 193 | 168 | ), |
| 194 | 169 | __METHOD__ |
| 195 | 170 | ); |
| 196 | | - if ( !$row ) { |
| | 171 | + if ( !$row ) |
| 197 | 172 | throw new MWException( 'Failed to load expected revision data' ); |
| 198 | | - } |
| 199 | 173 | return CodeRevision::newFromRow( $this, $row ); |
| 200 | 174 | } |
| 201 | 175 | |
| Index: trunk/extensions/CodeReview/ui/CodeAuthorListView.php |
| — | — | @@ -12,7 +12,7 @@ |
| 13 | 13 | $authors = $this->mRepo->getAuthorList(); |
| 14 | 14 | $repo = $this->mRepo->getName(); |
| 15 | 15 | $text = wfMsg( 'code-authors-text' ) . "\n\n"; |
| 16 | | - $text .= '<strong>' . wfMsg( 'code-author-total', $wgLang->formatNum( $this->mRepo->getAuthorCount() ) ) . "</strong>\n"; |
| | 16 | + $text .= '<strong>' . wfMsg( 'code-author-total', $wgLang->formatNum( count( $authors ) ) ) . "</strong>\n"; |
| 17 | 17 | foreach ( $authors as $committer ) { |
| 18 | 18 | if ( $committer ) { |
| 19 | 19 | $text .= "* [[Special:Code/$repo/author/$committer|$committer]]"; |