Index: trunk/phase3/tests/phpunit/includes/search/SearchEngineTest.php |
— | — | @@ -85,7 +85,6 @@ |
86 | 86 | * @param $n Integer: unused |
87 | 87 | */ |
88 | 88 | function insertPage( $pageName, $text, $ns ) { |
89 | | - $dbw = $this->db; |
90 | 89 | $title = Title::newFromText( $pageName ); |
91 | 90 | |
92 | 91 | $user = User::newFromName( 'WikiSysop' ); |
Index: trunk/phase3/includes/upload/UploadStash.php |
— | — | @@ -91,8 +91,6 @@ |
92 | 92 | } |
93 | 93 | } |
94 | 94 | |
95 | | - $dbr = $this->repo->getSlaveDb(); |
96 | | - |
97 | 95 | if ( !isset( $this->fileMetadata[$key] ) ) { |
98 | 96 | if ( !$this->fetchFileMetadata( $key ) ) { |
99 | 97 | // If nothing was received, it's likely due to replication lag. Check the master to see if the record is there. |
— | — | @@ -188,7 +186,7 @@ |
189 | 187 | $usec = substr($usec, 2); |
190 | 188 | $key = wfBaseConvert( $sec . $usec, 10, 36 ) . '.' . |
191 | 189 | wfBaseConvert( mt_rand(), 10, 36 ) . '.'. |
192 | | - $this->userId . '.' . |
| 190 | + $this->userId . '.' . |
193 | 191 | $extension; |
194 | 192 | |
195 | 193 | $this->fileProps[$key] = $fileProps; |
Index: trunk/phase3/includes/diff/WikiDiff3.php |
— | — | @@ -546,9 +546,12 @@ |
547 | 547 | } |
548 | 548 | |
549 | 549 | // return the middle diagonal with maximal progress. |
550 | | - return $max_progress[floor( $num_progress / 2 )]; |
| 550 | + return $max_progress[(int)floor( $num_progress / 2 )]; |
551 | 551 | } |
552 | 552 | |
| 553 | + /** |
| 554 | + * @return mixed |
| 555 | + */ |
553 | 556 | public function getLcsLength() { |
554 | 557 | if ( $this->heuristicUsed && !$this->lcsLengthCorrectedForHeuristic ) { |
555 | 558 | $this->lcsLengthCorrectedForHeuristic = true; |
Index: trunk/phase3/includes/json/Services_JSON.php |
— | — | @@ -136,7 +136,7 @@ |
137 | 137 | { |
138 | 138 | $this->use = $use; |
139 | 139 | } |
140 | | - |
| 140 | + |
141 | 141 | private static $mHavePear = null; |
142 | 142 | /** |
143 | 143 | * Returns cached result of class_exists('pear'), to avoid calling AutoLoader numerous times |
— | — | @@ -872,7 +872,7 @@ |
873 | 873 | { |
874 | 874 | $this->message = $message; |
875 | 875 | } |
876 | | - |
| 876 | + |
877 | 877 | function __toString() |
878 | 878 | { |
879 | 879 | return $this->message; |
Index: trunk/phase3/includes/Article.php |
— | — | @@ -86,6 +86,7 @@ |
87 | 87 | /** |
88 | 88 | * Constructor from a page id |
89 | 89 | * @param $id Int article ID to load |
| 90 | + * @return Article|null |
90 | 91 | */ |
91 | 92 | public static function newFromID( $id ) { |
92 | 93 | $t = Title::newFromID( $id ); |
— | — | @@ -1008,6 +1009,7 @@ |
1009 | 1010 | |
1010 | 1011 | /** |
1011 | 1012 | * Execute the uncached parse for action=view |
| 1013 | + * @return bool |
1012 | 1014 | */ |
1013 | 1015 | public function doViewParse() { |
1014 | 1016 | global $wgOut; |
Index: trunk/phase3/includes/RecentChange.php |
— | — | @@ -58,12 +58,20 @@ |
59 | 59 | |
60 | 60 | # Factory methods |
61 | 61 | |
| 62 | + /** |
| 63 | + * @param $row |
| 64 | + * @return RecentChange |
| 65 | + */ |
62 | 66 | public static function newFromRow( $row ) { |
63 | 67 | $rc = new RecentChange; |
64 | 68 | $rc->loadFromRow( $row ); |
65 | 69 | return $rc; |
66 | 70 | } |
67 | 71 | |
| 72 | + /** |
| 73 | + * @staticw |
| 74 | + * @return RecentChange |
| 75 | + */ |
68 | 76 | public static function newFromCurRow( $row ) { |
69 | 77 | $rc = new RecentChange; |
70 | 78 | $rc->loadFromCurRow( $row ); |
— | — | @@ -137,6 +145,9 @@ |
138 | 146 | return $this->mTitle; |
139 | 147 | } |
140 | 148 | |
| 149 | + /** |
| 150 | + * @return bool|\Title |
| 151 | + */ |
141 | 152 | public function getMovedToTitle() { |
142 | 153 | if( $this->mMovedToTitle === false ) { |
143 | 154 | $this->mMovedToTitle = Title::makeTitle( $this->mAttribs['rc_moved_to_ns'], |
— | — | @@ -145,7 +156,9 @@ |
146 | 157 | return $this->mMovedToTitle; |
147 | 158 | } |
148 | 159 | |
149 | | - # Writes the data in this object to the database |
| 160 | + /** |
| 161 | + * Writes the data in this object to the database |
| 162 | + */ |
150 | 163 | public function save() { |
151 | 164 | global $wgLocalInterwiki, $wgPutIPinRC, $wgRC2UDPAddress, $wgRC2UDPOmitBots; |
152 | 165 | $fname = 'RecentChange::save'; |
— | — | @@ -180,7 +193,7 @@ |
181 | 194 | |
182 | 195 | # Set the ID |
183 | 196 | $this->mAttribs['rc_id'] = $dbw->insertId(); |
184 | | - |
| 197 | + |
185 | 198 | # Notify extensions |
186 | 199 | wfRunHooks( 'RecentChange_save', array( &$this ) ); |
187 | 200 | |
— | — | @@ -194,11 +207,11 @@ |
195 | 208 | if( $wgUseEnotif || $wgShowUpdatedMarker ) { |
196 | 209 | // Users |
197 | 210 | if( $this->mAttribs['rc_user'] ) { |
198 | | - $editor = ($wgUser->getId() == $this->mAttribs['rc_user']) ? |
| 211 | + $editor = ($wgUser->getId() == $this->mAttribs['rc_user']) ? |
199 | 212 | $wgUser : User::newFromID( $this->mAttribs['rc_user'] ); |
200 | 213 | // Anons |
201 | 214 | } else { |
202 | | - $editor = ($wgUser->getName() == $this->mAttribs['rc_user_text']) ? |
| 215 | + $editor = ($wgUser->getName() == $this->mAttribs['rc_user_text']) ? |
203 | 216 | $wgUser : User::newFromName( $this->mAttribs['rc_user_text'], false ); |
204 | 217 | } |
205 | 218 | # @todo FIXME: This would be better as an extension hook |
— | — | @@ -211,7 +224,7 @@ |
212 | 225 | $this->mAttribs['rc_last_oldid'] ); |
213 | 226 | } |
214 | 227 | } |
215 | | - |
| 228 | + |
216 | 229 | public function notifyRC2UDP() { |
217 | 230 | global $wgRC2UDPAddress, $wgRC2UDPOmitBots; |
218 | 231 | # Notify external application via UDP |
— | — | @@ -250,7 +263,7 @@ |
251 | 264 | } |
252 | 265 | return false; |
253 | 266 | } |
254 | | - |
| 267 | + |
255 | 268 | /** |
256 | 269 | * Remove newlines, carriage returns and decode html entites |
257 | 270 | * @param $text String |
— | — | @@ -279,7 +292,7 @@ |
280 | 293 | } |
281 | 294 | return $change->doMarkPatrolled( $wgUser, $auto ); |
282 | 295 | } |
283 | | - |
| 296 | + |
284 | 297 | /** |
285 | 298 | * Mark this RecentChange as patrolled |
286 | 299 | * |
— | — | @@ -321,7 +334,7 @@ |
322 | 335 | wfRunHooks( 'MarkPatrolledComplete', array($this->getAttribute('rc_id'), &$user, false) ); |
323 | 336 | return array(); |
324 | 337 | } |
325 | | - |
| 338 | + |
326 | 339 | /** |
327 | 340 | * Mark this RecentChange patrolled, without error checking |
328 | 341 | * @return Integer: number of affected rows |
— | — | @@ -470,7 +483,21 @@ |
471 | 484 | return $rc; |
472 | 485 | } |
473 | 486 | |
474 | | - public static function notifyLog( $timestamp, &$title, &$user, $actionComment, $ip='', $type, |
| 487 | + /** |
| 488 | + * @param $timestamp |
| 489 | + * @param $title |
| 490 | + * @param $user |
| 491 | + * @param $actionComment |
| 492 | + * @param $ip string |
| 493 | + * @param $type |
| 494 | + * @param $action |
| 495 | + * @param $target |
| 496 | + * @param $logComment |
| 497 | + * @param $params |
| 498 | + * @param $newId int |
| 499 | + * @return bool |
| 500 | + */ |
| 501 | + public static function notifyLog( $timestamp, &$title, &$user, $actionComment, $ip='', $type, |
475 | 502 | $action, $target, $logComment, $params, $newId=0 ) |
476 | 503 | { |
477 | 504 | global $wgLogRestrictions; |
— | — | @@ -544,14 +571,22 @@ |
545 | 572 | return $rc; |
546 | 573 | } |
547 | 574 | |
548 | | - # Initialises the members of this object from a mysql row object |
| 575 | + /** |
| 576 | + * Initialises the members of this object from a mysql row object |
| 577 | + * |
| 578 | + * @param $row |
| 579 | + */ |
549 | 580 | public function loadFromRow( $row ) { |
550 | 581 | $this->mAttribs = get_object_vars( $row ); |
551 | 582 | $this->mAttribs['rc_timestamp'] = wfTimestamp(TS_MW, $this->mAttribs['rc_timestamp']); |
552 | 583 | $this->mAttribs['rc_deleted'] = $row->rc_deleted; // MUST be set |
553 | 584 | } |
554 | 585 | |
555 | | - # Makes a pseudo-RC entry from a cur row |
| 586 | + /** |
| 587 | + * Makes a pseudo-RC entry from a cur row |
| 588 | + * |
| 589 | + * @param $row |
| 590 | + */ |
556 | 591 | public function loadFromCurRow( $row ) { |
557 | 592 | $this->mAttribs = array( |
558 | 593 | 'rc_timestamp' => wfTimestamp(TS_MW, $row->rev_timestamp), |
— | — | @@ -593,6 +628,9 @@ |
594 | 629 | return isset( $this->mAttribs[$name] ) ? $this->mAttribs[$name] : null; |
595 | 630 | } |
596 | 631 | |
| 632 | + /** |
| 633 | + * @return array |
| 634 | + */ |
597 | 635 | public function getAttributes() { |
598 | 636 | return $this->mAttribs; |
599 | 637 | } |
— | — | @@ -600,6 +638,8 @@ |
601 | 639 | /** |
602 | 640 | * Gets the end part of the diff URL associated with this object |
603 | 641 | * Blank if no diff link should be displayed |
| 642 | + * @param $forceCur |
| 643 | + * @return string |
604 | 644 | */ |
605 | 645 | public function diffLinkTrail( $forceCur ) { |
606 | 646 | if( $this->mAttribs['rc_type'] == RC_EDIT ) { |
— | — | @@ -616,6 +656,9 @@ |
617 | 657 | return $trail; |
618 | 658 | } |
619 | 659 | |
| 660 | + /** |
| 661 | + * @return string |
| 662 | + */ |
620 | 663 | public function getIRCLine() { |
621 | 664 | global $wgUseRCPatrol, $wgUseNPPatrol, $wgRC2UDPInterwikiPrefix, $wgLocalInterwiki, |
622 | 665 | $wgCanonicalServer, $wgScript; |
— | — | @@ -684,18 +727,21 @@ |
685 | 728 | } else { |
686 | 729 | $titleString = "\00314[[\00307$title\00314]]"; |
687 | 730 | } |
688 | | - |
| 731 | + |
689 | 732 | # see http://www.irssi.org/documentation/formats for some colour codes. prefix is \003, |
690 | 733 | # no colour (\003) switches back to the term default |
691 | 734 | $fullString = "$titleString\0034 $flag\00310 " . |
692 | 735 | "\00302$url\003 \0035*\003 \00303$user\003 \0035*\003 $szdiff \00310$comment\003\n"; |
693 | | - |
| 736 | + |
694 | 737 | return $fullString; |
695 | 738 | } |
696 | 739 | |
697 | 740 | /** |
698 | 741 | * Returns the change size (HTML). |
699 | 742 | * The lengths can be given optionally. |
| 743 | + * @param $old int |
| 744 | + * @param $new int |
| 745 | + * @return string |
700 | 746 | */ |
701 | 747 | public function getCharacterDifference( $old = 0, $new = 0 ) { |
702 | 748 | if( $old === 0 ) { |
Index: trunk/phase3/includes/parser/ParserOutput.php |
— | — | @@ -158,10 +158,8 @@ |
159 | 159 | if ( $this->mEditSectionTokens ) { |
160 | 160 | return preg_replace_callback( ParserOutput::EDITSECTION_REGEX, |
161 | 161 | array( &$this, 'replaceEditSectionLinksCallback' ), $this->mText ); |
162 | | - } else { |
163 | | - return preg_replace( ParserOutput::EDITSECTION_REGEX, '', $this->mText ); |
164 | 162 | } |
165 | | - return $this->mText; |
| 163 | + return preg_replace( ParserOutput::EDITSECTION_REGEX, '', $this->mText ); |
166 | 164 | } |
167 | 165 | |
168 | 166 | /** |
Index: trunk/phase3/includes/db/DatabasePostgres.php |
— | — | @@ -565,7 +565,7 @@ |
566 | 566 | $ignore = in_array( 'IGNORE', $insertOptions ) ? 'mw' : ''; |
567 | 567 | |
568 | 568 | if( is_array( $insertOptions ) ) { |
569 | | - $insertOptions = implode( ' ', $insertOptions ); |
| 569 | + $insertOptions = implode( ' ', $insertOptions ); // FIXME: This is unused |
570 | 570 | } |
571 | 571 | if( !is_array( $selectOptions ) ) { |
572 | 572 | $selectOptions = array( $selectOptions ); |
Index: trunk/phase3/includes/filerepo/FSRepo.php |
— | — | @@ -601,7 +601,6 @@ |
602 | 602 | list( $srcRel, $archiveRel ) = $pair; |
603 | 603 | $srcPath = "{$this->directory}/$srcRel"; |
604 | 604 | $archivePath = "{$this->deletedDir}/$archiveRel"; |
605 | | - $good = true; |
606 | 605 | if ( file_exists( $archivePath ) ) { |
607 | 606 | # A file with this content hash is already archived |
608 | 607 | wfSuppressWarnings(); |
Index: trunk/phase3/includes/revisiondelete/RevisionDeleter.php |
— | — | @@ -121,7 +121,7 @@ |
122 | 122 | |
123 | 123 | if ( count( $paramArray ) >= 2 ) { |
124 | 124 | // Different revision types use different URL params... |
125 | | - $originalKey = $key = $paramArray[0]; |
| 125 | + $key = $paramArray[0]; |
126 | 126 | // $paramArray[1] is a CSV of the IDs |
127 | 127 | $Ids = explode( ',', $paramArray[1] ); |
128 | 128 | |
Index: trunk/phase3/includes/logging/LogEntry.php |
— | — | @@ -127,8 +127,6 @@ |
128 | 128 | 'user_id', 'user_name', 'user_editcount', |
129 | 129 | ); |
130 | 130 | |
131 | | - $conds = array(); |
132 | | - |
133 | 131 | $joins = array( |
134 | 132 | // IP's don't have an entry in user table |
135 | 133 | 'user' => array( 'LEFT JOIN', 'log_user=user_id' ), |
— | — | @@ -321,7 +319,7 @@ |
322 | 320 | } |
323 | 321 | |
324 | 322 | /** |
325 | | - * Set extra log parameters. |
| 323 | + * Set extra log parameters. |
326 | 324 | * You can pass params to the log action message |
327 | 325 | * by prefixing the keys with a number and colon. |
328 | 326 | * The numbering should start with number 4, the |
Index: trunk/phase3/includes/logging/LogFormatter.php |
— | — | @@ -481,7 +481,6 @@ |
482 | 482 | } |
483 | 483 | |
484 | 484 | public function getComment() { |
485 | | - $subtype = $this->entry->getSubtype(); |
486 | 485 | $timestamp = wfTimestamp( TS_MW, $this->entry->getTimestamp() ); |
487 | 486 | if ( $timestamp < '20080129000000' ) { |
488 | 487 | # Suppress $comment from old entries (before 2008-01-29), |
— | — | @@ -490,4 +489,4 @@ |
491 | 490 | } |
492 | 491 | return parent::getComment(); |
493 | 492 | } |
494 | | -} |
\ No newline at end of file |
| 493 | +} |
Index: trunk/phase3/includes/installer/PostgresInstaller.php |
— | — | @@ -429,8 +429,8 @@ |
430 | 430 | $conn = $status->value; |
431 | 431 | |
432 | 432 | $dbName = $this->getVar( 'wgDBname' ); |
433 | | - $schema = $this->getVar( 'wgDBmwschema' ); |
434 | | - $user = $this->getVar( 'wgDBuser' ); |
| 433 | + //$schema = $this->getVar( 'wgDBmwschema' ); |
| 434 | + //$user = $this->getVar( 'wgDBuser' ); |
435 | 435 | //$safeschema = $conn->addIdentifierQuotes( $schema ); |
436 | 436 | //$safeuser = $conn->addIdentifierQuotes( $user ); |
437 | 437 | |
— | — | @@ -491,7 +491,7 @@ |
492 | 492 | } |
493 | 493 | $conn = $status->value; |
494 | 494 | |
495 | | - $schema = $this->getVar( 'wgDBmwschema' ); |
| 495 | + //$schema = $this->getVar( 'wgDBmwschema' ); |
496 | 496 | $safeuser = $conn->addIdentifierQuotes( $this->getVar( 'wgDBuser' ) ); |
497 | 497 | $safepass = $conn->addQuotes( $this->getVar( 'wgDBpassword' ) ); |
498 | 498 | //$safeschema = $conn->addIdentifierQuotes( $schema ); |
Index: trunk/phase3/includes/api/ApiWatch.php |
— | — | @@ -53,7 +53,6 @@ |
54 | 54 | $this->dieUsageMsg( array( 'invalidtitle', $params['title'] ) ); |
55 | 55 | } |
56 | 56 | |
57 | | - $article = new Article( $title, 0 ); |
58 | 57 | $res = array( 'title' => $title->getPrefixedText() ); |
59 | 58 | |
60 | 59 | if ( $params['unwatch'] ) { |
Index: trunk/phase3/includes/media/Bitmap.php |
— | — | @@ -21,12 +21,11 @@ |
22 | 22 | * @return bool |
23 | 23 | */ |
24 | 24 | function normaliseParams( $image, &$params ) { |
25 | | - |
| 25 | + |
26 | 26 | if ( !parent::normaliseParams( $image, $params ) ) { |
27 | 27 | return false; |
28 | 28 | } |
29 | 29 | |
30 | | - $mimeType = $image->getMimeType(); |
31 | 30 | # Obtain the source, pre-rotation dimensions |
32 | 31 | $srcWidth = $image->getWidth( $params['page'] ); |
33 | 32 | $srcHeight = $image->getHeight( $params['page'] ); |
— | — | @@ -42,39 +41,39 @@ |
43 | 42 | return true; |
44 | 43 | } |
45 | 44 | } |
46 | | - |
| 45 | + |
47 | 46 | return true; |
48 | 47 | } |
49 | | - |
| 48 | + |
50 | 49 | /** |
51 | | - * Check if the file is smaller than the maximum image area for |
| 50 | + * Check if the file is smaller than the maximum image area for |
52 | 51 | * thumbnailing. Check will always pass if the scaler is 'hookaborted' or |
53 | 52 | * if the scaler is 'im' and the mime type is 'image/jpeg' |
54 | | - * |
| 53 | + * |
55 | 54 | * @param File $image |
56 | | - * @param string $scaler |
| 55 | + * @param string $scaler |
57 | 56 | */ |
58 | 57 | function checkImageArea( $image, $scaler ) { |
59 | 58 | global $wgMaxImageArea; |
60 | 59 | # Don't thumbnail an image so big that it will fill hard drives and send servers into swap |
61 | 60 | # JPEG has the handy property of allowing thumbnailing without full decompression, so we make |
62 | 61 | # an exception for it. |
63 | | - |
64 | | - |
| 62 | + |
| 63 | + |
65 | 64 | if ( $image->getMimeType() == 'image/jpeg' && $scaler == 'im' ) |
66 | 65 | { |
67 | 66 | # ImageMagick can efficiently downsize jpg images without loading |
68 | 67 | # the entire file in memory |
69 | 68 | return true; |
70 | 69 | } |
71 | | - |
| 70 | + |
72 | 71 | if ( $scaler == 'hookaborted' ) |
73 | 72 | { |
74 | | - # If a hook wants to transform the image, it is responsible for |
| 73 | + # If a hook wants to transform the image, it is responsible for |
75 | 74 | # checking the image size, so abort here |
76 | 75 | return true; |
77 | 76 | } |
78 | | - |
| 77 | + |
79 | 78 | # Do the actual check |
80 | 79 | return $this->getImageArea( $image, $image->getWidth(), $image->getHeight() ) <= $wgMaxImageArea; |
81 | 80 | } |
— | — | @@ -184,7 +183,7 @@ |
185 | 184 | wfDebug( __METHOD__ . ": Hook to BitmapHandlerTransform created an mto\n" ); |
186 | 185 | $scaler = 'hookaborted'; |
187 | 186 | } |
188 | | - |
| 187 | + |
189 | 188 | # Check max image area |
190 | 189 | if ( !$this->checkImageArea( $image, $scaler ) ) |
191 | 190 | { |
Index: trunk/phase3/includes/HttpFunctions.old.php |
— | — | @@ -9,5 +9,4 @@ |
10 | 10 | * This is for backwards compatibility. |
11 | 11 | * @since 1.17 |
12 | 12 | */ |
13 | | - |
14 | 13 | class HttpRequest extends MWHttpRequest { } |
Index: trunk/phase3/includes/specials/SpecialSearch.php |
— | — | @@ -407,7 +407,7 @@ |
408 | 408 | $this->getOutput()->addHtml( '<p></p>' ); |
409 | 409 | return; |
410 | 410 | } |
411 | | - $messageName = ''; |
| 411 | + |
412 | 412 | if( $t->isKnown() ) { |
413 | 413 | $messageName = 'searchmenu-exists'; |
414 | 414 | } elseif( $t->userCan( 'create' ) ) { |
Index: trunk/phase3/includes/Block.php |
— | — | @@ -418,7 +418,6 @@ |
419 | 419 | # Don't collide with expired blocks |
420 | 420 | Block::purgeExpired(); |
421 | 421 | |
422 | | - $ipb_id = $dbw->nextSequenceValue( 'ipblocks_ipb_id_seq' ); |
423 | 422 | $dbw->insert( |
424 | 423 | 'ipblocks', |
425 | 424 | $this->getDatabaseArray(), |
Index: trunk/phase3/languages/messages/MessagesEn.php |
— | — | @@ -4525,8 +4525,7 @@ |
4526 | 4526 | 'specialpages-summary' => '', # do not translate or duplicate this message to other languages |
4527 | 4527 | 'specialpages-note' => '---- |
4528 | 4528 | * Normal special pages. |
4529 | | -* <span class="mw-specialpagerestricted">Restricted special pages.</span> |
4530 | | -* <span class="mw-specialpagecached">Cached special pages (might be obsolete).</span>', |
| 4529 | +* <span class="mw-specialpagerestricted">Restricted special pages.</span>', |
4531 | 4530 | 'specialpages-group-maintenance' => 'Maintenance reports', |
4532 | 4531 | 'specialpages-group-other' => 'Other special pages', |
4533 | 4532 | 'specialpages-group-login' => 'Login / sign up', |