r79402 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r79401‎ | r79402 | r79403 >
Date:01:15, 1 January 2011
Author:reedy
Status:resolved
Tags:
Comment:
Do WHERE array a little bit more nicely
Modified paths:
  • /trunk/extensions/CodeReview/ui/CodeReleaseNotes.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CodeReview/ui/CodeReleaseNotes.php
@@ -50,23 +50,23 @@
5151 global $wgOut;
5252 $linker = new CodeCommentLinkerHtml( $this->mRepo );
5353 $dbr = wfGetDB( DB_SLAVE );
 54+ $where = array();
5455 if ( $this->mEndRev ) {
55 - $where = 'cr_id BETWEEN ' . intval( $this->mStartRev ) . ' AND ' . intval( $this->mEndRev );
 56+ $where[] = 'cr_id BETWEEN ' . intval( $this->mStartRev ) . ' AND ' . intval( $this->mEndRev );
5657 } else {
57 - $where = 'cr_id >= ' . intval( $this->mStartRev );
 58+ $where[] = 'cr_id >= ' . intval( $this->mStartRev );
5859 }
5960 if ( $this->mPath ) {
60 - $where .= ' AND cr_path = ' . $dbr->addQuotes( $this->mPath );
 61+ $where[] = 'cr_path' => $this->mPath;
6162 }
6263 # Select commits within this range...
6364 $res = $dbr->select( array( 'code_rev', 'code_tags' ),
6465 array( 'cr_message', 'cr_author', 'cr_id', 'ct_tag AS rnotes' ),
65 - array(
 66+ array_merge( array(
6667 'cr_repo_id' => $this->mRepo->getId(), // this repo
6768 "cr_status NOT IN('reverted','deferred','fixme')", // not reverted/deferred/fixme
6869 "cr_message != ''",
69 - $where // in range
70 - ),
 70+ ), $where ),
7171 __METHOD__,
7272 array( 'ORDER BY' => 'cr_id DESC' ),
7373 array( 'code_tags' => array( 'LEFT JOIN', # Tagged for release notes?

Follow-up revisions

RevisionCommit summaryAuthorDate
r79403Fix syntax fail from r79402reedy01:18, 1 January 2011

Status & tagging log