r90285 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r90284‎ | r90285 | r90286 >
Date:16:25, 17 June 2011
Author:reedy
Status:ok
Tags:
Comment:
Swap else if for elseif

Trimming trailing whitespace also
Modified paths:
  • /trunk/extensions/APC/SpecialAPC.php (modified) (history)
  • /trunk/extensions/AbuseFilter/AbuseFilter.class.php (modified) (history)
  • /trunk/extensions/ArrayExtension/ArrayExtension.php (modified) (history)
  • /trunk/extensions/ArticleComments/ArticleComments.php (modified) (history)
  • /trunk/extensions/ArticleFeedback/SpecialArticleFeedback.php (modified) (history)
  • /trunk/extensions/Awesomeness/Awesomeness.php (modified) (history)
  • /trunk/extensions/Call/Call_body.php (modified) (history)
  • /trunk/extensions/CategoryTree/CategoryTreeFunctions.php (modified) (history)
  • /trunk/extensions/CentralAuth/specials/SpecialGlobalGroupPermissions.php (modified) (history)
  • /trunk/extensions/CentralAuth/specials/SpecialWikiSets.php (modified) (history)
  • /trunk/extensions/Citation/Citation.php (modified) (history)
  • /trunk/extensions/ClientSide/ClientSide.php (modified) (history)
  • /trunk/extensions/CodeReview/ui/CodeReleaseNotes.php (modified) (history)
  • /trunk/extensions/CodeReview/ui/CodeRevisionAuthorLink.php (modified) (history)
  • /trunk/extensions/CodeReview/ui/CodeRevisionCommitter.php (modified) (history)
  • /trunk/extensions/CodeReview/ui/CodeRevisionView.php (modified) (history)
  • /trunk/extensions/Collection/Collection.body.php (modified) (history)
  • /trunk/extensions/Collection/Collection.hooks.php (modified) (history)
  • /trunk/extensions/CommunityVoice/Modules/Ratings.php (modified) (history)
  • /trunk/extensions/Configure/Configure.diff.php (modified) (history)
  • /trunk/extensions/Configure/handler/HandlerFiles.php (modified) (history)
  • /trunk/extensions/Configure/settings/WebExtension.php (modified) (history)
  • /trunk/extensions/Configure/specials/ConfigurationPage.php (modified) (history)
  • /trunk/extensions/ConfirmAccount/ConfirmAccount.php (modified) (history)
  • /trunk/extensions/ConfirmAccount/ConfirmAccount_body.php (modified) (history)
  • /trunk/extensions/ConfirmAccount/RequestAccount_body.php (modified) (history)
  • /trunk/extensions/ConfirmAccount/UserCredentials_body.php (modified) (history)
  • /trunk/extensions/ConfirmEdit/recaptchalib.php (modified) (history)
  • /trunk/extensions/ContactPage/SpecialContact.php (modified) (history)
  • /trunk/extensions/ContactPageFundraiser/SpecialContact.php (modified) (history)
  • /trunk/extensions/ContributionReporting/ContributionStatistics_body.php (modified) (history)
  • /trunk/extensions/ContributionTracking/ContributionTracking_body.php (modified) (history)
  • /trunk/extensions/Crosswiki/Block/CrosswikiBlock.page.php (modified) (history)
  • /trunk/extensions/DataCenter/UI/Widgets/History.php (modified) (history)
  • /trunk/extensions/DataCenter/UI/Widgets/Table.php (modified) (history)
  • /trunk/extensions/DataTransclusion/DataTransclusionHandler.php (modified) (history)
  • /trunk/extensions/DataTransclusion/DataTransclusionSource.php (modified) (history)
  • /trunk/extensions/DataTransclusion/ImportMAB2.php (modified) (history)
  • /trunk/extensions/DataTransclusion/MAB2RecordTransformer.php (modified) (history)
  • /trunk/extensions/DataTransclusion/WebDataTransclusionSource.php (modified) (history)
  • /trunk/extensions/DataTransclusion/tests/DataTransclusionTest.php (modified) (history)
  • /trunk/extensions/DataTransclusion/tests/fetchRecord.php (modified) (history)
  • /trunk/extensions/DataTransclusion/tests/fetchWebData.php (modified) (history)
  • /trunk/extensions/cldr/rebuild.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Awesomeness/Awesomeness.php
