r43465 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r43464‎ | r43465 | r43466 >
Date:23:18, 13 November 2008
Author:aaron
Status:old
Tags:
Comment:
Forgot to commit propchange class
Modified paths:
  • /trunk/extensions/CodeReview/CodePropChange.php (added) (history)
  • /trunk/extensions/CodeReview/CodeReview.php (modified) (history)
  • /trunk/extensions/CodeReview/CodeRevision.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CodeReview/CodeRevision.php
@@ -324,20 +324,22 @@
325325
326326 public function getPropChanges() {
327327 $dbr = wfGetDB( DB_SLAVE );
328 - $result = $dbr->select( 'code_prop_changes',
 328+ $result = $dbr->select( array('code_prop_changes','user'),
329329 array(
330330 'cpc_attrib',
331331 'cpc_removed',
332332 'cpc_added',
333333 'cpc_timestamp',
334334 'cpc_user',
335 - 'cpc_user_text'
 335+ 'cpc_user_text',
 336+ 'user_name'
336337 ), array(
337338 'cpc_repo_id' => $this->mRepoId,
338 - 'cpc_rev_id' => $this->mId ),
 339+ 'cpc_rev_id' => $this->mId,
 340+ ),
339341 __METHOD__,
340 - array(
341 - 'ORDER BY' => 'cpc_timestamp DESC' )
 342+ array( 'ORDER BY' => 'cpc_timestamp DESC' ),
 343+ array( 'user' => array('LEFT JOIN','cpc_user = user_id') )
342344 );
343345 $changes = array();
344346 foreach( $result as $row ) {
Index: trunk/extensions/CodeReview/CodeReview.php
@@ -58,6 +58,7 @@
5959 $wgAutoloadClasses['CodeTagListView'] = $dir . 'CodeTagListView.php';
6060 $wgAutoloadClasses['CodeCommentsListView'] = $dir . 'CodeCommentsListView.php';
6161 $wgAutoloadClasses['CodeComment'] = $dir . 'CodeComment.php';
 62+$wgAutoloadClasses['CodePropChange'] = $dir . 'CodePropChange.php';
6263 $wgAutoloadClasses['SpecialCode'] = $dir . 'SpecialCode.php';
6364 $wgAutoloadClasses['CodeView'] = $dir . 'SpecialCode.php';
6465 $wgAutoloadClasses['SpecialRepoAdmin'] = $dir . 'SpecialRepoAdmin.php';
Index: trunk/extensions/CodeReview/CodePropChange.php
@@ -0,0 +1,24 @@
 2+<?php
 3+if (!defined('MEDIAWIKI')) die();
 4+
 5+class CodePropChange {
 6+ function __construct( $rev ) {
 7+ $this->rev = $rev;
 8+ }
 9+
 10+ static function newFromRow( $rev, $row ) {
 11+ return self::newFromData( $rev, get_object_vars( $row ) );
 12+ }
 13+
 14+ static function newFromData( $rev, $data ) {
 15+ $change = new CodeComment( $rev );
 16+ $change->attrib = $data['cpc_attrib'];
 17+ $change->removed = $data['cpc_removed'];
 18+ $change->added = $data['cpc_added'];
 19+ $change->user = $data['cpc_user'];
 20+ // We'd prefer the up to date user table name
 21+ $change->userText = isset($data['user_name']) ? $data['user_name'] : $data['cpc_user_text'];
 22+ $change->timestamp = wfTimestamp( TS_MW, $data['cpc_timestamp'] );
 23+ return $change;
 24+ }
 25+}
Property changes on: trunk/extensions/CodeReview/CodePropChange.php
___________________________________________________________________
Added: svn:eol-style
126 + native

Follow-up revisions

RevisionCommit summaryAuthorDate
r81068Followup r43465, CodePropChange won't create a CodeComment instancereedy23:18, 26 January 2011

Status & tagging log