r43464 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r43463‎ | r43464 | r43465 >
Date:23:10, 13 November 2008
Author:aaron
Status:old
Tags:
Comment:
* Add getPropChanges()
* Fix prop changes insert query to include usertext
Modified paths:
  • /trunk/extensions/CodeReview/CodeRevision.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CodeReview/CodeRevision.php
@@ -133,7 +133,8 @@
134134 'cpc_removed' => $oldStatus,
135135 'cpc_added' => $status,
136136 'cpc_timestamp' => $dbw->timestamp(),
137 - 'cpc_user' => $user->getId()
 137+ 'cpc_user' => $user->getId(),
 138+ 'cpc_user_text' => $user->getName()
138139 ),
139140 __METHOD__
140141 );
@@ -311,8 +312,8 @@
312313 'cc_rev_id' => $this->mId ),
313314 __METHOD__,
314315 array(
315 - 'ORDER BY' => 'cc_sortkey' ) );
316 -
 316+ 'ORDER BY' => 'cc_sortkey' )
 317+ );
317318 $comments = array();
318319 foreach( $result as $row ) {
319320 $comments[] = CodeComment::newFromRow( $this, $row );
@@ -321,6 +322,31 @@
322323 return $comments;
323324 }
324325
 326+ public function getPropChanges() {
 327+ $dbr = wfGetDB( DB_SLAVE );
 328+ $result = $dbr->select( 'code_prop_changes',
 329+ array(
 330+ 'cpc_attrib',
 331+ 'cpc_removed',
 332+ 'cpc_added',
 333+ 'cpc_timestamp',
 334+ 'cpc_user',
 335+ 'cpc_user_text'
 336+ ), array(
 337+ 'cpc_repo_id' => $this->mRepoId,
 338+ 'cpc_rev_id' => $this->mId ),
 339+ __METHOD__,
 340+ array(
 341+ 'ORDER BY' => 'cpc_timestamp DESC' )
 342+ );
 343+ $changes = array();
 344+ foreach( $result as $row ) {
 345+ $changes[] = CodePropChange::newFromRow( $this, $row );
 346+ }
 347+ $result->free();
 348+ return $changes;
 349+ }
 350+
325351 protected function getCommentingUsers() {
326352 $dbr = wfGetDB( DB_SLAVE );
327353 $res = $dbr->select( 'code_comment',
@@ -391,7 +417,8 @@
392418 'cpc_removed' => implode(',',$removeTags),
393419 'cpc_added' => implode(',',$addTags),
394420 'cpc_timestamp' => $dbw->timestamp(),
395 - 'cpc_user' => $user->getId()
 421+ 'cpc_user' => $user->getId(),
 422+ 'cpc_user_text' => $user->getName()
396423 ),
397424 __METHOD__
398425 );

Status & tagging log