Index: trunk/phase3/maintenance/tests/phpunit/includes/UploadFromUrlTest.php |
— | — | @@ -133,7 +133,6 @@ |
134 | 134 | $this->assertTrue( $exception, "Got exception" ); |
135 | 135 | |
136 | 136 | self::$user->addGroup( 'sysop' ); |
137 | | - $exception = false; |
138 | 137 | $data = $this->doApiRequest( array( |
139 | 138 | 'action' => 'upload', |
140 | 139 | 'url' => 'http://bits.wikimedia.org/skins-1.5/common/images/poweredby_mediawiki_88x31.png', |
Index: trunk/phase3/maintenance/tests/phpunit/includes/api/RandomImageGenerator.php |
— | — | @@ -203,6 +203,7 @@ |
204 | 204 | $args[] = $filename; |
205 | 205 | |
206 | 206 | $command = wfEscapeShellArg( $wgImageMagickConvertCommand ) . " " . implode( " ", $args ); |
| 207 | + $retval = null; |
207 | 208 | $output = wfShellExec( $command, $retval ); |
208 | 209 | return ( $retval === 0 ); |
209 | 210 | } |
Index: trunk/phase3/maintenance/tests/phpunit/includes/api/ApiUploadTest.php |
— | — | @@ -306,7 +306,6 @@ |
307 | 307 | global $wgUser; |
308 | 308 | $wgUser = self::$users['uploader']->user; |
309 | 309 | |
310 | | - $extension = 'png'; |
311 | 310 | $mimeType = 'image/png'; |
312 | 311 | |
313 | 312 | $filePath = tempnam( wfTempDir(), "" ); |
— | — | @@ -617,7 +616,7 @@ |
618 | 617 | $hash = File::sha1Base36( $filePath ); |
619 | 618 | $dupes = RepoGroup::singleton()->findBySha1( $hash ); |
620 | 619 | $success = true; |
621 | | - foreach ( $dupes as $key => $dupe ) { |
| 620 | + foreach ( $dupes as $dupe ) { |
622 | 621 | $success &= $this->deleteFileByTitle( $dupe->getTitle() ); |
623 | 622 | } |
624 | 623 | return $success; |
Index: trunk/phase3/maintenance/populateCategory.php |
— | — | @@ -66,7 +66,6 @@ |
67 | 67 | |
68 | 68 | $maxlag = intval( $maxlag ); |
69 | 69 | $throttle = intval( $throttle ); |
70 | | - $force = (bool)$force; |
71 | 70 | if ( $begin !== '' ) { |
72 | 71 | $where = 'cl_to > ' . $dbw->addQuotes( $begin ); |
73 | 72 | } else { |
Index: trunk/phase3/maintenance/reassignEdits.php |
— | — | @@ -108,7 +108,7 @@ |
109 | 109 | # Update recent changes if required |
110 | 110 | if ( $rc ) { |
111 | 111 | $this->output( "Updating recent changes..." ); |
112 | | - $res = $dbw->update( 'recentchanges', $this->userSpecification( $to, 'rc_user', 'rc_user_text' ), $this->userConditions( $from, 'rc_user', 'rc_user_text' ), __METHOD__ ); |
| 112 | + $dbw->update( 'recentchanges', $this->userSpecification( $to, 'rc_user', 'rc_user_text' ), $this->userConditions( $from, 'rc_user', 'rc_user_text' ), __METHOD__ ); |
113 | 113 | $this->output( "done.\n" ); |
114 | 114 | } |
115 | 115 | } |
Index: trunk/phase3/maintenance/orphans.php |
— | — | @@ -165,7 +165,6 @@ |
166 | 166 | $dbw = wfGetDB( DB_MASTER ); |
167 | 167 | $page = $dbw->tableName( 'page' ); |
168 | 168 | $revision = $dbw->tableName( 'revision' ); |
169 | | - $text = $dbw->tableName( 'text' ); |
170 | 169 | |
171 | 170 | if ( $fix ) { |
172 | 171 | $dbw->lockTables( $dbw, 'text', __METHOD__ ); |
Index: trunk/phase3/maintenance/dumpTextPass.php |
— | — | @@ -263,7 +263,6 @@ |
264 | 264 | while ( true ) { |
265 | 265 | try { |
266 | 266 | $text = $this->getTextDb( $id ); |
267 | | - $ex = new MWException( "Graceful storage failure" ); |
268 | 267 | } catch ( DBQueryError $ex ) { |
269 | 268 | $text = false; |
270 | 269 | } |
Index: trunk/phase3/includes/upload/UploadBase.php |
— | — | @@ -340,7 +340,7 @@ |
341 | 341 | protected function verifyFile() { |
342 | 342 | # get the title, even though we are doing nothing with it, because |
343 | 343 | # we need to populate mFinalExtension |
344 | | - $nt = $this->getTitle(); |
| 344 | + $this->getTitle(); |
345 | 345 | |
346 | 346 | $this->mFileProps = File::getPropsFromPath( $this->mTempPath, $this->mFinalExtension ); |
347 | 347 | $this->checkMacBinary(); |
Index: trunk/phase3/includes/diff/WikiDiff.php |
— | — | @@ -313,7 +313,7 @@ |
314 | 314 | } |
315 | 315 | $matches = $ymatches[$line]; |
316 | 316 | reset($matches); |
317 | | - while ( list( $junk, $y ) = each( $matches ) ) { |
| 317 | + while ( list( , $y ) = each( $matches ) ) { |
318 | 318 | if ( empty( $this->in_seq[$y] ) ) { |
319 | 319 | $k = $this->_lcs_pos( $y ); |
320 | 320 | assert( $k > 0 ); |
— | — | @@ -321,7 +321,7 @@ |
322 | 322 | break; |
323 | 323 | } |
324 | 324 | } |
325 | | - while (list ( /* $junk */, $y) = each($matches)) { |
| 325 | + while (list ( , $y) = each($matches)) { |
326 | 326 | if ($y > $this->seq[$k-1]) { |
327 | 327 | assert($y < $this->seq[$k]); |
328 | 328 | // Optimization: this is a common case: |
Index: trunk/phase3/includes/Article.php |
— | — | @@ -1473,7 +1473,6 @@ |
1474 | 1474 | global $wgOut; |
1475 | 1475 | |
1476 | 1476 | $oldid = $this->getOldID(); |
1477 | | - $useParserCache = $this->useParserCache( $oldid ); |
1478 | 1477 | $parserOptions = $this->getParserOptions(); |
1479 | 1478 | |
1480 | 1479 | # Render printable version, use printable version cache |
Index: trunk/phase3/includes/MimeMagic.php |
— | — | @@ -826,7 +826,7 @@ |
827 | 827 | $m = trim( $m ); |
828 | 828 | $m = strtolower( $m ); |
829 | 829 | |
830 | | - if ( strpos( $m, 'unknown' ) !== false ) { |
| 830 | + if ( strpos( $m, 'unknown' ) === false ) { |
831 | 831 | $m = null; |
832 | 832 | } else { |
833 | 833 | wfDebug( __METHOD__.": magic mime type of $file: $m\n" ); |
Index: trunk/phase3/includes/parser/LinkHolderArray.php |
— | — | @@ -159,7 +159,6 @@ |
160 | 160 | $current = null; |
161 | 161 | foreach ( $this->internals as $ns => $entries ) { |
162 | 162 | foreach ( $entries as $index => $entry ) { |
163 | | - $key = "$ns:$index"; |
164 | 163 | $title = $entry['title']; |
165 | 164 | $pdbk = $entry['pdbk']; |
166 | 165 | |
Index: trunk/phase3/includes/parser/Parser.php |
— | — | @@ -789,7 +789,6 @@ |
790 | 790 | wfProfileIn( __METHOD__ ); |
791 | 791 | |
792 | 792 | $lines = StringUtils::explode( "\n", $text ); |
793 | | - $text = null; |
794 | 793 | $out = ''; |
795 | 794 | $td_history = array(); # Is currently a td tag open? |
796 | 795 | $last_tag_history = array(); # Save history of last lag activated (td, th or caption) |
Index: trunk/phase3/includes/parser/Preprocessor_DOM.php |
— | — | @@ -511,9 +511,7 @@ |
512 | 512 | // another heading. Infinite loops are avoided because the next iteration MUST |
513 | 513 | // hit the heading open case above, which unconditionally increments the |
514 | 514 | // input pointer. |
515 | | - } |
516 | | - |
517 | | - elseif ( $found == 'open' ) { |
| 515 | + } elseif ( $found == 'open' ) { |
518 | 516 | # count opening brace characters |
519 | 517 | $count = strspn( $text, $curChar, $i ); |
520 | 518 | |
— | — | @@ -536,9 +534,7 @@ |
537 | 535 | $accum .= htmlspecialchars( str_repeat( $curChar, $count ) ); |
538 | 536 | } |
539 | 537 | $i += $count; |
540 | | - } |
541 | | - |
542 | | - elseif ( $found == 'close' ) { |
| 538 | + } elseif ( $found == 'close' ) { |
543 | 539 | $piece = $stack->top; |
544 | 540 | # lets check if there are enough characters for closing brace |
545 | 541 | $maxCount = $piece->count; |
— | — | @@ -961,7 +957,9 @@ |
962 | 958 | $iteratorStack[$level] = false; |
963 | 959 | } |
964 | 960 | |
965 | | - if ( $contextNode instanceof PPNode_DOM ) $contextNode = $contextNode->node; |
| 961 | + if ( $contextNode instanceof PPNode_DOM ) { |
| 962 | + $contextNode = $contextNode->node; |
| 963 | + } |
966 | 964 | |
967 | 965 | $newIterator = false; |
968 | 966 | |
Index: trunk/phase3/includes/ImagePage.php |
— | — | @@ -327,8 +327,6 @@ |
328 | 328 | $height_orig = $this->displayImg->getHeight( $page ); |
329 | 329 | $height = $height_orig; |
330 | 330 | |
331 | | - $showLink = false; |
332 | | - $linkAttribs = array( 'href' => $full_url ); |
333 | 331 | $longDesc = $this->displayImg->getLongDesc(); |
334 | 332 | |
335 | 333 | wfRunHooks( 'ImageOpenShowImageInlineBefore', array( &$this, &$wgOut ) ); |
— | — | @@ -1002,6 +1000,7 @@ |
1003 | 1001 | } |
1004 | 1002 | $row .= '</td>'; |
1005 | 1003 | |
| 1004 | + $rowClass = null; |
1006 | 1005 | wfRunHooks( 'ImagePageFileHistoryLine', array( $this, $file, &$row, &$rowClass ) ); |
1007 | 1006 | $classAttr = $rowClass ? " class='$rowClass'" : ""; |
1008 | 1007 | |
Index: trunk/phase3/includes/db/DatabasePostgres.php |
— | — | @@ -751,7 +751,6 @@ |
752 | 752 | return true; |
753 | 753 | } |
754 | 754 | return false; |
755 | | - |
756 | 755 | } |
757 | 756 | |
758 | 757 | /** |
Index: trunk/phase3/includes/db/DatabaseIbm_db2.php |
— | — | @@ -1249,11 +1249,9 @@ |
1250 | 1250 | $join_conds ); |
1251 | 1251 | |
1252 | 1252 | // We must adjust for offset |
1253 | | - if ( isset( $options['LIMIT'] ) ) { |
1254 | | - if ( isset ( $options['OFFSET'] ) ) { |
1255 | | - $limit = $options['LIMIT']; |
1256 | | - $offset = $options['OFFSET']; |
1257 | | - } |
| 1253 | + if ( isset( $options['LIMIT'] ) && isset ( $options['OFFSET'] ) ) { |
| 1254 | + $limit = $options['LIMIT']; |
| 1255 | + $offset = $options['OFFSET']; |
1258 | 1256 | } |
1259 | 1257 | |
1260 | 1258 | // DB2 does not have a proper num_rows() function yet, so we must emulate |
Index: trunk/phase3/includes/db/DatabaseMssql.php |
— | — | @@ -552,9 +552,9 @@ |
553 | 553 | */ |
554 | 554 | function nextSequenceValue( $seqName ) { |
555 | 555 | if ( !$this->tableExists( 'sequence_' . $seqName ) ) { |
556 | | - $ret = sqlsrv_query( $this->mConn, "CREATE TABLE [sequence_$seqName] (id INT NOT NULL IDENTITY PRIMARY KEY, junk varchar(10) NULL)" ); |
| 556 | + sqlsrv_query( $this->mConn, "CREATE TABLE [sequence_$seqName] (id INT NOT NULL IDENTITY PRIMARY KEY, junk varchar(10) NULL)" ); |
557 | 557 | } |
558 | | - $ret = sqlsrv_query( $this->mConn, "INSERT INTO [sequence_$seqName] (junk) VALUES ('')" ); |
| 558 | + sqlsrv_query( $this->mConn, "INSERT INTO [sequence_$seqName] (junk) VALUES ('')" ); |
559 | 559 | $ret = sqlsrv_query( $this->mConn, "SELECT TOP 1 id FROM [sequence_$seqName] ORDER BY id DESC" ); |
560 | 560 | $row = sqlsrv_fetch_array( $ret, SQLSRV_FETCH_ASSOC );// KEEP ASSOC THERE, weird weird bug dealing with the return value if you don't |
561 | 561 | |
Index: trunk/phase3/includes/WatchlistEditor.php |
— | — | @@ -347,7 +347,8 @@ |
348 | 348 | */ |
349 | 349 | private function showNormalForm( $output, $user ) { |
350 | 350 | global $wgUser; |
351 | | - if( ( $count = $this->showItemCount( $output, $user ) ) > 0 ) { |
| 351 | + $count = $this->showItemCount( $output, $user ); |
| 352 | + if( $count > 0 ) { |
352 | 353 | $self = SpecialPage::getTitleFor( 'Watchlist' ); |
353 | 354 | $form = Xml::openElement( 'form', array( 'method' => 'post', |
354 | 355 | 'action' => $self->getLocalUrl( array( 'action' => 'edit' ) ) ) ); |
Index: trunk/phase3/includes/EditPage.php |
— | — | @@ -2229,7 +2229,9 @@ |
2230 | 2230 | |
2231 | 2231 | $script = ''; |
2232 | 2232 | foreach ( $toolarray as $tool ) { |
2233 | | - if ( !$tool ) continue; |
| 2233 | + if ( !$tool ) { |
| 2234 | + continue; |
| 2235 | + } |
2234 | 2236 | |
2235 | 2237 | $params = array( |
2236 | 2238 | $image = $wgStylePath . '/common/images/' . $tool['image'], |
Index: trunk/phase3/includes/OutputPage.php |
— | — | @@ -563,11 +563,6 @@ |
564 | 564 | $nameWithTags = Sanitizer::normalizeCharReferences( Sanitizer::removeHTMLtags( $name ) ); |
565 | 565 | $this->mPagetitle = $nameWithTags; |
566 | 566 | |
567 | | - $taction = $this->getPageTitleActionText(); |
568 | | - if( !empty( $taction ) ) { |
569 | | - $name .= ' - '.$taction; |
570 | | - } |
571 | | - |
572 | 567 | # change "<i>foo&bar</i>" to "foo&bar" |
573 | 568 | $this->setHTMLTitle( wfMsg( 'pagetitle', Sanitizer::stripAllTags( $nameWithTags ) ) ); |
574 | 569 | } |
Index: trunk/phase3/includes/HistoryPage.php |
— | — | @@ -529,7 +529,9 @@ |
530 | 530 | $rev->isDeleted( Revision::DELETED_RESTRICTED ), false ); |
531 | 531 | } |
532 | 532 | } |
533 | | - if( $del ) $s .= " $del "; |
| 533 | + if( $del ) { |
| 534 | + $s .= " $del "; |
| 535 | + } |
534 | 536 | |
535 | 537 | $s .= " $link"; |
536 | 538 | $s .= " <span class='history-user'>" . |
Index: trunk/phase3/includes/installer/MysqlUpdater.php |
— | — | @@ -355,7 +355,7 @@ |
356 | 356 | $prev_namespace = $row->cur_namespace; |
357 | 357 | } |
358 | 358 | $sql = "DELETE FROM $cur WHERE cur_id IN ( " . join( ',', $deleteId ) . ')'; |
359 | | - $rows = $this->db->query( $sql, __METHOD__ ); |
| 359 | + $this->db->query( $sql, __METHOD__ ); |
360 | 360 | $this->output( wfTimestamp( TS_DB ) ); |
361 | 361 | $this->output( "......<b>Deleted</b> " . $this->db->affectedRows() . " records.\n" ); |
362 | 362 | } |
Index: trunk/phase3/includes/installer/DatabaseInstaller.php |
— | — | @@ -395,7 +395,6 @@ |
396 | 396 | * Set this to false to show a creation checkbox. |
397 | 397 | */ |
398 | 398 | public function getWebUserBox( $noCreateMsg = false ) { |
399 | | - $name = $this->getName(); |
400 | 399 | $s = Html::openElement( 'fieldset' ) . |
401 | 400 | Html::element( 'legend', array(), wfMsg( 'config-db-web-account' ) ) . |
402 | 401 | $this->getCheckBox( |
Index: trunk/phase3/includes/installer/MysqlInstaller.php |
— | — | @@ -366,7 +366,7 @@ |
367 | 367 | if ( !$create ) { |
368 | 368 | // Test the web account |
369 | 369 | try { |
370 | | - $webConn = new Database( |
| 370 | + new Database( |
371 | 371 | $this->getVar( 'wgDBserver' ), |
372 | 372 | $this->getVar( 'wgDBuser' ), |
373 | 373 | $this->getVar( 'wgDBpassword' ), |
Index: trunk/phase3/includes/installer/OracleInstaller.php |
— | — | @@ -39,7 +39,6 @@ |
40 | 40 | } |
41 | 41 | |
42 | 42 | public function getWebUserBox( $noCreateMsg = false ) { |
43 | | - $name = $this->getName(); |
44 | 43 | $this->parent->setVar( '_SameAccount', false ); |
45 | 44 | $this->parent->setVar( '_CreateDBAccount', true ); |
46 | 45 | $this->parent->setVar( 'wgDBname', '' ); |
Index: trunk/phase3/includes/media/SVG.php |
— | — | @@ -150,7 +150,6 @@ |
151 | 151 | } |
152 | 152 | |
153 | 153 | function getMetadata( $file, $filename ) { |
154 | | - $metadata = array(); |
155 | 154 | try { |
156 | 155 | $metadata = SVGMetadataExtractor::getMetadata( $filename ); |
157 | 156 | } catch( Exception $e ) { |
Index: trunk/phase3/includes/ChangesList.php |
— | — | @@ -1055,7 +1055,7 @@ |
1056 | 1056 | # Extract fields from DB into the function scope (rc_xxxx variables) |
1057 | 1057 | // FIXME: Would be good to replace this extract() call with something |
1058 | 1058 | // that explicitly initializes variables. |
1059 | | - $classes = array(); // TODO implement |
| 1059 | + // TODO implement |
1060 | 1060 | extract( $rcObj->mAttribs ); |
1061 | 1061 | $query['curid'] = $rc_cur_id; |
1062 | 1062 | |
Index: trunk/phase3/includes/Title.php |
— | — | @@ -3302,7 +3302,6 @@ |
3303 | 3303 | # Truncate for whole multibyte characters. +5 bytes for ellipsis |
3304 | 3304 | $comment = $wgContLang->truncate( $comment, 250 ); |
3305 | 3305 | |
3306 | | - $newid = $nt->getArticleID(); |
3307 | 3306 | $oldid = $this->getArticleID(); |
3308 | 3307 | $latest = $this->getLatestRevId(); |
3309 | 3308 | |
Index: trunk/phase3/includes/ConfEditor.php |
— | — | @@ -536,7 +536,7 @@ |
537 | 537 | |
538 | 538 | switch ( $state ) { |
539 | 539 | case 'file': |
540 | | - $token = $this->expect( T_OPEN_TAG ); |
| 540 | + $this->expect( T_OPEN_TAG ); |
541 | 541 | $token = $this->skipSpace(); |
542 | 542 | if ( $token->isEnd() ) { |
543 | 543 | break 2; |
Index: trunk/phase3/includes/SkinTemplate.php |
— | — | @@ -358,7 +358,6 @@ |
359 | 359 | |
360 | 360 | if( $wgPageShowWatchingUsers ) { |
361 | 361 | $dbr = wfGetDB( DB_SLAVE ); |
362 | | - $watchlist = $dbr->tableName( 'watchlist' ); |
363 | 362 | $res = $dbr->select( 'watchlist', |
364 | 363 | array( 'COUNT(*) AS n' ), |
365 | 364 | array( 'wl_title' => $dbr->strencode( $this->mTitle->getDBkey() ), 'wl_namespace' => $this->mTitle->getNamespace() ), |
Index: trunk/phase3/includes/specials/SpecialComparePages.php |
— | — | @@ -97,7 +97,6 @@ |
98 | 98 | $this->form(); |
99 | 99 | |
100 | 100 | if( $this->opts->getValue( 'rev1' ) && $this->opts->getValue( 'rev2' ) ) { |
101 | | - $title = Title::newFromText( $this->opts->getValue( 'page2' ) ); |
102 | 101 | $de = new DifferenceEngine( null, |
103 | 102 | $this->opts->getValue( 'rev1' ), |
104 | 103 | $this->opts->getValue( 'rev2' ), |
Index: trunk/phase3/includes/specials/SpecialUserlogin.php |
— | — | @@ -176,7 +176,6 @@ |
177 | 177 | $wgOut->addWikiMsg( 'accmailtext', $u->getName(), $u->getEmail() ); |
178 | 178 | $wgOut->returnToMain( false ); |
179 | 179 | } |
180 | | - $u = 0; |
181 | 180 | } |
182 | 181 | |
183 | 182 | /** |
— | — | @@ -620,7 +619,7 @@ |
621 | 620 | } |
622 | 621 | |
623 | 622 | wfDebug( __METHOD__ . ": creating account\n" ); |
624 | | - $user = $this->initUser( $user, true ); |
| 623 | + $this->initUser( $user, true ); |
625 | 624 | return self::SUCCESS; |
626 | 625 | } |
627 | 626 | |
Index: trunk/phase3/includes/specials/SpecialSearch.php |
— | — | @@ -342,9 +342,9 @@ |
343 | 343 | global $wgOut; |
344 | 344 | // Figure out the active search profile header |
345 | 345 | $nsAllSet = array_keys( SearchEngine::searchableNamespaces() ); |
346 | | - if( $this->searchAdvanced ) |
| 346 | + if( $this->searchAdvanced ) { |
347 | 347 | $this->active = 'advanced'; |
348 | | - else { |
| 348 | + } else { |
349 | 349 | $profiles = $this->getSearchProfiles(); |
350 | 350 | |
351 | 351 | foreach( $profiles as $key => $data ) { |
— | — | @@ -416,7 +416,6 @@ |
417 | 417 | if( !is_null($infoLine) ) { |
418 | 418 | $out .= "\n<!-- {$infoLine} -->\n"; |
419 | 419 | } |
420 | | - $off = $this->offset + 1; |
421 | 420 | $out .= "<ul class='mw-search-results'>\n"; |
422 | 421 | while( $result = $matches->next() ) { |
423 | 422 | $out .= $this->showHit( $result, $terms ); |
— | — | @@ -623,7 +622,6 @@ |
624 | 623 | |
625 | 624 | $out = "<div id='mw-search-interwiki'><div id='mw-search-interwiki-caption'>". |
626 | 625 | wfMsg('search-interwiki-caption')."</div>\n"; |
627 | | - $off = $this->offset + 1; |
628 | 626 | $out .= "<ul class='mw-search-iwresults'>\n"; |
629 | 627 | |
630 | 628 | // work out custom project captions |