@@ -2,7 +2,7 @@
33
44 /**
55 * Initialization file for the Awesomeness extension.
6 - *
 6+ *
77 * Documentation: http://www.mediawiki.org/wiki/Extension:Awesomeness
88 * Support http://www.mediawiki.org/wiki/Extension_talk:Awesomeness
99 * Source code: http://svn.wikimedia.org/viewvc/mediawiki/trunk/extensions/Awesomeness
@@ -49,13 +49,13 @@
5050 */
5151 if ( array_key_exists( 'QUERY_STRING', $_SERVER ) ) {
5252 $O_o = false;
53 -
 53+
5454 if ( strtolower( $_SERVER['QUERY_STRING'] ) == 'isthiswikiawesome' ) {
5555 $O_o = 'Hell yeah!';
56 - } else if ( preg_match( '/^[0o°xt][-_\.][0o°xt]$/i', $_SERVER['QUERY_STRING'] ) ) {
 56+ } elseif ( preg_match( '/^[0o°xt][-_\.][0o°xt]$/i', $_SERVER['QUERY_STRING'] ) ) {
5757 $O_o = strrev( $_SERVER['QUERY_STRING'] );
5858 }
59 -
 59+
6060 if ( $O_o ) {
6161 header( 'Content-Type: text/plain' );
6262 die( $O_o );
Index: trunk/extensions/ContactPage/SpecialContact.php
@@ -110,7 +110,7 @@
111111
112112 $this->wasPosted = $wgRequest->wasPosted();
113113 $this->formType = $wgRequest->getText( 'formtype', $par );
114 -
 114+
115115 # Check for type in [[Special:Contact/type]]: change pagetext and prefill form fields
116116 if ( $this->formType != '' ) {
117117 $message = 'contactpage-pagetext-' . $this->formType;
@@ -136,7 +136,7 @@
137137 } else {
138138 $this->text = $wgRequest->getText( 'wpText' );
139139 }
140 - } else {
 140+ } else {
141141 $this->formularText = wfMsgExt( 'contactpage-pagetext', 'parse' );
142142 $this->text = $wgRequest->getText( 'wpText' );
143143 $this->subject = $wgRequest->getText( 'wpSubject' );
@@ -274,7 +274,7 @@
275275 '</td>
276276 </tr>';
277277 }
278 -
 278+
279279 $ccme = $this->wasPosted ? $this->cc_me : $wgUser->getBoolOption( 'ccmeonemails' );
280280 $form .= '<tr>
281281 <td></td>
@@ -380,7 +380,7 @@
381381 } else {
382382 $subject = wfMsgForContent( 'contactpage-subject-and-sender', $subject, $this->fromaddress );
383383 }
384 - } else if ( $includeIP ) {
 384+ } elseif ( $includeIP ) {
385385 $subject = wfMsgForContent( 'contactpage-subject-and-sender', $subject, $senderIP );
386386 }
387387
Index: trunk/extensions/Call/Call_body.php
@@ -31,7 +31,7 @@
3232 class Call extends SpecialPage {
3333 function __construct() {
3434 parent::__construct( "Call" );
35 -
 35+
3636 }
3737
3838
@@ -63,7 +63,7 @@
6464 }
6565 if ( $argKey == 'title' ) {
6666 $argTitle = $n;
67 - } else if ( $argTitle >= 0 ) {
 67+ } elseif ( $argTitle >= 0 ) {
6868 if ( preg_match( '/(UserName|UserID|_session|Token)$/', $argKey ) ) {
6969 break;
7070 }
@@ -144,7 +144,7 @@
145145 $template = preg_replace( '/\|.*/', '', $wikitext );
146146 if ( strpos( ':', $template ) === false ) {
147147 $template = 'Template:' . $template;
148 - } else if ( $template[0] == ':' ) {
 148+ } elseif ( $template[0] == ':' ) {
149149 $template = substr( $template, 1 );
150150 }
151151 $title = Title::newFromText( $template );
@@ -159,7 +159,7 @@
160160 if ( $wikitext == '' || $wikitext == 'Special:Call' ) {
161161 // Called without parameters: dump explanation
162162 $wgOut->addHTML( wfMsg( 'call-text' ) );
163 - } else if ( $debug ) {
 163+ } elseif ( $debug ) {
164164 // Called with DebuG target: dump parameter list
165165 $wgOut->addHTML( "<pre>\n{{" . $wikitext . "}}\n</pre>" );
166166 if ( $saveAsPage != '' ) {
@@ -233,18 +233,18 @@
234234 $n = -1;
235235 $tpl = $field[0];
236236 $field[0] = 'ID';
237 - } else if ( strpos( $line, '|' ) == 0 ) {
 237+ } elseif ( strpos( $line, '|' ) == 0 ) {
238238 $n++;
239239 $field[$n] = substr( $line, 1 );
240240 }
241 - } else if ( strpos( $line, '|-' ) !== false ) {
 241+ } elseif ( strpos( $line, '|-' ) !== false ) {
242242 $n = -1;
243 - } else if ( strpos( $line, '|}' ) !== false ) {
 243+ } elseif ( strpos( $line, '|}' ) !== false ) {
244244 $text[] = '}}';
245245 break;
246 - } else if ( $line == '' ) {
 246+ } elseif ( $line == '' ) {
247247 $text[] = '';
248 - } else if ( $line[0] == '|' ) {
 248+ } elseif ( $line[0] == '|' ) {
249249 $n++;
250250 if ( $n == 0 ) {
251251 if ( $head ) {
Index: trunk/extensions/Configure/settings/WebExtension.php
@@ -177,7 +177,7 @@
178178 /**
179179 * Prettify boolean settings to be correctly displayed
180180 *
181 - * @return String
 181+ * @return String
182182 */
183183 public static function prettifyForDisplay( $val ) {
184184 if ( is_bool( $val ) )
@@ -277,7 +277,7 @@
278278 $actual = $conf[$setting];
279279 else
280280 $actual = $GLOBALS[$setting];
281 -
 281+
282282 if ( $actual !== $value ) {
283283 $ret[] = array( $setting, $value, $actual );
284284 }
@@ -333,7 +333,7 @@
334334 public function isActivated() {
335335 if( $this->mTempActivated !== null ) {
336336 return $this->mTempActivated;
337 - } else if( $this->useVariable() ) {
 337+ } elseif( $this->useVariable() ) {
338338 return isset( $GLOBALS[$this->getVariable()] ) && $GLOBALS[$this->getVariable()];
339339 } else {
340340 global $wgConf;
Index: trunk/extensions/Configure/specials/ConfigurationPage.php
@@ -396,7 +396,7 @@
397397 if( !$data['userwiki'] || !$data['username'] ) {
398398 $userLink = '';
399399 $username = '';
400 - } else if ( $data['userwiki'] == wfWikiId() ) {
 400+ } elseif ( $data['userwiki'] == wfWikiId() ) {
401401 $userLink = $skin->link( Title::makeTitle( NS_USER, $data['username'] ), htmlspecialchars( $data['username'] ) );
402402 $username = $data['username'];
403403 } elseif ( $wiki = WikiMap::getWiki( $data['userwiki'] ) ) {
@@ -595,7 +595,7 @@
596596 }
597597 if ( $val )
598598 $settings[$name][$group][$right] = true;
599 - } else if ( $wgRequest->getCheck( $id ) ) {
 599+ } elseif ( $wgRequest->getCheck( $id ) ) {
600600 $settings[$name][$group][] = $right;
601601 }
602602 }
@@ -1378,7 +1378,7 @@
13791379 }
13801380
13811381 $row .= Html::openElement( 'table', array( 'class' => 'configure-table-promotion' ) );
1382 -
 1382+
13831383 $row .= Html::rawElement( 'tr', array(), Html::element( 'th', array(), wfMsg( 'configure-condition-name' ) ) .
13841384 Html::element( 'th', array(), wfMsg( 'configure-condition-requirement' ) ) )."\n";
13851385 foreach ( $conds as $condName => $condType ) {
@@ -1431,7 +1431,7 @@
14321432 */
14331433 public static function buildGroupSettingRow( $conf, $type, $all, $allowed, $group, $levs ){
14341434 $attr = ( !$allowed ) ? array( 'disabled' => 'disabled' ) : array();
1435 -
 1435+
14361436 $row = Html::openElement( 'div', array( 'class' => 'configure-biglist '.$type.'-element' ) ) . Html::openElement( 'ul' );
14371437 foreach ( $all as $right ) {
14381438 if ( $type == 'group-bool' )
Index: trunk/extensions/Configure/handler/HandlerFiles.php
@@ -17,7 +17,7 @@
1818 if ( $wgConfigureFilesPath === null ) {
1919 global $IP;
2020 $wgConfigureFilesPath = "$IP/serialized/";
21 - } else if ( substr( $wgConfigureFilesPath, -1 ) != '/' && substr( $wgConfigureFilesPath, -1 ) != '\\' ) {
 21+ } elseif ( substr( $wgConfigureFilesPath, -1 ) != '/' && substr( $wgConfigureFilesPath, -1 ) != '\\' ) {
2222 $wgConfigureFilesPath .= '/';
2323 }
2424 $this->mDir = $wgConfigureFilesPath;
Index: trunk/extensions/Configure/Configure.diff.php
@@ -217,25 +217,25 @@
218218 function getSettingAsArray( $setting, $name, $type ) {
219219 if ( $setting === null ) {
220220 $val = array();
221 - } else if ( $type == 'array' ) {
 221+ } elseif ( $type == 'array' ) {
222222 if( !is_array( $setting ) )
223223 return array();
224224 $arrType = $this->getArrayType( $name );
225225 if ( $arrType == 'simple' || $arrType == 'ns-simple' ) {
226226 $val = array_values( $setting );
227 - } else if ( $arrType == 'assoc' ) {
 227+ } elseif ( $arrType == 'assoc' ) {
228228 $arrVal = array();
229229 foreach ( $setting as $key => $value ) {
230230 $arrVal[] = "$key: $value";
231231 }
232232 $val = $arrVal;
233 - } else if ( $arrType == 'simple-dual' ) {
 233+ } elseif ( $arrType == 'simple-dual' ) {
234234 $arrVal = array();
235235 foreach ( $setting as $key => $value ) {
236236 $arrVal[] = implode( ',', $value );
237237 }
238238 $val = $arrVal;
239 - } else if ( $arrType == 'ns-bool' || $arrType == 'ns-text' || $arrType == 'ns-array' ) {
 239+ } elseif ( $arrType == 'ns-bool' || $arrType == 'ns-text' || $arrType == 'ns-array' ) {
240240 $arrVal = array();
241241 foreach ( $setting as $key => $value ) {
242242 if ( $arrType == 'ns-bool' )
@@ -245,13 +245,13 @@
246246 $arrVal[] = "$key: $value";
247247 }
248248 $val = $arrVal;
249 - } else if ( $arrType == 'group-array' ) {
 249+ } elseif ( $arrType == 'group-array' ) {
250250 $arrVal = array();
251251 foreach ( $setting as $key => $value ) {
252252 $arrVal[] = "$key: " . implode( ',', $value );
253253 }
254254 $val = $arrVal;
255 - } else if ( $arrType == 'group-bool' ) {
 255+ } elseif ( $arrType == 'group-bool' ) {
256256 $arrVal = array();
257257 ksort($setting);
258258 foreach ( $setting as $key1 => $value1 ) {
@@ -262,7 +262,7 @@
263263 }
264264 }
265265 $val = $arrVal;
266 - } else if ( $arrType == 'rate-limits' ) {
 266+ } elseif ( $arrType == 'rate-limits' ) {
267267 $val = array();
268268 ## Just walk the tree and print out the data.
269269 foreach( $setting as $action => $limits ) {
@@ -276,7 +276,7 @@
277277 }
278278 }
279279 }
280 - } else if ( $arrType == 'promotion-conds' ) {
 280+ } elseif ( $arrType == 'promotion-conds' ) {
281281 ## For each group, print out the full conditions.
282282 $val = array();
283283
@@ -324,7 +324,7 @@
325325 } else {
326326 $val = explode( "\n", var_export( $setting, 1 ) );
327327 }
328 - } else if ( $type == 'bool' ) {
 328+ } elseif ( $type == 'bool' ) {
329329 $val = array( $setting ? 'true' : 'false' );
330330 } else {
331331 $val = explode( "\n", (string)$setting );
Index: trunk/extensions/ConfirmEdit/recaptchalib.php
@@ -237,7 +237,7 @@
238238
239239 if (strlen ($arr[0]) <= 4) {
240240 $arr[0] = substr ($arr[0], 0, 1);
241 - } else if (strlen ($arr[0]) <= 6) {
 241+ } elseif (strlen ($arr[0]) <= 6) {
242242 $arr[0] = substr ($arr[0], 0, 3);
243243 } else {
244244 $arr[0] = substr ($arr[0], 0, 4);
Index: trunk/extensions/ArticleFeedback/SpecialArticleFeedback.php
@@ -1,7 +1,7 @@
22 <?php
33 /**
44 * SpecialPage for ArticleFeedback extension
5 - *
 5+ *
66 * @file
77 * @ingroup Extensions
88 */
@@ -22,19 +22,19 @@
2323 if ( $wgArticleFeedbackDashboard ) {
2424 // fetch the highest and lowest rated articles
2525 $highs_lows = $this->getDailyHighsAndLows();
26 -
 26+
2727 // determine the highest rated articles
2828 $highs = $this->getDailyHighs( $highs_lows );
29 -
 29+
3030 // .. and the lowest rated articles
3131 $lows = $this->getDailyLows( $highs_lows );
32 -
 32+
3333 // provide some messaging above high/low tables
3434 $wgOut->addWikiMsg( 'articleFeedback-copy-above-highlow-tables', $wgArticleFeedbackDashboardTalkPage );
35 -
 35+
3636 //render daily highs table
3737 $this->renderDailyHighsAndLows( $highs, wfMsg( 'articleFeedback-table-caption-dailyhighs', $wgLang->date( time() )));
38 -
 38+
3939 //render daily lows table
4040 $this->renderDailyHighsAndLows( $lows, wfMsg( 'articleFeedback-table-caption-dailylows', $wgLang->date( time() )));
4141
@@ -42,7 +42,7 @@
4343 This functionality does not exist yet.
4444 $this->renderWeeklyMostChanged();*/
4545 $this->renderProblems();
46 -
 46+
4747 $wgOut->addWikiMsg( 'articlefeedback-dashboard-bottom' );
4848 } else {
4949 $wgOut->addWikiText( 'This page has been disabled.' );
@@ -53,7 +53,7 @@
5454
5555 /**
5656 * Returns an HTML table containing data from a given two dimensional array.
57 - *
 57+ *
5858 * @param $headings Array: List of rows, each a list of column data (values will be escaped)
5959 * @param $rows Array: List of rows, each a list of either calss/column data pairs (values will
6060 * be escaped), or arrays containing attr, text and html fields, used to set attributes, text or
@@ -89,7 +89,7 @@
9090 }
9191 if ( isset( $column['text'] ) ) {
9292 $table .= Html::element( 'td', $attr, $column['text'] );
93 - } else if ( isset( $column['html'] ) ) {
 93+ } elseif ( isset( $column['html'] ) ) {
9494 $table .= Html::rawElement( 'td', $attr, $column['html'] );
9595 } else {
9696 $table .= Html::element( 'td', $attr );
@@ -107,12 +107,12 @@
108108
109109 /**
110110 * Renders daily highs and lows
111 - *
 111+ *
112112 * @return String: HTML table of daily highs and lows
113113 */
114114 protected function renderDailyHighsAndLows( $pages, $caption ) {
115115 global $wgOut, $wgUser;
116 -
 116+
117117 // Pre-fill page ID cache
118118 $ids = array();
119119 foreach ( $pages as $page ) {
@@ -145,7 +145,7 @@
146146 $rows[] = $row;
147147 }
148148 }
149 -
 149+
150150 $this->renderTable(
151151 $caption,
152152 array_merge(
@@ -160,7 +160,7 @@
161161
162162 /**
163163 * Renders weekly most changed
164 - *
 164+ *
165165 * @return String: HTML table of weekly most changed
166166 */
167167 protected function renderWeeklyMostChanged() {
@@ -194,22 +194,22 @@
195195
196196 /**
197197 * Renders problem articles table
198 - *
 198+ *
199199 * @return String: HTML table of recent lows
200200 */
201201 protected function renderProblems() {
202202 global $wgOut, $wgUser, $wgArticleFeedbackRatings;
203203
204 -
 204+
205205 $problems = $this->getProblems();
206 -
 206+
207207 // Pre-fill page ID cache
208208 $ids = array();
209209 foreach ( $problems as $page ) {
210210 $ids[] = $page['page'];
211211 }
212212 self::populateTitleCache( $ids );
213 -
 213+
214214 $rows = array();
215215 foreach ( $problems as $page ) {
216216 $row = array();
@@ -266,12 +266,12 @@
267267 __METHOD__,
268268 array( "ORDER BY" => "afs_ts DESC", "LIMIT" => 1 )
269269 );
270 -
 270+
271271 // if we have no results, just return
272272 if ( !$row || !$row->afs_ts ) {
273273 return array();
274274 }
275 -
 275+
276276 // select ratings with that ts
277277 $result = $dbr->select(
278278 'article_feedback_stats',
@@ -280,7 +280,7 @@
281281 'afs_orderable_data',
282282 'afs_data'
283283 ),
284 - array(
 284+ array(
285285 'afs_ts' => $row->afs_ts,
286286 'afs_stats_type_id' => $typeID
287287 ),
@@ -290,17 +290,17 @@
291291 $problems = $this->buildProblems( $result );
292292 $wgMemc->set( $key, $problems, 86400 );
293293 }
294 -
 294+
295295 return $problems;
296296 }
297 -
 297+
298298 /**
299299 * Gets a list of articles which were rated exceptionally high or low.
300 - *
 300+ *
301301 * - Based on average of all rating categories
302302 * - Gets 50 highest rated and 50 lowest rated
303303 * - Only consider articles with 10+ ratings in the last 24 hours
304 - *
 304+ *
305305 * This data should be updated daily, ideally though a scheduled batch job
306306 */
307307 protected function getDailyHighsAndLows() {
@@ -321,12 +321,12 @@
322322 __METHOD__,
323323 array( "ORDER BY" => "afs_ts DESC", "LIMIT" => 1 )
324324 );
325 -
 325+
326326 // if we have no results, just return
327327 if ( !$row || !$row->afs_ts ) {
328328 return array();
329329 }
330 -
 330+
331331 // select ratings with that ts
332332 $result = $dbr->select(
333333 'article_feedback_stats',
@@ -335,7 +335,7 @@
336336 'afs_orderable_data',
337337 'afs_data'
338338 ),
339 - array(
 339+ array(
340340 'afs_ts' => $row->afs_ts,
341341 'afs_stats_type_id' => $typeID,
342342 ),
@@ -345,20 +345,20 @@
346346 $highs_lows = $this->buildHighsAndLows( $result );
347347 $wgMemc->set( $key, $highs_lows, 86400 );
348348 }
349 -
 349+
350350 return $highs_lows;
351351 }
352352
353353 /**
354354 * Determine the 'highest' rated articles
355 - *
 355+ *
356356 * Divides the number of ratings in half to determine the range of
357357 * articles to consider 'highest'. In the event of an odd number
358358 * of articles, (determined by checking for modulus of # of ratings / 2),
359359 * round up, giving preference to the 'highs' so
360 - * everyone feels warm and fuzzy about having more 'highs', as
 360+ * everyone feels warm and fuzzy about having more 'highs', as
361361 * it were...
362 - *
 362+ *
363363 * @param array Pre-orderd from lowest to highest
364364 * @return array Containing the... highest rated article data
365365 */
@@ -371,14 +371,14 @@
372372 }
373373 return array_slice( $highs_lows, -$num_highs, $num_highs );
374374 }
375 -
 375+
376376 /**
377377 * Determine the 'lowest' rated articles
378378 *
379379 * @see getDailyHighs() However, if we are dealing with an odd number of
380380 * ratings, round up and then subtract 1 since we are giving preference
381381 * to the 'highs' when dealing with an odd number of ratings. We do this
382 - * rather than rely on PHP's rounding 'modes' for compaitibility with
 382+ * rather than rely on PHP's rounding 'modes' for compaitibility with
383383 * PHP < 5.3
384384 * @param array Pre-orderd from lowest to highest
385385 * @return array Containing the... lowest rated article data
@@ -392,7 +392,7 @@
393393 }
394394 return array_slice( $highs_lows, 0, $num_lows );
395395 }
396 -
 396+
397397 /**
398398 * Build data store of highs/lows for use when rendering table
399399 * @param object Database result or array of rows
@@ -412,7 +412,7 @@
413413 }
414414 return $highs_lows;
415415 }
416 -
 416+
417417 /**
418418 * Build data store of problems for use when rendering table
419419 * @param object Database result or array of rows
@@ -432,7 +432,7 @@
433433 }
434434 return $problems;
435435 }
436 -
 436+
437437 /**
438438 * Get the stats type id for a given stat type
439439 * @param string $stats_type
@@ -444,7 +444,7 @@
445445 if ( $cache ) {
446446 return $cache;
447447 }
448 -
 448+
449449 $dbr = wfGetDB( DB_SLAVE );
450450 $row = $dbr->selectRow(
451451 'article_feedback_stats_types',
@@ -456,14 +456,14 @@
457457 $wgMemc->set( $key, $row->afst_id );
458458 return $row->afst_id;
459459 }
460 -
 460+
461461 /**
462462 * Gets a list of articles which have quickly changing ratings.
463 - *
 463+ *
464464 * - Based on any rating category
465465 * - Gets 50 most improved and 50 most worsened
466466 * - Only consider articles with 100+ ratings in the last 7 days
467 - *
 467+ *
468468 * This data should be updated daily, ideally though a scheduled batch job
469469 */
470470 protected function getWeeklyMostChanged() {
@@ -499,7 +499,7 @@
500500
501501 protected static function formatNumber( $number ) {
502502 global $wgLang;
503 -
 503+
504504 return $wgLang->formatNum( number_format( $number, 2 ) );
505505 }
506506
@@ -521,7 +521,7 @@
522522 }
523523 return self::$categories;
524524 }
525 -
 525+
526526 protected static function getTitleFromID( $id ) {
527527 // There's no caching in Title::newFromId() so we hack our own around it
528528 if ( !isset( self::$titleCache[$id] ) ) {
@@ -529,7 +529,7 @@
530530 }
531531 return self::$titleCache[$id];
532532 }
533 -
 533+
534534 protected static function populateTitleCache( $ids ) {
535535 $toQuery = array_diff( $ids, array_keys( self::$titleCache ) );
536536 $titles = Title::newFromIds( $toQuery );
Index: trunk/extensions/Citation/Citation.php
@@ -39,9 +39,9 @@
4040 $ret .= $x ;
4141 }
4242 $ret = "<hr /><ol>" . $ret . "</ol>" ;
43 -
 43+
4444 $text .= $ret ;
45 -
 45+
4646 return true;
4747 }
4848
@@ -50,7 +50,7 @@
5151 $wgCitationCache = array();
5252 $wgCitationCounter = 1 ;
5353 $wgCitationRunning = false;
54 -
 54+
5555 return true;
5656 }
5757
@@ -63,24 +63,24 @@
6464 $res2 = array() ;
6565 $href = "" ;
6666 $a = explode( "||" , $text ) ;
67 -
 67+
6868 foreach ( $a AS $line ) {
6969 $data = explode( "=" , $line , 2 ) ;
7070 while ( count( $data ) < 2 ) $data[] = "" ;
7171 $key = urlencode( trim( strtolower( array_shift( $data ) ) ) ) ;
7272 $value = array_shift( $data ) ;
73 -
 73+
7474 // Parsed now : "$key" = "$value"
75 - if ( substr( $value , 0 , 3 ) == "{{{" ) { } // Unset variable, ignore
76 - else if ( $key == "attheend" ) $attheend = true ;
77 - else if ( $key == "href" ) $href = $value ;
78 - else if ( $value != "" ) {
 75+ if ( substr( $value , 0 , 3 ) == "{{{" ) { } // Unset variable, ignore
 76+ elseif ( $key == "attheend" ) $attheend = true ;
 77+ elseif ( $key == "href" ) $href = $value ;
 78+ elseif ( $value != "" ) {
7979 $x = array( "key" => $key , "value" => $value ) ;
8080 $res[] = $x ;
8181 $res2[$key] = $value ;
8282 }
8383 }
84 -
 84+
8585 // Creating output string
8686 foreach ( $res AS $item ) {
8787 $key = $item["key"] ;
@@ -94,7 +94,7 @@
9595 }
9696
9797 if ( $href != "" ) $ret .= " [{$href}]" ;
98 -
 98+
9999 // Adding to footer list or showing inline
100100 $localParser = new Parser ;
101101 $wgCitationRunning = true ;
Index: trunk/extensions/ContributionReporting/ContributionStatistics_body.php
@@ -10,7 +10,7 @@
1111 class SpecialContributionStatistics extends SpecialPage {
1212
1313 /* Members */
14 -
 14+
1515 private $mStartDate;
1616 private $mEndDate;
1717 private $mMode;
@@ -21,17 +21,17 @@
2222 // Initialize special page
2323 parent::__construct( 'ContributionStatistics' );
2424 }
25 -
 25+
2626 public function execute( $sub ) {
2727 global $egContributionStatisticsViewDays;
28 -
 28+
2929 $this->evalDateRange();
30 -
 30+
3131 // Handle sub-pages
3232 if( $sub !== '' ) {
3333 // Split parameters up
3434 $params = explode( '/', trim( $sub, '/' ) );
35 -
 35+
3636 // Handle ranges
3737 if ( $params[0] == 'range' && isset( $params[1] ) ) {
3838 $valid = false;
@@ -39,7 +39,7 @@
4040 if ( count( $range ) >= 2 ) {
4141 // From start to end
4242 $valid = $this->evalDateRange( $range[0], $range[1] );
43 - } else if ( count( $range ) == 1 ) {
 43+ } elseif ( count( $range ) == 1 ) {
4444 // From start to end of current fiscal year
4545 $valid = $this->evalDateRange( $range[0] );
4646 }
@@ -49,41 +49,41 @@
5050 }
5151 }
5252 }
53 -
 53+
5454 // Begin output
5555 $this->setHeaders();
56 -
 56+
5757 // Show daily totals if the range includes today
5858 if( $this->mEndDate > time() && $this->mStartDate < time() ) {
5959 $this->showDailyTotals( $egContributionStatisticsViewDays );
6060 }
61 -
 61+
6262 // Show daily totals
6363 $this->showMonthlyTotals( );
64 -
 64+
6565 // Show currency totals
6666 $this->showCurrencyTotals();
67 -
 67+
6868 // Show contribution breakdown
6969 $this->showContributionBreakdown();
7070 }
71 -
 71+
7272 /* Display Functions */
73 -
 73+
7474 public function showDailyTotals( $days ) {
7575 global $wgOut, $wgLang;
76 -
 76+
7777 $days = $this->getDailyTotals( $days );
7878 $total = $this->getTotalContributions();
79 -
 79+
8080 $htmlOut = Xml::element( 'h3', null,
8181 wfMsgExt( 'contribstats-daily-totals', array( 'parsemag' ), $wgLang->formatNum( count( $days ) ) )
8282 );
83 -
 83+
8484 $htmlOut .= Xml::openElement( 'table',
85 - array(
 85+ array(
8686 'border' => 0,
87 - 'cellpadding' => 5,
 87+ 'cellpadding' => 5,
8888 'width' => '100%'
8989 )
9090 );
@@ -94,7 +94,7 @@
9595 /*$htmlOut .= Xml::element( 'th', array( 'align' => 'right' ), wfMsg( 'contribstats-med' ) );*/
9696 $htmlOut .= Xml::element( 'th', array( 'align' => 'right' ), wfMsg( 'contribstats-max' ) );
9797 $htmlOut .= Xml::element( 'th', array( 'align' => 'right' ), wfMsg( 'contribstats-total-ytd' ) );
98 -
 98+
9999 // Days
100100 foreach ( $days as $data ) {
101101 $htmlOut .= Xml::tags( 'tr', null,
@@ -108,16 +108,16 @@
109109 );
110110 $total -= $data[2];
111111 }
112 -
 112+
113113 $htmlOut .= Xml::closeElement( 'table' );
114 -
 114+
115115 // Output HTML
116116 $wgOut->addHTML( $htmlOut );
117117 }
118 -
 118+
119119 public function showMonthlyTotals() {
120120 global $wgOut, $wgLang;
121 -
 121+
122122 $months = $this->getMonthlyTotals();
123123 $total = $this->getTotalContributions();
124124
@@ -127,11 +127,11 @@
128128 $msg = wfMsgExt( 'contribstats-monthly-totals', array( 'parsemag' ), $wgLang->formatNum( count( $months ) ) );
129129 }
130130 $htmlOut = Xml::element( 'h3', null, $msg );
131 -
 131+
132132 $htmlOut .= Xml::openElement( 'table',
133 - array(
 133+ array(
134134 'border' => 0,
135 - 'cellpadding' => 5,
 135+ 'cellpadding' => 5,
136136 'width' => '100%'
137137 )
138138 );
@@ -142,7 +142,7 @@
143143 /*$htmlOut .= Xml::element( 'th', array( 'align' => 'right' ), wfMsg( 'contribstats-med' ) );*/
144144 $htmlOut .= Xml::element( 'th', array( 'align' => 'right' ), wfMsg( 'contribstats-max' ) );
145145 $htmlOut .= Xml::element( 'th', array( 'align' => 'right' ), wfMsg( 'contribstats-total-ytd' ) );
146 -
 146+
147147 // Months
148148 foreach ( $months as $data ) {
149149 $htmlOut .= Xml::tags( 'tr', null,
@@ -156,16 +156,16 @@
157157 );
158158 $total -= $data[2];
159159 }
160 -
 160+
161161 $htmlOut .= Xml::closeElement( 'table' );
162 -
 162+
163163 // Output HTML
164164 $wgOut->addHTML( $htmlOut );
165165 }
166 -
 166+
167167 public function showCurrencyTotals() {
168168 global $wgOut, $wgLang;
169 -
 169+
170170 if ( $this->mMode == 'range' ) {
171171 $msg = wfMsg( 'contribstats-currency-range-totals',
172172 $wgLang->date( wfTimestamp( TS_MW, $this->mStartDate ) ),
@@ -175,11 +175,11 @@
176176 $msg = wfMsg( 'contribstats-currency-totals', $this->getCurrentFiscalYear() );
177177 }
178178 $htmlOut = Xml::element( 'h3', null, $msg );
179 -
 179+
180180 $htmlOut .= Xml::openElement( 'table',
181 - array(
 181+ array(
182182 'border' => 0,
183 - 'cellpadding' => 5,
 183+ 'cellpadding' => 5,
184184 'width' => '100%'
185185 )
186186 );
@@ -189,7 +189,7 @@
190190 $htmlOut .= Xml::element( 'th', array( 'align' => 'right' ), wfMsg( 'contribstats-avg' ) );
191191 /*$htmlOut .= Xml::element( 'th', array( 'align' => 'right' ), wfMsg( 'contribstats-med' ) );*/
192192 $htmlOut .= Xml::element( 'th', array( 'align' => 'right' ), wfMsg( 'contribstats-max' ) );
193 -
 193+
194194 // Days
195195 foreach ( $this->getCurrencyTotals() as $data ) {
196196 $htmlOut .= Xml::tags( 'tr', null,
@@ -201,13 +201,13 @@
202202 Xml::element( 'td', array( 'align' => 'right' ), $wgLang->formatNum( number_format( $data[4], 2 ) ) )
203203 );
204204 }
205 -
 205+
206206 $htmlOut .= Xml::closeElement( 'table' );
207 -
 207+
208208 // Output HTML
209209 $wgOut->addHTML( $htmlOut );
210210 }
211 -
 211+
212212 public function showContributionBreakdown() {
213213 global $wgOut, $wgLang;
214214
@@ -220,11 +220,11 @@
221221 $msg = wfMsg( 'contribstats-contribution-breakdown', $this->getCurrentFiscalYear() );
222222 }
223223 $htmlOut = Xml::element( 'h3', null, $msg );
224 -
 224+
225225 $htmlOut .= Xml::openElement( 'table',
226 - array(
 226+ array(
227227 'border' => 0,
228 - 'cellpadding' => 5,
 228+ 'cellpadding' => 5,
229229 'width' => '100%'
230230 )
231231 );
@@ -232,10 +232,10 @@
233233 $htmlOut .= Xml::element( 'th', array( 'align' => 'right' ), wfMsg( 'contribstats-contributions' ) );
234234 $htmlOut .= Xml::element( 'th', array( 'align' => 'right' ), wfMsg( 'contribstats-percentage-ytd' ) );
235235 $htmlOut .= Xml::element( 'th', array( 'align' => 'right' ), wfMsg( 'contribstats-avg' ) );
236 -
 236+
237237 $numContributions = $this->getNumContributions();
238238 $factor = $numContributions > 0 ? 100.0 / $numContributions : 0;
239 -
 239+
240240 $list = array(
241241 wfMsg( 'contribstats-value-exactly', $wgLang->formatNum( 35 ) ) => array( 35 ),
242242 wfMsg( 'contribstats-value-exactly', $wgLang->formatNum( 75 ) ) => array( 75 ),
@@ -254,25 +254,25 @@
255255 Xml::element( 'td', array( 'align' => 'left' ), $label ) .
256256 Xml::element( 'td', array( 'align' => 'right' ),
257257 $wgLang->formatNum( $data[0] ) ) .
258 - Xml::element( 'td', array( 'align' => 'right' ),
 258+ Xml::element( 'td', array( 'align' => 'right' ),
259259 wfMsg( 'percent', $wgLang->formatNum( round( $data[0] * $factor, 2 ) ) ) ) .
260260 Xml::element( 'td', array( 'align' => 'right' ),
261261 isset( $range[1] ) ? $wgLang->formatNum( round( $data[1], 2 ) ) : '-' )
262262 );
263263 }
264 -
 264+
265265 $htmlOut .= Xml::closeElement( 'table' );
266 -
 266+
267267 // Output HTML
268268 $wgOut->addHTML( $htmlOut );
269269 }
270 -
 270+
271271 /* Query Functions */
272 -
 272+
273273 public function getDailyTotals( $limit = 30 ) {
274274 // Get connection
275275 $dbr = efContributionReportingConnection();
276 -
 276+
277277 // Select sums and dates of contributions grouped by day
278278 $res = $dbr->select( 'public_reporting',
279279 array(
@@ -290,7 +290,7 @@
291291 'GROUP BY' => "FROM_UNIXTIME(received, '%Y-%m-%d')"
292292 )
293293 );
294 -
 294+
295295 // Build day/value array
296296 $totals = array();
297297 foreach ( $res as $row ) {
@@ -311,15 +311,15 @@
312312 */
313313 $totals[] = $row;
314314 }
315 -
 315+
316316 // Return results
317317 return $totals;
318318 }
319 -
 319+
320320 public function getMonthlyTotals() {
321321 // Get connection
322322 $dbr = efContributionReportingConnection();
323 -
 323+
324324 // Select sums and dates of contributions grouped by day
325325 $res = $dbr->select( 'public_reporting',
326326 array(
@@ -336,7 +336,7 @@
337337 'GROUP BY' => "FROM_UNIXTIME(received, '%Y-%m')"
338338 )
339339 );
340 -
 340+
341341 // Build day/value array
342342 $totals = array();
343343 foreach ( $res as $row ) {
@@ -355,15 +355,15 @@
356356 $row[] = $median;
357357 $totals[] = $row;
358358 }
359 -
 359+
360360 // Return results
361361 return $totals;
362362 }
363 -
 363+
364364 public function getCurrencyTotals() {
365365 // Get connection
366366 $dbr = efContributionReportingConnection();
367 -
 367+
368368 // Select sums and dates of contributions grouped by day
369369 $res = $dbr->select( 'public_reporting',
370370 array(
@@ -380,7 +380,7 @@
381381 'GROUP BY' => 'original_currency'
382382 )
383383 );
384 -
 384+
385385 $totals = array();
386386 foreach ( $res as $row ) {
387387 $median = $dbr->selectField( 'public_reporting',
@@ -401,25 +401,25 @@
402402 $row[] = $median;
403403 $totals[$row[0]] = $row;
404404 }
405 -
 405+
406406 if ( isset( $totals[null] ) ) {
407407 // Merge null and USD
408408 $totals['USD'][1] += $totals[null][1];
409409 $totals['USD'][2] += $totals[null][2];
410 - $totals['USD'][3] = ( $totals[null][3] == 0 ) ? $totals['USD'][3] : ( $totals['USD'][3] + $totals[null][3] ) / 2;
 410+ $totals['USD'][3] = ( $totals[null][3] == 0 ) ? $totals['USD'][3] : ( $totals['USD'][3] + $totals[null][3] ) / 2;
411411 $totals['USD'][4] = max( $totals['USD'][4], $totals[null][4] );
412412 /* $totals['USD'][5] = min( $totals['USD'][5], $totals[null][5] ); */
413413 unset( $totals[null] );
414414 }
415 -
 415+
416416 // Return results
417417 return $totals;
418418 }
419 -
 419+
420420 public function getNumContributionsWithin( $min, $max ) {
421421 // Get connection
422422 $dbr = efContributionReportingConnection();
423 -
 423+
424424 // Return average contribution amount
425425 $sizes = array(
426426 'converted_amount >= ' . $dbr->addQuotes( $min ),
@@ -434,14 +434,14 @@
435435 array_merge( $sizes, $dates ),
436436 __METHOD__
437437 );
438 -
 438+
439439 return $dbr->fetchRow( $res );
440440 }
441 -
 441+
442442 public function getNumContributionsOf( $value ) {
443443 // Get connection
444444 $dbr = efContributionReportingConnection();
445 -
 445+
446446 // Return average contribution amount
447447 $res = $dbr->select( 'public_reporting',
448448 array(
@@ -453,14 +453,14 @@
454454 ) + $this->dateConds( $dbr ),
455455 __METHOD__
456456 );
457 -
 457+
458458 return $dbr->fetchRow( $res );
459459 }
460 -
 460+
461461 public function getNumContributions() {
462462 // Get connection
463463 $dbr = efContributionReportingConnection();
464 -
 464+
465465 // Return average contribution amount
466466 return $dbr->selectField( 'public_reporting',
467467 array(
@@ -470,11 +470,11 @@
471471 __METHOD__
472472 );
473473 }
474 -
 474+
475475 public function getTotalContributions() {
476476 // Get connection
477477 $dbr = efContributionReportingConnection();
478 -
 478+
479479 // Return average contribution amount
480480 return $dbr->selectField( 'public_reporting',
481481 array(
@@ -484,7 +484,7 @@
485485 __METHOD__
486486 );
487487 }
488 -
 488+
489489 protected function dateConds( $dbr ) {
490490 return
491491 array(
@@ -492,32 +492,32 @@
493493 'received < ' . $dbr->addQuotes( wfTimestamp( TS_UNIX, $this->mEndDate ) )
494494 );
495495 }
496 -
 496+
497497 public function getCurrentFiscalYear() {
498498 global $egContributionStatisticsFiscalYearCutOff;
499 -
 499+
500500 $year = date( 'Y' );
501 -
 501+
502502 // If the cuttoff date is ahead of us in the current calendar year
503503 if ( time() < strtotime( $egContributionStatisticsFiscalYearCutOff ) ) {
504504 // Use last year
505505 $year = date( 'Y' ) - 1;
506506 }
507 -
 507+
508508 return $year;
509509 }
510 -
 510+
511511 public function evalDateRange( $startDate = null, $endDate = null ) {
512512 global $egContributionStatisticsFiscalYearCutOff;
513 -
 513+
514514 if ( $startDate !== null || $endDate !== null ) {
515515 $this->mMode = 'range';
516516 } else {
517517 $this->mMode = false;
518518 }
519 -
 519+
520520 $year = $this->getCurrentFiscalYear();
521 -
 521+
522522 // If there was no start date override
523523 if ( $startDate === null ) {
524524 // Use the fiscal year cutoff date
@@ -525,7 +525,7 @@
526526 } else {
527527 $this->mStartDate = strtotime( $startDate );
528528 }
529 -
 529+
530530 // If there was no end date override
531531 if ( $endDate === null ) {
532532 // Use the fiscal year cutoff date
@@ -533,7 +533,7 @@
534534 } else {
535535 $this->mEndDate = strtotime( $endDate );
536536 }
537 -
 537+
538538 // Catch invalid dates
539539 return !( $this->mStartDate === false || $this->mEndDate === false );
540540 }
Index: trunk/extensions/CentralAuth/specials/SpecialGlobalGroupPermissions.php
@@ -59,7 +59,7 @@
6060
6161 if ( $subpage != '' && $wgUser->matchEditToken( $wgRequest->getVal( 'wpEditToken' ) ) ) {
6262 $this->doSubmit( $subpage );
63 - } else if ( $subpage != '' ) {
 63+ } elseif ( $subpage != '' ) {
6464 $this->buildGroupView( $subpage );
6565 } else {
6666 $this->buildMainView();
@@ -189,7 +189,7 @@
190190 $desc = $wgOut->parseInline( User::getRightDescription( $right ) ) . ' ' .
191191 Xml::element( 'tt', null, wfMsg( 'parentheses', $right ) );
192192
193 - $checkbox = Xml::check( "wpRightAssigned-$right", $checked,
 193+ $checkbox = Xml::check( "wpRightAssigned-$right", $checked,
194194 array_merge( $attribs, array( 'id' => "wpRightAssigned-$right" ) ) );
195195 $label = Xml::tags( 'label', array( 'for' => "wpRightAssigned-$right" ),
196196 $desc );
@@ -249,7 +249,7 @@
250250
251251 if ( !$alreadyAssigned && $wgRequest->getCheck( "wpRightAssigned-$right" ) ) {
252252 $addRights[] = $right;
253 - } else if ( $alreadyAssigned && !$wgRequest->getCheck( "wpRightAssigned-$right" ) ) {
 253+ } elseif ( $alreadyAssigned && !$wgRequest->getCheck( "wpRightAssigned-$right" ) ) {
254254 $removeRights[] = $right;
255255 } # Otherwise, do nothing.
256256 }
Index: trunk/extensions/CentralAuth/specials/SpecialWikiSets.php
@@ -57,7 +57,7 @@
5858
5959 if ( ( $subpage || $newPage ) && $this->mCanEdit && $wgUser->matchEditToken( $wgRequest->getVal( 'wpEditToken' ) ) ) {
6060 $this->doSubmit( $subpage );
61 - } else if ( ( $subpage || $newPage ) && is_numeric( $subpage ) ) {
 61+ } elseif ( ( $subpage || $newPage ) && is_numeric( $subpage ) ) {
6262 $this->buildSetView( $subpage );
6363 } else {
6464 $this->buildMainView();
Index: trunk/extensions/ContributionTracking/ContributionTracking_body.php
@@ -31,20 +31,20 @@
3232 require_once( 'countryCodes.inc' );
3333 global $wgRequest, $wgOut, $wgContributionTrackingPayPalIPN, $wgContributionTrackingReturnToURLDefault,
3434 $wgContributionTrackingPayPalRecurringIPN, $wgContributionTrackingPayPalBusiness;
35 -
 35+
3636 if ( !preg_match( '/^[a-z-]+$/', $language ) ) {
3737 $language = 'en';
3838 }
3939 $this->lang = Language::factory( $language );
40 -
 40+
4141 $this->setHeaders();
42 -
 42+
4343 $gateway = $wgRequest->getText( 'gateway' );
4444 if( !in_array( $gateway, array( 'paypal', 'moneybookers' ) ) ) {
4545 $wgOut->showErrorPage( 'contrib-tracking-error', 'contrib-tracking-error-text' );
4646 return;
4747 }
48 -
 48+
4949 $db = contributionTrackingConnection();
5050
5151 $ts = $db->timestamp();
@@ -53,7 +53,7 @@
5454 if($owa_ref != null && !is_numeric($owa_ref)){
5555 $owa_ref = $this->get_owa_ref_id($owa_ref);
5656 }
57 -
 57+
5858 // Translate the shipping country from a code to a country name
5959 $country = '';
6060 $code = $wgRequest->getText('country2');
@@ -76,20 +76,20 @@
7777 'owa_ref' => $owa_ref,
7878 'ts' => $ts,
7979 );
80 -
 80+
8181 // Make all empty strings NULL
8282 foreach ($tracked_contribution as $key => $value) {
8383 if ($value === '') {
8484 $tracked_contribution[$key] = null;
8585 }
8686 }
87 -
 87+
8888 // Store the contribution data
8989 if ( !$wgRequest->getVal( 'contribution_tracking_id', 0 )) {
9090 $db->insert( 'contribution_tracking', $tracked_contribution );
9191 }
9292 $contribution_tracking_id = $wgRequest->getVal( 'contribution_tracking_id', $db->insertId());
93 -
 93+
9494 $returnText = $wgRequest->getText( 'returnto', "Donate-thanks/$language" );
9595 $returnTitle = Title::newFromText( $returnText );
9696 if( $returnTitle ) {
@@ -97,13 +97,13 @@
9898 } else {
9999 $returnto = $wgContributionTrackingReturnToURLDefault . "/$language";
100100 }
101 -
 101+
102102 // Set the action and tracking ID fields
103103 $repost = array();
104104 $action = 'http://wikimediafoundation.org/';
105105 $amount_field_name = 'amount'; // the amount fieldname may be different depending on the service
106106 if ( $gateway == 'paypal' ) {
107 -
 107+
108108 $action = 'https://www.paypal.com/cgi-bin/webscr';
109109
110110 // Premiums
@@ -114,25 +114,25 @@
115115 $repost['os1'] = $wgRequest->getText( 'premium_language' );
116116 $repost['no_shipping'] = 2;
117117 }
118 -
 118+
119119 // PayPal
120120 $repost['business'] = $wgContributionTrackingPayPalBusiness;
121121 $repost['item_number'] = 'DONATE';
122122 $repost['no_note'] = '0';
123123 $repost['return'] = $returnto;
124124 $repost['currency_code'] = $wgRequest->getText( 'currency_code', 'USD' );
125 -
 125+
126126 // additional fields to pass to PayPal from single-step credit card form
127127 $repost[ 'first_name' ] = $wgRequest->getText( 'fname', null );
128128 $repost[ 'last_name' ] = $wgRequest->getText( 'lname', null );
129129 $repost[ 'email' ] = $wgRequest->getText( 'email', null );
130 -
 130+
131131 // if this is a recurring donation, we have add'l fields to send to paypal
132132 if ( $wgRequest->getText( 'recurring_paypal' ) == 'true' ) {
133133 $repost[ 't3' ] = "M"; // The unit of measurement for for p3 (M = month)
134134 $repost[ 'p3' ] = '1'; // Billing cycle duration
135135 $repost[ 'srt' ] = '12'; // # of billing cycles
136 - $repost[ 'src' ] = '1'; // Make this 'recurring'
 136+ $repost[ 'src' ] = '1'; // Make this 'recurring'
137137 $repost[ 'sra' ] = '1'; // Turn on re-attempt on failure
138138 $repost[ 'cmd' ] = '_xclick-subscriptions';
139139 $amount_field_name = 'a3';
@@ -144,7 +144,7 @@
145145 $repost['item_name'] = $this->msg( 'contrib-tracking-item-name-onetime' );
146146 }
147147 }
148 - else if ( $gateway == 'moneybookers' ) {
 148+ elseif ( $gateway == 'moneybookers' ) {
149149 $action = 'https://www.moneybookers.com/app/payment.pl';
150150
151151 // Tracking
@@ -160,28 +160,28 @@
161161 } else {
162162 throw new MWException( "This shouldn't happen, we validated the gateway earlier." );
163163 }
164 -
 164+
165165 // Normalized amount
166166 $repost[ $amount_field_name ] = $wgRequest->getVal( 'amount' );
167167 if ( $wgRequest->getVal( 'amountGiven' ) ) {
168168 $repost[ $amount_field_name ] = $wgRequest->getVal( 'amountGiven' );
169169 }
170 -
 170+
171171 // Tracking
172172 $repost['custom'] = $contribution_tracking_id;
173 -
 173+
174174 $wgOut->addWikiText( "{{2009/Donate-banner/$language}}" );
175175 $wgOut->addHTML( $this->msgWiki( 'contrib-tracking-submitting' ) );
176 -
 176+
177177 // Output the repost form
178178 $output = '<form method="post" name="contributiontracking" action="' . $action . '">';
179179
180180 foreach ( $repost as $key => $value ) {
181181 $output .= '<input type="hidden" name="' . htmlspecialchars($key) . '" value="' . htmlspecialchars($value) . '" />';
182182 }
183 -
 183+
184184 $output .= $this->msgWiki( 'contrib-tracking-redirect' );
185 -
 185+
186186 // Offer a button to post the form if the user has no Javascript support
187187 $output .= '<noscript>';
188188 $output .= $this->msgWiki( 'contrib-tracking-continue' );
Index: trunk/extensions/ArticleComments/ArticleComments.php
@@ -251,7 +251,7 @@
252252 if ( $parser === $wgParser ) { # Needed since r82645. Workaround the 'Invalid marker' problem by giving a new parser to wfMsgExt().
253253 $wgParser = new StubObject( 'wgParser', $wgParserConf['class'], array( $wgParserConf ) );
254254 }
255 -
 255+
256256 # Merge in global defaults if specified
257257 $tmp = $wgArticleCommentDefaults;
258258 foreach ( $params as $k => $v ) {
@@ -309,7 +309,7 @@
310310 'ptu.getElementsByTagName("a")[0].innerHTML;};' . "\n" .
311311 'if (window.addEventListener) window.addEventListener' .
312312 '("load",prefillUserName,false);' . "\n" .
313 - 'else if (window.attachEvent) window.attachEvent' .
 313+ 'elseif (window.attachEvent) window.attachEvent' .
314314 '("onload",prefillUserName);' . "\n";
315315
316316 # Prefill comment text if it has been specified by a system message
@@ -329,7 +329,7 @@
330330 'c.value="";}}' . "\n" .
331331 'if (comment.addEventListener) comment.addEventListener' .
332332 '("focus",clearCommentOnFirstFocus,false);' . "\n" .
333 - 'else if (comment.attachEvent) comment.attachEvent' .
 333+ 'elseif (comment.attachEvent) comment.attachEvent' .
334334 '("onfocus",clearCommentOnFirstFocus);' . "\n";
335335 }
336336
Index: trunk/extensions/Collection/Collection.hooks.php
@@ -41,7 +41,7 @@
4242 static function buildNavUrls( $skin, &$navUrls ) {
4343 global $wgUser;
4444 global $wgCollectionPortletForLoggedInUsersOnly;
45 -
 45+
4646 if ( !$wgCollectionPortletForLoggedInUsersOnly || $wgUser->isLoggedIn() ) {
4747 if ( isset( $navUrls['print'] ) ) {
4848 // We move this guy out to our own box
@@ -65,7 +65,7 @@
6666 if ( is_null( $title ) || !$title->exists() ) {
6767 return;
6868 }
69 -
 69+
7070 $namespace = $title->getNamespace();
7171
7272 if ( !in_array( $namespace, $wgCollectionArticleNamespaces )
@@ -159,7 +159,7 @@
160160 Xml::element( 'a', $attribs, wfMsg( 'printableversion' ) ) );
161161 }
162162 }
163 -
 163+
164164 $out .= Xml::closeElement( 'ul' );
165165
166166 return $out;
@@ -195,7 +195,7 @@
196196 $cmd = $wgRequest->getVal( 'bookcmd', '' );
197197 if ( $cmd == 'suggest' ) {
198198 $siteNotice .= self::renderBookCreatorBox( $title, $skin, 'suggest' );
199 - } else if ( $cmd == '' ) {
 199+ } elseif ( $cmd == '' ) {
200200 $siteNotice .= self::renderBookCreatorBox( $title, $skin, 'showbook' );
201201 }
202202 return true;
@@ -231,7 +231,7 @@
232232 }
233233
234234 $wgOut->addModules( 'ext.collection.bookcreator' );
235 -
 235+
236236 $addRemoveState = $mode;
237237
238238 $html = Xml::element( 'div',
@@ -485,7 +485,7 @@
486486 }
487487 return true;
488488 }
489 -
 489+
490490 /**
491491 * ResourceLoaderGetConfigVars hook
492492 */
Index: trunk/extensions/Collection/Collection.body.php
@@ -78,7 +78,7 @@
7979 }
8080 if ( $wgRequest->getVal( 'disable' ) ) {
8181 CollectionSession::disable();
82 - } else if ( !$wgRequest->getVal( 'continue' ) ) {
 82+ } elseif ( !$wgRequest->getVal( 'continue' ) ) {
8383 $this->renderStopBookCreatorPage( $title );
8484 return;
8585 }
@@ -278,13 +278,13 @@
279279
280280 if ( $wgRequest->getVal( 'resetbans' ) ) {
281281 CollectionSuggest::run( 'resetbans' );
282 - } else if ( isset( $add ) ) {
 282+ } elseif ( isset( $add ) ) {
283283 CollectionSuggest::run( 'add', $add );
284 - } else if ( isset( $ban ) ) {
 284+ } elseif ( isset( $ban ) ) {
285285 CollectionSuggest::run( 'ban', $ban );
286 - } else if ( isset( $remove ) ) {
 286+ } elseif ( isset( $remove ) ) {
287287 CollectionSuggest::run( 'remove', $remove );
288 - } else if ( isset( $addselected ) ) {
 288+ } elseif ( isset( $addselected ) ) {
289289 $articleList = $wgRequest->getArray( 'articleList' );
290290 if ( !is_null( $articleList ) ) {
291291 CollectionSuggest::run( 'addAll', $articleList );
@@ -323,8 +323,8 @@
324324 $coll = CollectionSession::getCollection();
325325 $dialogtxt = wfMsg( 'coll-load_local_book' );
326326
327 - $wgOut->addScript(
328 - "<script type=\"$wgJsMimeType\">\n" .
 327+ $wgOut->addScript(
 328+ "<script type=\"$wgJsMimeType\">\n" .
329329 "var collection_dialogtxt = " . Xml::encodeJsVar( $dialogtxt ) . ";\n" .
330330 "</script>" );
331331
@@ -1231,7 +1231,7 @@
12321232 return array( 'error' => $errorMessage );
12331233 }
12341234 }
1235 -
 1235+
12361236 if ( !$response ) {
12371237 $wgOut->showErrorPage(
12381238 'coll-post_failed_title',
@@ -1240,10 +1240,10 @@
12411241 );
12421242 return false;
12431243 }
1244 -
 1244+
12451245 $json = new Services_JSON( SERVICES_JSON_LOOSE_TYPE );
12461246 $json_response = $json->decode( $response );
1247 -
 1247+
12481248 if ( !$json_response ) {
12491249 $wgOut->showErrorPage(
12501250 'coll-mwserve_failed_title',
@@ -1252,7 +1252,7 @@
12531253 );
12541254 return false;
12551255 }
1256 -
 1256+
12571257 if ( isset( $json_response['error'] ) && $json_response['error'] ) {
12581258 $wgOut->showErrorPage(
12591259 'coll-mwserve_failed_title',
@@ -1261,7 +1261,7 @@
12621262 );
12631263 return false;
12641264 }
1265 -
 1265+
12661266 return $json_response;
12671267 }
12681268
Index: trunk/extensions/cldr/rebuild.php
@@ -41,7 +41,7 @@
4242 } else {
4343 $codePart[$i] = '';
4444 }
45 - }
 45+ }
4646 // ISO 15924 alpha-4 script code
4747 if (strlen($codePart[1]) == 4 ) {
4848 $codePart[1] = ucfirst( $codePart[1] );
@@ -188,17 +188,17 @@
189189 $realCode = $code;
190190 if ( !strcmp( $code, 'kk' ) )
191191 $realCode = 'kk-cyrl';
192 - else if ( !strcmp( $code, 'ku' ) )
 192+ elseif ( !strcmp( $code, 'ku' ) )
193193 $realCode = 'ku-arab';
194 - else if ( !strcmp( $code, 'sr' ) )
 194+ elseif ( !strcmp( $code, 'sr' ) )
195195 $realCode = 'sr-ec';
196 - else if ( !strcmp( $code, 'tg' ) )
 196+ elseif ( !strcmp( $code, 'tg' ) )
197197 $realCode = 'tg-cyrl';
198 - else if ( !strcmp( $code, 'zh' ) )
 198+ elseif ( !strcmp( $code, 'zh' ) )
199199 $realCode = 'zh-hans';
200 - else if ( !strcmp( $code, 'pt' ) )
 200+ elseif ( !strcmp( $code, 'pt' ) )
201201 $realCode = 'pt-br';
202 - else if ( !strcmp( $code, 'pt-pt' ) )
 202+ elseif ( !strcmp( $code, 'pt-pt' ) )
203203 $realCode = 'pt';
204204 return $realCode;
205205 }
Index: trunk/extensions/CodeReview/ui/CodeRevisionAuthorLink.php
@@ -81,7 +81,7 @@
8282 '</div>'
8383 );
8484 // Unlink an author to a wiki users
85 - } else if ( $wgRequest->getVal( 'unlink' ) ) {
 85+ } elseif ( $wgRequest->getVal( 'unlink' ) ) {
8686 if ( !$this->mUser ) {
8787 $wgOut->addHTML( wfMsg( 'code-author-orphan' ) );
8888 return;
Index: trunk/extensions/CodeReview/ui/CodeRevisionCommitter.php
@@ -123,12 +123,12 @@
124124 $wgUser->getName(), $this->mRev->getIdStringUnique(), $this->mRev->getOldStatus(),
125125 $this->mRev->getStatus(), $url, $this->text, $this->mRev->getMessage()
126126 );
127 - } else if ( $statusChanged ) {
 127+ } elseif ( $statusChanged ) {
128128 $this->mRev->emailNotifyUsersOfChanges( 'codereview-email-subj3', 'codereview-email-body3',
129129 $wgUser->getName(), $this->mRev->getIdStringUnique(), $this->mRev->getOldStatus(),
130130 $this->mRev->getStatus(), $url, $this->mRev->getMessage()
131131 );
132 - } else if ( $commentAdded ) {
 132+ } elseif ( $commentAdded ) {
133133 $this->mRev->emailNotifyUsersOfChanges( 'codereview-email-subj', 'codereview-email-body',
134134 $wgUser->getName(), $url, $this->mRev->getIdStringUnique(), $this->text,
135135 $this->mRev->getMessage()
Index: trunk/extensions/CodeReview/ui/CodeRevisionView.php
@@ -514,7 +514,7 @@
515515 );" );
516516 return wfMsg( 'code-load-diff' );
517517 }
518 -
 518+
519519 /**
520520 * Format the sign-offs table
521521 * @param $signOffs array
@@ -652,7 +652,7 @@
653653 $line .= wfMsgHtml( 'code-status-' . $change->removed );
654654 $line .= $change->added ? "&#160;" : ""; // spacing
655655 // Tag changes
656 - } else if ( $change->attrib == 'tags' ) {
 656+ } elseif ( $change->attrib == 'tags' ) {
657657 $line .= htmlspecialchars( $change->removed );
658658 $line .= $change->added ? "&#160;" : ""; // spacing
659659 }
@@ -850,7 +850,7 @@
851851 ) ) .
852852 ' ' . Xml::label( wfMsg( "code-signoff-flag-$flag" ), "wpSignoffFlags-$flag" ) . ' ';
853853 }
854 - return "<tr class='mw-codereview-signoffbuttons'><td colspan='4'>$strikeButton " .
 854+ return "<tr class='mw-codereview-signoffbuttons'><td colspan='4'>$strikeButton " .
855855 "<div class='mw-codereview-signoffchecks'>$signoffText $checks $signoffButton</div></td></tr>";
856856 }
857857
Index: trunk/extensions/CodeReview/ui/CodeReleaseNotes.php
@@ -99,7 +99,7 @@
100100 if ( preg_match( '/(^|\n) ?\*/', $summary ) ) {
101101 $blurbs = explode( '*', $summary );
102102 # Double newlines separate importance generally
103 - } else if ( strpos( $summary, "\n\n" ) !== false ) {
 103+ } elseif ( strpos( $summary, "\n\n" ) !== false ) {
104104 $blurbs = explode( "\n\n", $summary );
105105 } else {
106106 return trim( $summary );
@@ -121,7 +121,7 @@
122122 if ( $header && $first && count( $summary ) == 0 ) {
123123 $summary[] = $this->shortenSummary( $blurb, true );
124124 # Is this bit important? Does it mention a revision?
125 - } else if ( $this->isRelevant( $blurb ) || preg_match( '/\br(\d+)\b/', $blurb ) ) {
 125+ } elseif ( $this->isRelevant( $blurb ) || preg_match( '/\br(\d+)\b/', $blurb ) ) {
126126 $bit = $this->shortenSummary( $blurb, false );
127127 if ( $bit ) $summary[] = $bit;
128128 }
Index: trunk/extensions/CommunityVoice/Modules/Ratings.php
@@ -10,7 +10,7 @@
1111 ) {
1212 if ( floor( $rating ) > $star ) {
1313 return 6;
14 - } else if ( floor( $rating ) < $star ) {
 14+ } elseif ( floor( $rating ) < $star ) {
1515 return 0;
1616 } else {
1717 return round( ( 6 / 10 ) * ( ( $rating - floor( $rating ) ) * 10 ) );
Index: trunk/extensions/DataCenter/UI/Widgets/History.php
@@ -193,7 +193,7 @@
194194 $label = DataCenterUI::message(
195195 'field', strtr( $field, '_', '-' )
196196 );
197 - } else if ( $group == 'meta' ) {
 197+ } elseif ( $group == 'meta' ) {
198198 $metaField = DataCenterDB::getMetaField( $field );
199199 $label = $metaField->get( 'name' );
200200 }
Index: trunk/extensions/DataCenter/UI/Widgets/Table.php
@@ -153,7 +153,7 @@
154154 // Glues values together
155155 $value = implode( $options['glue'], $values );
156156 // Alternatively checks if a field was specified
157 - } else if ( $options['field'] ) {
 157+ } elseif ( $options['field'] ) {
158158 // Uses specified field
159159 $value = DataCenterUI::format(
160160 $row->get( $options['field'] ), $options['format']
Index: trunk/extensions/ArrayExtension/ArrayExtension.php
@@ -2,7 +2,7 @@
33
44 /**
55 * Initialization file for the ArrayExtension extension.
6 - *
 6+ *
77 * Documentation: http://www.mediawiki.org/wiki/Extension:ArrayExtension
88 * Support http://www.mediawiki.org/wiki/Extension_talk:ArrayExtension
99 * Source code: http://svn.wikimedia.org/viewvc/mediawiki/trunk/extensions/ArrayExtension
@@ -101,7 +101,7 @@
102102
103103 if ( !$this->is_non_empty( $value ) ) {
104104 $this->mArrayExtension[$arrayid] = array();
105 - } else if ( !$this->is_non_empty( $delimiter ) ) {
 105+ } elseif ( !$this->is_non_empty( $delimiter ) ) {
106106 $this->mArrayExtension[$arrayid] = array( $value );
107107 } else {
108108 if ( !$this->isValidRegEx( $delimiter ) ) {
@@ -124,9 +124,9 @@
125125 if ( trim( $value ) == '' ) {
126126 unset( $this->mArrayExtension[$arrayid][$key] );
127127 }
128 - }
 128+ }
129129 }
130 -
 130+
131131 // make it unique if option is set
132132 if ( array_key_exists( 'unique', $ary_option ) ) {
133133 $this->arrayunique( $parser, $arrayid );
@@ -139,7 +139,7 @@
140140 if ( strcmp( 'list', $this->get_array_value( $ary_option, 'print' ) ) === 0 ) {
141141 return $this->arrayprint( $parser, $arrayid );
142142 }
143 - else if ( strcmp( 'full', $this->get_array_value( $ary_option, 'print' ) ) === 0 ) {
 143+ elseif ( strcmp( 'full', $this->get_array_value( $ary_option, 'print' ) ) === 0 ) {
144144 return $this->arrayprint( $parser, $arrayid, $delimiter2, $search, $subject, $frame );
145145 }
146146 }
Index: trunk/extensions/ContactPageFundraiser/SpecialContact.php
@@ -51,7 +51,7 @@
5252 $form['url'] = $wgRequest->getVal('url');
5353 $form['country'] = $wgRequest->getVal('country');
5454 $form['citytown'] = $wgRequest->getVal('city-town');
55 - $form['provstat'] = $wgRequest->getVal('prov-state');
 55+ $form['provstat'] = $wgRequest->getVal('prov-state');
5656 $form['story'] = $wgRequest->getVal('story');
5757 $form['followup'] = $wgRequest->getVal('follow-up');
5858
@@ -81,7 +81,7 @@
8282 if ( "success" == $action ) {
8383 wfDebug( "$fname: success.\n" );
8484 $f->showSuccess( );
85 - } else if ( "submit" == $action && $wgRequest->wasPosted() && $f->hasAllInfo() ) {
 85+ } elseif ( "submit" == $action && $wgRequest->wasPosted() && $f->hasAllInfo() ) {
8686 $token = $wgRequest->getVal( 'wpEditToken' );
8787
8888 if( $wgUser->isAnon() ) {
@@ -96,7 +96,7 @@
9797 wfDebug( "$fname: bad token (".($wgUser->isAnon()?'anon':'user')."): $token\n" );
9898 $wgOut->addWikiText( wfMsg( 'sessionfailure' ) );
9999 $f->showForm();
100 - } else if ( !$f->passCaptcha() ) {
 100+ } elseif ( !$f->passCaptcha() ) {
101101 wfDebug( "$fname: captcha failed" );
102102 $wgOut->addWikiText( wfMsg( 'contactpage-captcha-failed' ) ); //TODO: provide a message for this!
103103 $f->showForm();
@@ -147,7 +147,7 @@
148148 $captcha->action = 'contact';
149149 }
150150 }
151 -
 151+
152152 function setText( $text ) {
153153 $this->text = $text;
154154 }
@@ -255,7 +255,7 @@
256256
257257 function getCaptcha() {
258258 global $wgCaptcha;
259 - if ( !$this->useCaptcha() ) return "";
 259+ if ( !$this->useCaptcha() ) return "";
260260
261261 wfSetupSession(); #NOTE: make sure we have a session. May be required for captchas to work.
262262
@@ -290,7 +290,7 @@
291291 if ( !$this->fromaddress ) {
292292 $from = new MailAddress( $csender, $cname );
293293 }
294 - else if ( $wgUserEmailUseReplyTo ) {
 294+ elseif ( $wgUserEmailUseReplyTo ) {
295295 $from = new MailAddress( $csender, $cname );
296296 $replyto = new MailAddress( $this->fromaddress, $this->fromname );
297297 }
@@ -307,7 +307,7 @@
308308 if ( $this->fromname !== "" ) {
309309 $subject = wfMsgForContent( "contactpage-subject-and-sender", $subject, $this->fromname );
310310 }
311 - else if ( $this->fromaddress !== "" ) {
 311+ elseif ( $this->fromaddress !== "" ) {
312312 $subject = wfMsgForContent( "contactpage-subject-and-sender", $subject, $this->fromaddress );
313313 }
314314
Index: trunk/extensions/DataTransclusion/WebDataTransclusionSource.php
@@ -22,9 +22,9 @@
2323 * WebDataTransclusionSource accepts some additional options
2424 *
2525 * * $spec['url']: base URL for building urls for retrieving individual records.
26 - * If the URL contains placeholders of the form {xxx}, these get replaced
 26+ * If the URL contains placeholders of the form {xxx}, these get replaced
2727 * by the respective key or option values.
28 - * Otherwise, the key/value pair and options get appended to the URL as a
 28+ * Otherwise, the key/value pair and options get appended to the URL as a
2929 * regular URL parameter (preceeded by ? or &, as appropriate). For more
3030 * complex rules for building the url, override getRecordURL(). REQUIRED.
3131 * * $spec['dataFormat']: Serialization format returned from the web service.
@@ -33,12 +33,12 @@
3434 * 'xml' is supported, but requires a transformer that can handle an XML DOM
3535 * as input. To support more formats, override decodeData(). Default is 'php'.
3636 * * $spec['dataPath']: "path" to the actual data in the structure returned from the
37 - * HTTP request. This is only used if no transformer is set. The syntax of the
38 - * path is the one defined for the dataPath parameter for the FlattenRecord
 37+ * HTTP request. This is only used if no transformer is set. The syntax of the
 38+ * path is the one defined for the dataPath parameter for the FlattenRecord
3939 * transformer. REQUIRED if no transformer is defined.
4040 * * $spec['errorPath']: "path" to error messages in the structure returned from the
41 - * HTTP request. This is only used if no transformer is set. The syntax of the
42 - * path is the one defined for the dataPath parameter for the FlattenRecord
 41+ * HTTP request. This is only used if no transformer is set. The syntax of the
 42+ * path is the one defined for the dataPath parameter for the FlattenRecord
4343 * transformer. REQUIRED if no transformer is defined.
4444 * * $spec['httpOptions']: array of options to pass to Http::get. For details, see Http::request.
4545 * * $spec['timeout']: seconds before the request times out. If not given,
@@ -78,28 +78,28 @@
7979 }
8080
8181 public function fetchRawRecord( $field, $value, $options = null ) {
82 - $raw = $this->loadRecordData( $field, $value, $options );
 82+ $raw = $this->loadRecordData( $field, $value, $options );
8383 if ( !$raw ) {
8484 wfDebugLog( 'DataTransclusion', "failed to fetch data for $field=$value\n" );
85 - return false;
 85+ return false;
8686 }
8787
88 - $data = $this->decodeData( $raw, $this->dataFormat );
 88+ $data = $this->decodeData( $raw, $this->dataFormat );
8989 if ( !$data ) {
9090 wfDebugLog( 'DataTransclusion', "failed to decode data for $field=$value as {$this->dataFormat}\n" );
91 - return false;
 91+ return false;
9292 }
9393
94 - $err = $this->extractError( $data );
 94+ $err = $this->extractError( $data );
9595 if ( $err ) {
9696 wfDebugLog( 'DataTransclusion', "error message when fetching $field=$value: $err\n" );
97 - return false;
 97+ return false;
9898 }
9999
100 - $rec = $this->extractRecord( $data );
 100+ $rec = $this->extractRecord( $data );
101101 if ( !$rec ) {
102102 wfDebugLog( 'DataTransclusion', "no record found in data for $field=$value\n" );
103 - return false;
 103+ return false;
104104 }
105105
106106 wfDebugLog( 'DataTransclusion', "loaded record for $field=$value from URL\n" );
@@ -113,7 +113,7 @@
114114
115115 if ( $options ) {
116116 $args = array_merge( $options, $args );
117 - }
 117+ }
118118
119119 foreach ( $args as $k => $v ) {
120120 $u = str_replace( '{'.$k.'}', urlencode( $v ), $u, $n );
@@ -149,7 +149,7 @@
150150 if ( preg_match( '!^https?://!', $u ) ) {
151151 $raw = Http::get( $u, $this->timeout, $this->httpOptions );
152152 } else {
153 - $raw = file_get_contents( $u );
 153+ $raw = file_get_contents( $u );
154154 }
155155
156156 if ( $raw ) {
@@ -167,13 +167,13 @@
168168 }
169169
170170 if ( $format == 'json' || $format == 'js' ) {
171 - return DataTransclusionSource::decodeJson( $raw );
172 - } else if ( $format == 'wddx' ) {
173 - return DataTransclusionSource::decodeWddx( $raw );
174 - } else if ( $format == 'xml' ) {
175 - return DataTransclusionSource::parseXml( $raw );
176 - } else if ( $format == 'php' || $format == 'pser' ) {
177 - return DataTransclusionSource::decodeSerialized( $raw );
 171+ return DataTransclusionSource::decodeJson( $raw );
 172+ } elseif ( $format == 'wddx' ) {
 173+ return DataTransclusionSource::decodeWddx( $raw );
 174+ } elseif ( $format == 'xml' ) {
 175+ return DataTransclusionSource::parseXml( $raw );
 176+ } elseif ( $format == 'php' || $format == 'pser' ) {
 177+ return DataTransclusionSource::decodeSerialized( $raw );
178178 }
179179
180180 return false;
Index: trunk/extensions/DataTransclusion/DataTransclusionSource.php
@@ -38,11 +38,11 @@
3939 * may allow different hints for each field. The following hints are known per
4040 * default:
4141 * * $spec['fieldInfo'][$field]['type']: specifies the data types for the field:
42 - * 'int' for integers, 'float' or 'decimal' for decimals, or 'string' for
 42+ * 'int' for integers, 'float' or 'decimal' for decimals, or 'string' for
4343 * string fields. Serialization types 'json', 'wddx' and 'php' are also
4444 * supported. Defaults to 'string'.
4545 * * $spec['fieldInfo'][$field]['normalization']: normalization to be applied for
46 - * this field, when used as a query key. This may be a callable, or an object
 46+ * this field, when used as a query key. This may be a callable, or an object
4747 * that supports the function normalize(), or a regular expression for patterns
4848 * to be removed from the value.
4949 * * $spec['cacheDuration']: the number of seconds a result from this source
@@ -61,10 +61,10 @@
6262 * class forces $spec['sourceInfo']['source-name'] = $spec['name'].
6363 * * $spec['transformer']: a record transformer specification. This may be an
6464 * instance of RecordTransformer, or an associative array specifying a
65 - * record transformer which can then be created using
66 - * RecordTransformer::newRecordTransformer. In that case,
 65+ * record transformer which can then be created using
 66+ * RecordTransformer::newRecordTransformer. In that case,
6767 * $spec['transformer']['class'] must be the class name of the desired
68 - * RecordTransformer implementation. Other entries in that array are
 68+ * RecordTransformer implementation. Other entries in that array are
6969 * specific to the individual transformers.
7070 *
7171 * Options used by DataTransclusionHandler but ignored by DataTransclusionSource:
@@ -108,14 +108,14 @@
109109
110110 if ( isset( $spec[ 'fieldNames' ] ) ) {
111111 $this->fieldNames = self::splitList( $spec[ 'fieldNames' ] );
112 - } else if ( isset( $spec[ 'fieldInfo' ] ) ) {
 112+ } elseif ( isset( $spec[ 'fieldInfo' ] ) ) {
113113 $this->fieldNames = array_keys( $spec[ 'fieldInfo' ] );
114114 } else {
115115 $this->fieldNames = $this->keyFields;
116116
117117 if ( !empty( $this->fieldInfo ) ) {
118118 $this->fieldNames = array_merge( $this->fieldNames, array_keys( $this->fieldInfo ) );
119 - }
 119+ }
120120
121121 $this->fieldNames = array_unique( $this->fieldNames );
122122 }
@@ -149,7 +149,7 @@
150150
151151 public function normalize( $key, $value, $norm = null ) {
152152 if ( $norm );
153 - else if ( isset( $this->fieldInfo[ $key ]['normalization'] ) ) {
 153+ elseif ( isset( $this->fieldInfo[ $key ]['normalization'] ) ) {
154154 $norm = trim( $this->fieldInfo[ $key ]['normalization'] );
155155 } else {
156156 return $value;
@@ -157,9 +157,9 @@
158158
159159 if ( is_object( $norm ) ) {
160160 return $norm->normalize( $value );
161 - } else if ( is_callable( $norm ) || preg_match( '/^(\w[\w\d]*::)?(\w[\w\d]*)$/', $norm ) ) {
 161+ } elseif ( is_callable( $norm ) || preg_match( '/^(\w[\w\d]*::)?(\w[\w\d]*)$/', $norm ) ) {
162162 return call_user_func( $norm, $value );
163 - } else if ( is_array( $norm ) ) {
 163+ } elseif ( is_array( $norm ) ) {
164164 return preg_replace( $norm[0], $norm[1], $value );
165165 } else {
166166 return preg_replace( $norm, '', $value );
@@ -168,24 +168,24 @@
169169
170170 public function convert( $key, $value, $format = null ) {
171171 if ( $format );
172 - else if ( isset( $this->fieldInfo[ $key ]['type'] ) ) {
 172+ elseif ( isset( $this->fieldInfo[ $key ]['type'] ) ) {
173173 $format = strtolower( trim( $this->fieldInfo[ $key ]['type'] ) );
174174 } else {
175175 return (string)$value;
176176 }
177 -
 177+
178178 if ( $format == 'int' ) {
179179 return (int)$value;
180 - } else if ( $format == 'decimal' || $format == 'float' ) {
 180+ } elseif ( $format == 'decimal' || $format == 'float' ) {
181181 return (float)$value;
182 - } else if ( $format == 'json' || $format == 'js' ) {
183 - return DataTransclusionSource::decodeJson( $value );
184 - } else if ( $format == 'wddx' ) {
185 - return DataTransclusionSource::decodeWddx( $value );
186 - } else if ( $format == 'xml' ) {
 182+ } elseif ( $format == 'json' || $format == 'js' ) {
 183+ return DataTransclusionSource::decodeJson( $value );
 184+ } elseif ( $format == 'wddx' ) {
 185+ return DataTransclusionSource::decodeWddx( $value );
 186+ } elseif ( $format == 'xml' ) {
187187 return DataTransclusionSource::parseXml( $value ); #WARNING: returns DOM
188 - } else if ( $format == 'php' || $format == 'pser' ) {
189 - return DataTransclusionSource::decodeSerialized( $value );
 188+ } elseif ( $format == 'php' || $format == 'pser' ) {
 189+ return DataTransclusionSource::decodeSerialized( $value );
190190 } else {
191191 return (string)$value;
192192 }
@@ -220,7 +220,7 @@
221221
222222 public function fetchRecord( $field, $value, $options = null ) {
223223 $value = $this->normalize( $field, $value );
224 - $value = $this->convert( $field, $value );
 224+ $value = $this->convert( $field, $value );
225225
226226 $rec = $this->fetchRawRecord( $field, $value, $options );
227227
@@ -232,16 +232,16 @@
233233 }
234234
235235 public static function decodeSerialized( $raw ) {
236 - return unserialize( $raw );
 236+ return unserialize( $raw );
237237 }
238238
239239 public static function decodeJson( $raw ) {
240240 $raw = preg_replace( '/^\s*(var\s)?\w([\w\d]*)\s+=\s*|\s*;\s*$/sim', '', $raw);
241 - return FormatJson::decode( $raw, true );
 241+ return FormatJson::decode( $raw, true );
242242 }
243243
244244 public static function decodeWddx( $raw ) {
245 - return wddx_unserialize( $raw );
 245+ return wddx_unserialize( $raw );
246246 }
247247
248248 public static function parseXml( $raw ) {
@@ -249,7 +249,7 @@
250250 $dom->loadXML( $raw );
251251
252252 #NOTE: returns a DOM, RecordTransformer must be aware!
253 - return $dom->documentElement;
 253+ return $dom->documentElement;
254254 }
255255 }
256256
@@ -302,30 +302,30 @@
303303
304304 public function fetchRecord( $field, $value, $options = null ) {
305305 global $wgDBname, $wgUser;
306 -
 306+
307307 $k = "$field=$value";
308308 if ( $options ) {
309309 $k .= "&" . sha1( var_export( $options, false ) );
310310 }
311311
312312 $cacheKey = "$wgDBname:DataTransclusion(" . $this->getName() . ":$k)";
313 -
 313+
314314 $rec = $this->cache->get( $cacheKey );
315 -
 315+
316316 if ( !$rec ) {
317317 wfDebugLog( 'DataTransclusion', "fetching fresh record for $field=$value\n" );
318318 $rec = $this->source->fetchRecord( $field, $value, $options );
319 -
 319+
320320 if ( $rec ) { // XXX: also cache negatives??
321321 $duration = $this->getCacheDuration();
322 -
 322+
323323 wfDebugLog( 'DataTransclusion', "caching record for $field=$value for $duration sec\n" );
324 - $this->cache->set( $cacheKey, $rec, $duration ) ;
 324+ $this->cache->set( $cacheKey, $rec, $duration ) ;
325325 }
326326 } else {
327327 wfDebugLog( 'DataTransclusion', "using cached record for $field=$value\n" );
328328 }
329 -
 329+
330330 return $rec;
331331 }
332332 }
Index: trunk/extensions/DataTransclusion/MAB2RecordTransformer.php
@@ -63,7 +63,7 @@
6464 * No configuration options are needed.
6565 */
6666 class MAB2RecordTransformer extends RecordTransformer {
67 -
 67+
6868 /**
6969 * Initializes the RecordTransformer from the given parameter array.
7070 * @param $spec associative array of options. See class-level documentation for details.
@@ -113,14 +113,14 @@
114114
115115 foreach ($r as $f => $values) {
116116 if ( count($values) == 0 ) unset( $r[ $f ] );
117 - else if ( count($values) == 1 ) $r[ $f ] = MAB2RecordTransformer::mangleValue( $values[0] );
 117+ elseif ( count($values) == 1 ) $r[ $f ] = MAB2RecordTransformer::mangleValue( $values[0] );
118118 else {
119119 $values = array_unique( $values );
120120 $values = array_map( array('MAB2RecordTransformer', 'mangleValue'), $values );
121121 $r[ $f ] = join(', ', $values);
122122 }
123123 }
124 -
 124+
125125 return $r;
126126 }
127127
@@ -134,9 +134,9 @@
135135 }
136136
137137 /**
138 - * Extracts any error message from the $data from the data source. This is done
 138+ * Extracts any error message from the $data from the data source. This is done
139139 * by calling resolvePath() on the $spec['errorPath'] provided to the constructor.
140 - *
 140+ *
141141 * @param $rec a structured data response, as received from the data source
142142 */
143143 public function extractError( $data ) {
@@ -154,9 +154,9 @@
155155 }
156156
157157 /**
158 - * Extracts the actual data record from the $data from the data source. This is done
 158+ * Extracts the actual data record from the $data from the data source. This is done
159159 * by calling resolvePath() on the $spec['dataPath'] provided to the constructor.
160 - *
 160+ *
161161 * @param $rec a structured data response, as received from the data source
162162 */
163163 public function extractRecord( $data ) {
Index: trunk/extensions/DataTransclusion/DataTransclusionHandler.php
@@ -99,7 +99,7 @@
100100 if ( empty( $argv['source'] ) ) {
101101 if ( empty( $argv[1] ) ) {
102102 wfDebugLog( 'DataTransclusion', "no source specified\n" );
103 - return DataTransclusionHandler::errorMessage( 'datatransclusion-missing-source', $asHTML );
 103+ return DataTransclusionHandler::errorMessage( 'datatransclusion-missing-source', $asHTML );
104104 } else {
105105 $sourceName = $argv[1];
106106 }
@@ -110,20 +110,20 @@
111111 $source = DataTransclusionHandler::getDataSource( $sourceName );
112112 if ( empty( $source ) ) {
113113 wfDebugLog( 'DataTransclusion', "unknown source: $sourceName\n" );
114 - return DataTransclusionHandler::errorMessage( 'datatransclusion-unknown-source', $asHTML, $sourceName );
 114+ return DataTransclusionHandler::errorMessage( 'datatransclusion-unknown-source', $asHTML, $sourceName );
115115 }
116116
117117 // find out how to render the record
118118 if ( !empty( $argv['template'] ) ) {
119119 $template = $argv['template'];
120 - } else if ( $template === null || $template === false ) {
 120+ } elseif ( $template === null || $template === false ) {
121121 if ( empty( $argv[0] ) ) {
122122 wfDebugLog( 'DataTransclusion', "missing 'template' argument\n" );
123 - return DataTransclusionHandler::errorMessage( 'datatransclusion-missing-argument-template', $asHTML );
 123+ return DataTransclusionHandler::errorMessage( 'datatransclusion-missing-argument-template', $asHTML );
124124 } else {
125125 $template = $argv[0];
126126 }
127 - }
 127+ }
128128
129129 // find key
130130 $by = false;
@@ -140,8 +140,8 @@
141141 if ( !$by ) {
142142 global $wgContLang;
143143 wfDebugLog( 'DataTransclusion', "no key specified\n" );
144 - return DataTransclusionHandler::errorMessage( 'datatransclusion-missing-key', $asHTML, $sourceName,
145 - $wgContLang->commaList( $keyFields ), count( $keyFields ) );
 144+ return DataTransclusionHandler::errorMessage( 'datatransclusion-missing-key', $asHTML, $sourceName,
 145+ $wgContLang->commaList( $keyFields ), count( $keyFields ) );
146146 }
147147
148148 // collect options
@@ -159,17 +159,17 @@
160160 $record = $source->fetchRecord( $by, $key, $options );
161161 if ( empty( $record ) ) {
162162 wfDebugLog( 'DataTransclusion', "no record found matching $by=$key in $sourceName\n" );
163 - return DataTransclusionHandler::errorMessage( 'datatransclusion-record-not-found', $asHTML, $sourceName, $by, $key );
 163+ return DataTransclusionHandler::errorMessage( 'datatransclusion-record-not-found', $asHTML, $sourceName, $by, $key );
164164 }
165165
166166 // render the record into wiki text
167167 if ( $template === "#dump" ) {
168 - $t = null;
 168+ $t = null;
169169 } else {
170170 $t = Title::newFromText( $template, NS_TEMPLATE );
171171 if ( empty( $t ) ) {
172172 wfDebugLog( 'DataTransclusion', "illegal template name: $template\n" );
173 - return DataTransclusionHandler::errorMessage( 'datatransclusion-bad-template-name', $asHTML, $template );
 173+ return DataTransclusionHandler::errorMessage( 'datatransclusion-bad-template-name', $asHTML, $template );
174174 }
175175 }
176176
@@ -180,7 +180,7 @@
181181
182182 if ( $text === false ) {
183183 wfDebugLog( 'DataTransclusion', "template not found: $template\n" );
184 - return DataTransclusionHandler::errorMessage( 'datatransclusion-unknown-template', $asHTML, $template );
 184+ return DataTransclusionHandler::errorMessage( 'datatransclusion-unknown-template', $asHTML, $template );
185185 }
186186
187187 // set parser output expiry
@@ -191,9 +191,9 @@
192192
193193 if ( $asHTML && $parser ) { // render into HTML if desired
194194 $html = $parser->recursiveTagParse( $text );
195 - return $html;
 195+ return $html;
196196 } else {
197 - return $text;
 197+ return $text;
198198 }
199199 }
200200
@@ -217,9 +217,9 @@
218218 $this->templateText .= "| $k || {{{{$k}}}}\n";
219219 }
220220 $this->templateText .= "|}\n";
221 - }
 221+ }
222222
223 - if ( $this->templateText ) {
 223+ if ( $this->templateText ) {
224224 // explicit template content set. Used for testing and debugging.
225225 if ( is_string( $this->templateText ) ) {
226226 $text = $this->templateText;
@@ -236,7 +236,7 @@
237237 $article = new Article( $this->template );
238238
239239 if ( !$article->exists() ) {
240 - return false;
 240+ return false;
241241 }
242242
243243 $text = $article->getContent();
@@ -244,7 +244,7 @@
245245 //NOTE: would need extra work to record template inclusion to be recorded in the ParserOutput and consequently in the database.
246246 */
247247
248 - // NOTE: braceSubstitution caches pre-parsed templates. Much nicer.
 248+ // NOTE: braceSubstitution caches pre-parsed templates. Much nicer.
249249 // TODO: but how to check if the template exists? calling $article->exists() every time is slow.
250250 // once we test for that agin, re-enable the test case for the datatransclusion-unknown-template failure mode
251251 $frame = $this->parser->getPreprocessor()->newFrame( );
@@ -268,9 +268,9 @@
269269 function normalizeRecord( $record, $args ) {
270270 $rec = array();
271271
272 - // add source meta info, so we can render links back to the source,
 272+ // add source meta info, so we can render links back to the source,
273273 // provide license info, etc
274 - $info = $this->source->getSourceInfo();
 274+ $info = $this->source->getSourceInfo();
275275 foreach ( $info as $f => $v ) {
276276 if ( is_array( $v ) || is_object( $v ) || is_resource( $v ) ) {
277277 continue;
@@ -299,7 +299,7 @@
300300 $v = '';
301301 }
302302
303 - $rec[ $f ] = $this->sanitizeValue( $v );
 303+ $rec[ $f ] = $this->sanitizeValue( $v );
304304 }
305305
306306 return $rec;
@@ -378,7 +378,7 @@
379379 if ( !is_object( $source ) ) {
380380 throw new MWException( "\$wgDataTransclusionSources['$name'] must be an array or an object." );
381381 }
382 -
 382+
383383 return $source;
384384 }
385385
Index: trunk/extensions/DataTransclusion/ImportMAB2.php
@@ -55,7 +55,7 @@
5656 $sql = "CREATE TABLE IF NOT EXISTS " . $this->index_table . " ( ";
5757 $sql .= " field VARCHAR(255) NOT NULL, "; #FIXME: varchar vs varbinary!
5858 $sql .= " value VARCHAR(255) NOT NULL, "; #FIXME: varchar vs varbinary!
59 - $sql .= " data_id INT(12) NOT NULL, ";
 59+ $sql .= " data_id INT(12) NOT NULL, ";
6060 $sql .= " PRIMARY KEY (field, value, data_id) "; #NOTE: we don't require (field,value) to be unique!
6161 $sql .= ") ";
6262 $db->query( $sql, __METHOD__ );
@@ -122,7 +122,7 @@
123123 if ( $this->hasOption('create') ) {
124124 $this->output( "creating tables if neccessary.\n" );
125125 $this->createTables( $this->blob_table, $this->index_table );
126 - }
 126+ }
127127
128128 if ( $this->hasOption('truncate') ) {
129129 $this->output( "truncating tables.\n" );
@@ -179,7 +179,7 @@
180180 if ( is_dir( $dir . $file ) && $recursive ) {
181181 $this->importDir( $dir . $file, $recursive, $limit );
182182 continue;
183 - } else if ( !is_file( $dir . $file ) ) {
 183+ } elseif ( !is_file( $dir . $file ) ) {
184184 $this->output( "not a file: $dir/$file\n" );
185185 continue;
186186 }
@@ -188,7 +188,7 @@
189189
190190 if ( !$ok ) {
191191 $this->output( "error processing $file\n" );
192 - }
 192+ }
193193
194194 if ( $limit > 0 ) {
195195 $limit -= 1;
@@ -245,7 +245,7 @@
246246 $insert = array();
247247 foreach ( $ids as $field => $values ) {
248248 foreach ( $values as $v ) {
249 - $insert[] = array(
 249+ $insert[] = array(
250250 'field' => $field,
251251 'value' => $v,
252252 'data_id' => $id );
@@ -283,7 +283,7 @@
284284
285285 if ( $this->debug ) {
286286 print "== $file =======================\n";
287 - } else if ( $this->multiRecord ) {
 287+ } elseif ( $this->multiRecord ) {
288288 $this->output( "reading records from $file\n" );
289289 }
290290
Index: trunk/extensions/DataTransclusion/tests/DataTransclusionTest.php
@@ -4,24 +4,24 @@
55 echo( "This file cannot be run from the web.\n" );
66 die( 1 );
77 }
8 -
 8+
99 if ( getenv( 'MW_INSTALL_PATH' ) ) {
1010 $IP = getenv( 'MW_INSTALL_PATH' );
1111 } else {
1212 $dir = dirname( __FILE__ );
13 -
 13+
1414 if ( file_exists( "$dir/../../LocalSettings.php" ) ) $IP = "$dir/../..";
15 - else if ( file_exists( "$dir/../../../LocalSettings.php" ) ) $IP = "$dir/../../..";
16 - else if ( file_exists( "$dir/../../phase3/LocalSettings.php" ) ) $IP = "$dir/../../phase3";
17 - else if ( file_exists( "$dir/../../../phase3/LocalSettings.php" ) ) $IP = "$dir/../../../phase3";
 15+ elseif ( file_exists( "$dir/../../../LocalSettings.php" ) ) $IP = "$dir/../../..";
 16+ elseif ( file_exists( "$dir/../../phase3/LocalSettings.php" ) ) $IP = "$dir/../../phase3";
 17+ elseif ( file_exists( "$dir/../../../phase3/LocalSettings.php" ) ) $IP = "$dir/../../../phase3";
1818 else $IP = $dir;
1919 }
20 -
 20+
2121 require_once( "$IP/maintenance/commandLine.inc" );
22 -
 22+
2323 // requires PHPUnit 3.4
2424 require_once 'PHPUnit/Framework.php';
25 -
 25+
2626 error_reporting( E_ALL );
2727 }
2828
@@ -46,7 +46,7 @@
4747 return Parser::statelessFetchTemplate( $title, $parser );
4848 }
4949 }
50 -
 50+
5151 static function setUpBeforeClass() {
5252 global $wgTitle, $wgParser;
5353 $wgTitle = Title::newFromText( "Test" );
@@ -60,7 +60,7 @@
6161 $wgParser->clearState();
6262 $wgParser->setTitle( $wgTitle );
6363 }
64 -
 64+
6565 function testErrorMessage() {
6666 $m = DataTransclusionHandler::errorMessage( 'datatransclusion-test-wikitext', false );
6767 $this->assertEquals( '<span class="error datatransclusion-test-wikitext">some <span class="test">html</span> and \'\'markup\'\'.</span>', $m );
@@ -130,12 +130,12 @@
131131
132132 $src = DataTransclusionHandler::getDataSource( 'FOO' );
133133 $this->assertTrue( $src instanceof FakeDataTransclusionSource );
134 -
 134+
135135 $rec = $src->fetchRecord( 'id', 3 );
136136 $this->assertEquals( 3, $rec['id'] );
137137 $this->assertEquals( 'foo', $rec['name'] );
138138 $this->assertEquals( 'test 1', $rec['info'] );
139 -
 139+
140140 $rec = $src->fetchRecord( 'name', 'bar' );
141141 $this->assertEquals( 5, $rec['id'] );
142142 $this->assertEquals( 'bar', $rec['name'] );
@@ -150,12 +150,12 @@
151151 $src = DataTransclusionHandler::getDataSource( 'BAR' );
152152 $this->assertTrue( $src instanceof FakeDataTransclusionSource );
153153 $this->assertEquals( 'BAR', $src->getName() );
154 -
 154+
155155 $rec = $src->fetchRecord( 'id', 3 );
156156 $this->assertEquals( 3, $rec['id'] );
157157 $this->assertEquals( 'foo', $rec['name'] );
158158 $this->assertEquals( 'test 1', $rec['info'] );
159 -
 159+
160160 $rec = $src->fetchRecord( 'name', 'bar' );
161161 $this->assertEquals( 5, $rec['id'] );
162162 $this->assertEquals( 'bar', $rec['name'] );
@@ -177,7 +177,7 @@
178178 'fieldNames' => 'id,name,info',
179179 'defaultKey' => 'id'
180180 );
181 -
 181+
182182 $wgDataTransclusionSources[ 'FOO' ] = $spec;
183183
184184 # failure mode: no source given
@@ -219,11 +219,11 @@
220220 # success: render record
221221 $res = DataTransclusionHandler::handleRecordTransclusion( "Test", array( 'source' => 'FOO', 'id' => 3 ), $wgParser, false, "'''{{{id}}}'''|{{{name}}}|{{{info}}}" );
222222 $this->assertEquals( '\'\'\'3\'\'\'|foo|test&X', $res );
223 -
 223+
224224 # success: render record (find by name)
225225 $res = DataTransclusionHandler::handleRecordTransclusion( "Test", array( 'source' => 'FOO', 'name' => 'foo'), $wgParser, false, "'''{{{id}}}'''|{{{name}}}|{{{info}}}" );
226226 $this->assertEquals( '\'\'\'3\'\'\'|foo|test&X', $res );
227 -
 227+
228228 # success: render record (as HTML)
229229 $res = DataTransclusionHandler::handleRecordTransclusion( "Test", array( 'source' => 'FOO', 'id' => 3 ), $wgParser, true, "'''{{{id}}}'''|{{{name}}}|{{{info}}}" );
230230 $this->assertEquals( $res, '<b>3</b>|foo|test&X' ); // FIXME: & should have been escaped to &amp; here, no? why not?
@@ -240,7 +240,7 @@
241241 'fieldNames' => 'id,name,info,url,evil',
242242 'defaultKey' => 'id',
243243 );
244 -
 244+
245245 $wgDataTransclusionSources[ 'FOO' ] = $spec;
246246
247247 global $wgParser;
@@ -254,7 +254,7 @@
255255 $html = $wgParser->getOutput()->getText();
256256 $this->assertEquals( '<p>xx FOO:<b>3</b>|foo|Hallo|&lt;test&gt;&amp;&#91;&#91;X&#93;&#93;&#39;|<a href="http://test.org/" class="external text" rel="nofollow">link</a>|[javascript:alert("evil") click me] xx'."\n".'</p>', $html ); // XXX: should be more lenient wrt whitespace
257257 $templates = $wgParser->getOutput()->getTemplates();
258 - $this->assertTrue( isset( $templates[ NS_TEMPLATE ]['Test'] ) );
 258+ $this->assertTrue( isset( $templates[ NS_TEMPLATE ]['Test'] ) );
259259 }
260260
261261 function testHandleRecordTag() {
@@ -268,7 +268,7 @@
269269 'fieldNames' => 'id,name,info,url,evil',
270270 'defaultKey' => 'id'
271271 );
272 -
 272+
273273 $wgDataTransclusionSources[ 'FOO' ] = $spec;
274274
275275 global $wgParser;
@@ -279,10 +279,10 @@
280280 $text = 'xx <record source="FOO" id=3 extra="Hallo">Test</record> xx';
281281 $wgParser->parse( $text, $title, $options );
282282
283 - $html = $wgParser->getOutput()->getText();
 283+ $html = $wgParser->getOutput()->getText();
284284 $this->assertEquals( '<p>xx FOO:<b>3</b>|foo|Hallo|&lt;test&gt;&amp;&#91;&#91;X&#93;&#93;&#39;|<a href="http://test.org/" class="external text" rel="nofollow">link</a>|[javascript:alert("evil") click me] xx'."\n".'</p>', $html ); // XXX: should be more lenient wrt whitespace
285285 $templates = $wgParser->getOutput()->getTemplates();
286 - $this->assertTrue( isset( $templates[ NS_TEMPLATE ]['Test'] ) );
 286+ $this->assertTrue( isset( $templates[ NS_TEMPLATE ]['Test'] ) );
287287 }
288288
289289 function testNormalizeRecord() {
@@ -340,7 +340,7 @@
341341 'cacheDuration' => 2,
342342 'cache' => new HashBagOStuff(),
343343 );
344 -
 344+
345345 $wgDataTransclusionSources[ 'FOO' ] = $spec;
346346
347347 $src = DataTransclusionHandler::getDataSource( 'FOO' );
@@ -379,7 +379,7 @@
380380
381381 $source = new DBDataTransclusionSource( $spec );
382382 $sql = $source->getQuery( 'name', 'foo"' );
383 -
 383+
384384 $this->assertTrue( preg_match( '/^SELECT \* FROM foo/', $sql ) === 1 );
385385 $this->assertTrue( preg_match( '/GROUP BY id$/', $sql ) === 1 );
386386 $this->assertTrue( preg_match( "/WHERE \\( *name *= *'foo\\\\\"' *\\)/", $sql ) === 1 );
@@ -417,10 +417,10 @@
418418 $u = $source->getRecordURL( 'name', 'foo&bar', array( 'x' => '42', 'y' => 57 ) );
419419 $this->assertEquals( 'http://acme.com/foo%26bar?x=42&y=57', $u );
420420
421 - $rec = array(
422 - "name" => array( 'type' => 'string', 'value' => "foo" ),
423 - "id" => 3,
424 - "info" => array( 'type' => 'string', 'value' => "test X" ),
 421+ $rec = array(
 422+ "name" => array( 'type' => 'string', 'value' => "foo" ),
 423+ "id" => 3,
 424+ "info" => array( 'type' => 'string', 'value' => "test X" ),
425425 );
426426
427427 $data = array( 'response' => array(
@@ -496,11 +496,11 @@
497497
498498 if ( !defined('MW_PHPUNIT_TEST') ) {
499499 $wgShowExceptionDetails = true;
500 -
 500+
501501 DataTransclusionTest::setUpBeforeClass();
502502 $t = new DataTransclusionTest();
503503 $t->setUp();
504 -
 504+
505505 $t->testErrorMessage();
506506 $t->testSanitizeValue();
507507 $t->testNormalizeRecord();
@@ -514,6 +514,6 @@
515515 $t->testDBDataTransclusionSource();
516516 $t->testWebDataTransclusionSource();
517517 $t->testXmlDataTransclusionSource();
518 -
 518+
519519 echo "OK.\n";
520520 }
Index: trunk/extensions/DataTransclusion/tests/fetchWebData.php
@@ -10,9 +10,9 @@
1111 $dir = dirname( __FILE__ );
1212
1313 if ( file_exists( "$dir/../../LocalSettings.php" ) ) $IP = "$dir/../..";
14 - else if ( file_exists( "$dir/../../../LocalSettings.php" ) ) $IP = "$dir/../../..";
15 - else if ( file_exists( "$dir/../../phase3/LocalSettings.php" ) ) $IP = "$dir/../../phase3";
16 - else if ( file_exists( "$dir/../../../phase3/LocalSettings.php" ) ) $IP = "$dir/../../../phase3";
 14+ elseif ( file_exists( "$dir/../../../LocalSettings.php" ) ) $IP = "$dir/../../..";
 15+ elseif ( file_exists( "$dir/../../phase3/LocalSettings.php" ) ) $IP = "$dir/../../phase3";
 16+ elseif ( file_exists( "$dir/../../../phase3/LocalSettings.php" ) ) $IP = "$dir/../../../phase3";
1717 else $IP = $dir;
1818 }
1919
Index: trunk/extensions/DataTransclusion/tests/fetchRecord.php
@@ -10,9 +10,9 @@
1111 $dir = dirname( __FILE__ );
1212
1313 if ( file_exists( "$dir/../../LocalSettings.php" ) ) $IP = "$dir/../..";
14 - else if ( file_exists( "$dir/../../../LocalSettings.php" ) ) $IP = "$dir/../../..";
15 - else if ( file_exists( "$dir/../../phase3/LocalSettings.php" ) ) $IP = "$dir/../../phase3";
16 - else if ( file_exists( "$dir/../../../phase3/LocalSettings.php" ) ) $IP = "$dir/../../../phase3";
 14+ elseif ( file_exists( "$dir/../../../LocalSettings.php" ) ) $IP = "$dir/../../..";
 15+ elseif ( file_exists( "$dir/../../phase3/LocalSettings.php" ) ) $IP = "$dir/../../phase3";
 16+ elseif ( file_exists( "$dir/../../../phase3/LocalSettings.php" ) ) $IP = "$dir/../../../phase3";
1717 else $IP = $dir;
1818 }
1919
Index: trunk/extensions/APC/SpecialAPC.php
@@ -259,7 +259,7 @@
260260 list( , $ver ) = explode( ' ', $v, 2 );
261261 if ( $i < 0 && version_compare( $apcversion, $ver, '>=' ) ) {
262262 break;
263 - } else if ( !$i-- ) {
 263+ } elseif ( !$i-- ) {
264264 break;
265265 }
266266 $data = current( $match[2] );
Index: trunk/extensions/Crosswiki/Block/CrosswikiBlock.page.php
@@ -26,8 +26,8 @@
2727 global $wgOut, $wgUser, $wgRequest;
2828
2929 # Add messages
30 -
3130
 31+
3232 $this->setHeaders();
3333
3434 if ( !$wgUser->isAllowed( 'crosswikiblock' ) ) {
@@ -53,12 +53,12 @@
5454 );
5555 if ( !$blockAddress ) {
5656 $this->showForm( wfMsgWikiHtml( 'crosswikiblock-nousername' ) );
57 - } else if ( $this->checkUser( $blockAddress, true ) ) {
58 - } else if ( !( $expiry = $this->convertExpiry( $expiryStr ) ) ) {
 57+ } elseif ( $this->checkUser( $blockAddress, true ) ) {
 58+ } elseif ( !( $expiry = $this->convertExpiry( $expiryStr ) ) ) {
5959 $this->showForm( wfMsgWikiHtml( 'crosswikiblock-noexpiry', htmlspecialchars( $expiryStr ) ) );
60 - } else if ( !$reason ) {
 60+ } elseif ( !$reason ) {
6161 $this->showForm( wfMsgWikiHtml( 'crosswikiblock-noreason', htmlspecialchars( $reason ) ) );
62 - } else if ( !$wgUser->matchEditToken( $wgRequest->getVal( 'wpEditToken' ) ) ) {
 62+ } elseif ( !$wgUser->matchEditToken( $wgRequest->getVal( 'wpEditToken' ) ) ) {
6363 $this->showForm( wfMsgWikiHtml( 'crosswikiblock-notoken' ) );
6464 } else {
6565 CrosswikiBlock::normalizeOptions( $this->mUsername, $options );
Index: trunk/extensions/CategoryTree/CategoryTreeFunctions.php
@@ -48,7 +48,7 @@
4949 if ( sizeof( $this->mOptions['namespaces'] ) === 1
5050 && $this->mOptions['namespaces'][0] == NS_CATEGORY ) {
5151 $this->mOptions['mode'] = CT_MODE_CATEGORIES;
52 - } else if ( !in_array( NS_IMAGE, $this->mOptions['namespaces'] ) ) {
 52+ } elseif ( !in_array( NS_IMAGE, $this->mOptions['namespaces'] ) ) {
5353 $this->mOptions['mode'] = CT_MODE_PAGES;
5454 } else {
5555 $this->mOptions['mode'] = CT_MODE_ALL;
@@ -110,10 +110,10 @@
111111 if ( is_numeric( $mode ) ) return (int)$mode;
112112
113113 if ( $mode == 'all' ) $mode = CT_MODE_ALL;
114 - else if ( $mode == 'pages' ) $mode = CT_MODE_PAGES;
115 - else if ( $mode == 'categories' || $mode == 'sub' ) $mode = CT_MODE_CATEGORIES;
116 - else if ( $mode == 'parents' || $mode == 'super' || $mode == 'inverse' ) $mode = CT_MODE_PARENTS;
117 - else if ( $mode == 'default' ) $mode = $wgCategoryTreeDefaultOptions['mode'];
 114+ elseif ( $mode == 'pages' ) $mode = CT_MODE_PAGES;
 115+ elseif ( $mode == 'categories' || $mode == 'sub' ) $mode = CT_MODE_CATEGORIES;
 116+ elseif ( $mode == 'parents' || $mode == 'super' || $mode == 'inverse' ) $mode = CT_MODE_PARENTS;
 117+ elseif ( $mode == 'default' ) $mode = $wgCategoryTreeDefaultOptions['mode'];
118118
119119 return (int)$mode;
120120 }
@@ -131,8 +131,8 @@
132132 if ( is_numeric( $value ) ) return ( (int)$value > 0 );
133133
134134 if ( $value == 'yes' || $value == 'y' || $value == 'true' || $value == 't' || $value == 'on' ) return true;
135 - else if ( $value == 'no' || $value == 'n' || $value == 'false' || $value == 'f' || $value == 'off' ) return false;
136 - else if ( $value == 'null' || $value == 'default' || $value == 'none' || $value == 'x' ) return null;
 135+ elseif ( $value == 'no' || $value == 'n' || $value == 'false' || $value == 'f' || $value == 'off' ) return false;
 136+ elseif ( $value == 'null' || $value == 'default' || $value == 'none' || $value == 'x' ) return null;
137137 else return false;
138138 }
139139
@@ -147,12 +147,12 @@
148148 $value = trim( strtolower( $value ) );
149149
150150 if ( $value == 'yes' || $value == 'y' || $value == 'true' || $value == 't' || $value == 'on' ) return CT_HIDEPREFIX_ALWAYS;
151 - else if ( $value == 'no' || $value == 'n' || $value == 'false' || $value == 'f' || $value == 'off' ) return CT_HIDEPREFIX_NEVER;
152 - // else if ( $value == 'null' || $value == 'default' || $value == 'none' || $value == 'x' ) return $wgCategoryTreeDefaultOptions['hideprefix'];
153 - else if ( $value == 'always' ) return CT_HIDEPREFIX_ALWAYS;
154 - else if ( $value == 'never' ) return CT_HIDEPREFIX_NEVER;
155 - else if ( $value == 'auto' ) return CT_HIDEPREFIX_AUTO;
156 - else if ( $value == 'categories' || $value == 'category' || $value == 'smart' ) return CT_HIDEPREFIX_CATEGORIES;
 151+ elseif ( $value == 'no' || $value == 'n' || $value == 'false' || $value == 'f' || $value == 'off' ) return CT_HIDEPREFIX_NEVER;
 152+ // elseif ( $value == 'null' || $value == 'default' || $value == 'none' || $value == 'x' ) return $wgCategoryTreeDefaultOptions['hideprefix'];
 153+ elseif ( $value == 'always' ) return CT_HIDEPREFIX_ALWAYS;
 154+ elseif ( $value == 'never' ) return CT_HIDEPREFIX_NEVER;
 155+ elseif ( $value == 'auto' ) return CT_HIDEPREFIX_AUTO;
 156+ elseif ( $value == 'categories' || $value == 'category' || $value == 'smart' ) return CT_HIDEPREFIX_CATEGORIES;
157157 else return $wgCategoryTreeDefaultOptions['hideprefix'];
158158 }
159159
@@ -331,7 +331,7 @@
332332 if ( $html == '' ) {
333333 # HACK: Safari doesn't like empty responses.
334334 # see Bug 7219 and http://bugzilla.opendarwin.org/show_bug.cgi?id=10716
335 - $html = ' ';
 335+ $html = ' ';
336336 }
337337
338338 $response->addText( $html );
@@ -385,7 +385,7 @@
386386 else {
387387 if ( !$hideroot ) {
388388 $html .= $this->renderNode( $title, $depth, $wgCategoryTreeDynamicTag );
389 - } else if ( !$wgCategoryTreeDynamicTag ) {
 389+ } elseif ( !$wgCategoryTreeDynamicTag ) {
390390 $html .= $this->renderChildren( $title, $depth );
391391 } else {
392392 $uniq += 1;
@@ -590,9 +590,9 @@
591591
592592 if ( $hideprefix == CT_HIDEPREFIX_ALWAYS ) {
593593 $hideprefix = true;
594 - } else if ( $hideprefix == CT_HIDEPREFIX_AUTO ) {
 594+ } elseif ( $hideprefix == CT_HIDEPREFIX_AUTO ) {
595595 $hideprefix = ( $mode == CT_MODE_CATEGORIES );
596 - } else if ( $hideprefix == CT_HIDEPREFIX_CATEGORIES ) {
 596+ } elseif ( $hideprefix == CT_HIDEPREFIX_CATEGORIES ) {
597597 $hideprefix = ( $ns == NS_CATEGORY );
598598 } else {
599599 $hideprefix = true;
@@ -651,7 +651,7 @@
652652 if ( $cat ) {
653653 if ( $mode == CT_MODE_CATEGORIES ) {
654654 $count = $subcatCount;
655 - } else if ( $mode == CT_MODE_PAGES ) {
 655+ } elseif ( $mode == CT_MODE_PAGES ) {
656656 $count = $pageCount - $fileCount;
657657 } else {
658658 $count = $pageCount;
@@ -724,9 +724,9 @@
725725 $s .= Xml::openElement( 'i', array( 'class' => 'CategoryTreeNotice' ) );
726726 if ( $mode == CT_MODE_CATEGORIES ) {
727727 $s .= wfMsgExt( 'categorytree-no-subcategories', 'parsemag' );
728 - } else if ( $mode == CT_MODE_PAGES ) {
 728+ } elseif ( $mode == CT_MODE_PAGES ) {
729729 $s .= wfMsgExt( 'categorytree-no-pages', 'parsemag' );
730 - } else if ( $mode == CT_MODE_PARENTS ) {
 730+ } elseif ( $mode == CT_MODE_PARENTS ) {
731731 $s .= wfMsgExt( 'categorytree-no-parent-categories', 'parsemag' );
732732 } else {
733733 $s .= wfMsgExt( 'categorytree-nothing-found', 'parsemag' );
Index: trunk/extensions/ClientSide/ClientSide.php
@@ -235,7 +235,7 @@
236236 foreach( $functions as $name => $arguments ) {
237237 if ( is_int( $name ) ) {
238238 $jsFunctions[] = sprintf( '%s()', $arguments );
239 - } else if ( is_array( $arguments ) ) {
 239+ } elseif ( is_array( $arguments ) ) {
240240 $jsFunctions[] = sprintf(
241241 '%s(%s)', $name, implode( ',', $arguments )
242242 );
@@ -378,7 +378,7 @@
379379 return sprintf(
380380 'function(%s){%s}', implode( ',', $arguments ), $body
381381 );
382 - } else if ( $arguments !== null ) {
 382+ } elseif ( $arguments !== null ) {
383383 return sprintf( 'function(%s){%s}', $arguments, $body );
384384 } else {
385385 return sprintf( 'function(){%s}', $body );
Index: trunk/extensions/AbuseFilter/AbuseFilter.class.php
@@ -52,7 +52,7 @@
5353 'rlike' => 'rlike',
5454 'irlike' => 'irlike',
5555 'cond ? iftrue : iffalse' => 'tern',
56 - 'if cond then iftrue else iffalse end' => 'cond',
 56+ 'if cond then iftrue elseiffalse end' => 'cond',
5757 ),
5858 'funcs' => array(
5959 'length(string)' => 'length',
Index: trunk/extensions/ConfirmAccount/UserCredentials_body.php
@@ -25,7 +25,7 @@
2626
2727 if ( $this->file ) {
2828 $this->showFile( $this->file );
29 - } else if ( $this->target ) {
 29+ } elseif ( $this->target ) {
3030 $this->showForm();
3131 $this->showCredentials();
3232 } else {
Index: trunk/extensions/ConfirmAccount/ConfirmAccount.php
@@ -1,7 +1,7 @@
22 <?php
33 /*
44 (c) Aaron Schulz 2007, GPL
5 -
 5+
66 This program is free software; you can redistribute it and/or modify
77 it under the terms of the GNU General Public License as published by
88 the Free Software Foundation; either version 2 of the License, or
@@ -163,7 +163,7 @@
164164 if ( isset( $personal_urls['anonlogin'] ) ) {
165165 $personal_urls['anonlogin']['text'] = wfMsg('nav-login-createaccount');
166166 } elseif ( isset($personal_urls['login'] ) ) {
167 - $personal_urls['login']['text'] = wfMsg('nav-login-createaccount');
 167+ $personal_urls['login']['text'] = wfMsg('nav-login-createaccount');
168168 }
169169 return true;
170170 }
@@ -257,7 +257,7 @@
258258 $wgExtNewFields[] = array( 'account_requests', 'acr_areas', "$base/archives/patch-acr_areas.sql" );
259259
260260 $wgExtNewIndexes[] = array( 'account_requests', 'acr_email', "$base/archives/patch-email-index.sql" );
261 - } else if ( $wgDBtype == 'postgres' ) {
 261+ } elseif ( $wgDBtype == 'postgres' ) {
262262 $wgExtNewTables[] = array( 'account_requests', "$base/ConfirmAccount.pg.sql" );
263263
264264 $wgExtPGNewFields[] = array( 'account_requests', 'acr_held', "TIMESTAMPTZ" );
@@ -284,7 +284,7 @@
285285 $updater->addExtensionUpdate( array( 'addField', 'account_requests', 'acr_areas', "$base/archives/patch-acr_areas.sql", true ) );
286286
287287 $updater->addExtensionUpdate( array( 'addIndex', 'account_requests', 'acr_email', "$base/archives/patch-email-index.sql", true ) );
288 - } else if ( $updater->getDB()->getType() == 'postgres' ) {
 288+ } elseif ( $updater->getDB()->getType() == 'postgres' ) {
289289 $updater->addExtensionUpdate( array( 'addTable', 'account_requests', "$base/ConfirmAccount.pg.sql", true ) );
290290
291291 $updater->addExtensionUpdate( array( 'addPgField', 'account_requests', 'acr_held', "TIMESTAMPTZ" ) );
Index: trunk/extensions/ConfirmAccount/RequestAccount_body.php
@@ -24,7 +24,7 @@
2525 $wgOut->readOnlyPage();
2626 return;
2727 }
28 -
 28+
2929 $this->setHeaders();
3030
3131 $this->mRealName = trim( $wgRequest->getText( 'wpRealName' ) );
@@ -69,7 +69,7 @@
7070 if ( $wgRequest->wasPosted() && $wgUser->matchEditToken( $wgRequest->getVal( 'wpEditToken' ) ) ) {
7171 $this->mPrevAttachment = $this->mPrevAttachment ? $this->mPrevAttachment : $this->mSrcName;
7272 $this->doSubmit();
73 - } else if ( $action == 'confirmemail' ) {
 73+ } elseif ( $action == 'confirmemail' ) {
7474 $this->confirmEmailToken( $emailCode );
7575 } else {
7676 $this->showForm();
@@ -492,7 +492,7 @@
493493 global $wgOut;
494494 $wgOut->addHTML( wfMsgExt( 'acct_request_throttle_hit', 'parsemag', $limit ) );
495495 }
496 -
 496+
497497 /**
498498 * (a) Try to confirm an email address via a token
499499 * (b) Notify $wgConfirmAccountContact on success
Index: trunk/extensions/ConfirmAccount/ConfirmAccount_body.php
@@ -137,11 +137,11 @@
138138
139139 if( $wgRequest->wasPosted() && $wgUser->matchEditToken( $wgRequest->getVal( 'wpEditToken' ) ) ) {
140140 $this->doSubmit();
141 - } else if( $this->file ) {
 141+ } elseif( $this->file ) {
142142 $this->showFile( $this->file );
143 - } else if( $this->acrID ) {
 143+ } elseif( $this->acrID ) {
144144 $this->showForm();
145 - } else if( $this->queueType != -1 ) {
 145+ } elseif( $this->queueType != -1 ) {
146146 $this->showList();
147147 } else {
148148 $this->showQueues();
@@ -224,7 +224,7 @@
225225 } else {
226226 $wgOut->addHTML( "<p><i> $reason </i></p>" );
227227 }
228 - } else if( $row->acr_held ) {
 228+ } elseif( $row->acr_held ) {
229229 $datim = $wgLang->timeanddate( wfTimestamp(TS_MW, $row->acr_held), true );
230230 $date = $wgLang->date( wfTimestamp(TS_MW, $row->acr_held), true );
231231 $time = $wgLang->time( wfTimestamp(TS_MW, $row->acr_held), true );
@@ -455,7 +455,7 @@
456456 $wgMemc->delete( $key );
457457
458458 $this->showSuccess( $this->submitType );
459 - } else if( $this->submitType === 'accept' ) {
 459+ } elseif( $this->submitType === 'accept' ) {
460460 global $wgAuth, $wgConfirmAccountSaveInfo, $wgAllowAccountRequestFiles;
461461
462462 # Now create user and check if the name is valid
@@ -682,7 +682,7 @@
683683 }
684684 # Finally, done!!!
685685 $this->showSuccess( $this->submitType, $user->getName(), array( $error ) );
686 - } else if( $this->submitType === 'hold' ) {
 686+ } elseif( $this->submitType === 'hold' ) {
687687 global $wgUser;
688688
689689 # Make proxy user to email a message
@@ -694,7 +694,7 @@
695695 $error = wfMsg( 'confirmaccount-canthold' );
696696 $this->showForm( $error );
697697 return false;
698 - } else if( !$this->reason ) {
 698+ } elseif( !$this->reason ) {
699699 $error = wfMsg( 'confirmaccount-needreason' );
700700 $this->showForm( $error );
701701 return false;
@@ -809,7 +809,7 @@
810810 $wgOut->setPagetitle( wfMsgHtml('actioncomplete') );
811811 if( $this->submitType == 'accept' ) {
812812 $wgOut->addWikiMsg( 'confirmaccount-acc', $name );
813 - } else if( $this->submitType == 'reject' || $this->submitType == 'spam' ) {
 813+ } elseif( $this->submitType == 'reject' || $this->submitType == 'spam' ) {
814814 $wgOut->addWikiMsg( 'confirmaccount-rej' );
815815 } else {
816816 $wgOut->redirect( $titleObj->getFullUrl() );
@@ -835,7 +835,7 @@
836836 if( $pager->getNumRows() ) {
837837 if( $this->showStale ) {
838838 $wgOut->addHTML( wfMsgExt('confirmaccount-list3', array('parse') ) );
839 - } else if( $this->showRejects ) {
 839+ } elseif( $this->showRejects ) {
840840 $wgOut->addHTML( wfMsgExt('confirmaccount-list2', array('parse') ) );
841841 } else {
842842 $wgOut->addHTML( wfMsgExt('confirmaccount-list', array('parse') ) );
@@ -846,9 +846,9 @@
847847 } else {
848848 if( $this->showRejects ) {
849849 $wgOut->addHTML( wfMsgExt('confirmaccount-none-r', array('parse')) );
850 - } else if( $this->showStale ) {
 850+ } elseif( $this->showStale ) {
851851 $wgOut->addHTML( wfMsgExt('confirmaccount-none-e', array('parse')) );
852 - } else if( $this->showHeld ) {
 852+ } elseif( $this->showHeld ) {
853853 $wgOut->addHTML( wfMsgExt('confirmaccount-none-h', array('parse')) );
854854 } else {
855855 $wgOut->addHTML( wfMsgExt('confirmaccount-none-o', array('parse')) );
@@ -928,7 +928,7 @@
929929 $date = $wgLang->date( wfTimestamp(TS_MW, $row->acr_rejected), true );
930930 $time = $wgLang->time( wfTimestamp(TS_MW, $row->acr_rejected), true );
931931 $r .= ' <b>'.wfMsgExt( 'confirmaccount-reject', array('parseinline'), $row->user_name, $datim, $date, $time ).'</b>';
932 - } else if( $row->acr_held && !$row->acr_rejected ) {
 932+ } elseif( $row->acr_held && !$row->acr_rejected ) {
933933 $datim = $wgLang->timeanddate( wfTimestamp(TS_MW, $row->acr_held), true );
934934 $date = $wgLang->date( wfTimestamp(TS_MW, $row->acr_held), true );
935935 $time = $wgLang->time( wfTimestamp(TS_MW, $row->acr_held), true );
@@ -1034,7 +1034,7 @@
10351035 # Stale requests have a user ID of zero
10361036 if( $this->stale ) {
10371037 $conds[] = 'acr_user = 0';
1038 - } else if( $this->rejects ) {
 1038+ } elseif( $this->rejects ) {
10391039 $conds[] = 'acr_user != 0';
10401040 $tables[] = 'user';
10411041 $conds[] = 'acr_user = user_id';

Follow-up revisions

RevisionCommit summaryAuthorDate
r102697MFT r45856, r71558, r71962, r73304, r73309, r75671, r75680, r75726, r76542, r...awjrichards22:02, 10 November 2011

Status & tagging log