r94752 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r94751‎ | r94752 | r94753 >
Date:12:56, 17 August 2011
Author:reedy
Status:ok
Tags:
Comment:
Trim trailing whitespace

Add some documentation
Modified paths:
  • /trunk/extensions/InterwikiList/InterwikiList_body.php (modified) (history)
  • /trunk/extensions/OAI/OAIRepo_body.php (modified) (history)
  • /trunk/extensions/OpenID/SpecialOpenIDServer.body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/OAI/OAIRepo_body.php
@@ -571,7 +571,7 @@
572572
573573 function fetchRecord( $pageid ) {
574574 $db = $this->_db;
575 -
 575+
576576 $tables = array( 'updates', 'page', 'revision', 'text' );
577577 $fields = array( 'page_namespace', 'page_title', 'old_text', 'old_flags',
578578 'rev_id', 'rev_deleted', 'rev_comment', 'rev_user',
@@ -584,11 +584,11 @@
585585 $join_conds = array( 'page' => array( 'LEFT JOIN', 'page_id=up_page' ),
586586 'revision' => array( 'LEFT JOIN', 'page_latest=rev_id' ),
587587 'text' => array( 'LEFT JOIN', 'rev_text_id=old_id' ) );
588 -
 588+
589589 $conds['up_page'] = $pageid;
590 -
 590+
591591 $options['LIMIT'] = 1;
592 -
 592+
593593 wfRunHooks( 'OAIFetchRecordQuery', array( &$tables, &$fields, &$conds,
594594 &$options, &$join_conds ) );
595595
@@ -597,9 +597,9 @@
598598 }
599599
600600 function fetchRows( $from, $until, $chunk, $token = null ) {
601 -
 601+
602602 $db = $this->_db;
603 -
 603+
604604 $tables = array( 'updates', 'page', 'revision', 'text' );
605605 $fields = array( 'page_namespace', 'page_title', 'old_text', 'old_flags',
606606 'rev_id', 'rev_deleted', 'rev_comment', 'rev_user',
@@ -612,7 +612,7 @@
613613 $join_conds = array( 'page' => array( 'LEFT JOIN', 'page_id=up_page' ),
614614 'revision' => array( 'LEFT JOIN', 'page_latest=rev_id' ),
615615 'text' => array( 'LEFT JOIN', 'rev_text_id=old_id' ) );
616 -
 616+
617617 if( $token ) {
618618 $conds[] = 'up_sequence>=' . $db->addQuotes( $token );
619619 $options['ORDER BY'] = 'up_sequence';
@@ -625,9 +625,9 @@
626626 if( $until ) {
627627 $conds[] = 'up_timestamp<=' .$db->addQuotes( $db->timestamp( $until ) );
628628 }
629 -
 629+
630630 $options['LIMIT'] = $chunk;
631 -
 631+
632632 wfRunHooks( 'OAIFetchRowsQuery', array( &$tables, &$fields, &$conds,
633633 &$options, &$join_conds ) );
634634
Index: trunk/extensions/OpenID/SpecialOpenIDServer.body.php
@@ -166,6 +166,9 @@
167167
168168 # Returns an Auth_OpenID_Server from the libraries. Utility.
169169
 170+ /**
 171+ * @return Auth_OpenID_Server
 172+ */
170173 function getServer() {
171174 global $wgOpenIDServerStorePath,
172175 $wgOpenIDServerStoreType;
Index: trunk/extensions/InterwikiList/InterwikiList_body.php
@@ -6,9 +6,9 @@
77 if ( !defined('MEDIAWIKI') ) {
88 die( '' );
99 }
10 -
 10+
1111 class InterwikiList extends SpecialPage {
12 -
 12+
1313 // Privates
1414 private $mTitle; // The title for this specialpage
1515
@@ -17,9 +17,9 @@
1818 */
1919 public function InterwikiList() {
2020 parent::__construct("InterwikiList");
21 -
 21+
2222 }
23 -
 23+
2424 /**
2525 * Execute
2626 */
@@ -30,8 +30,8 @@
3131 $prefix = $wgRequest->getText( 'iwsearch', $par );
3232 $wgOut->addHTML( $this->getInterwikis( $prefix ) );
3333 }
34 -
35 - /**
 34+
 35+ /**
3636 * Get all Interwiki Links - the heart of the function
3737 * @param $prefix string Prefix to search for in list
3838 * @return string HTML
@@ -55,14 +55,14 @@
5656 $text = Xml::fieldSet( wfMsg('interwikilist-filter'), $form );
5757
5858 $interwikiList = array();
59 - while( $row = $dbr->fetchObject( $results ) ) {
 59+ foreach( $results as $row ) {
6060 $interwikiList[ "mw-iwlist-" . $row->iw_prefix ] = array( $row->iw_prefix, $row->iw_url );
6161 }
6262 $dbr->freeResult( $results );
6363
64 - $text .= Xml::buildTable( $interwikiList,
 64+ $text .= Xml::buildTable( $interwikiList,
6565 array( 'id' => 'sv-software' ),
66 - array( wfMsg( 'interwikilist-linkname'),
 66+ array( wfMsg( 'interwikilist-linkname'),
6767 wfMsg( 'interwikilist-target' ) ) );
6868 return $text;
6969 }

Status & tagging log