Index: trunk/phase3/includes/Article.php |
— | — | @@ -508,7 +508,7 @@ |
509 | 509 | * Read/write accessor to select FOR UPDATE |
510 | 510 | * |
511 | 511 | * @param $x Mixed: FIXME |
512 | | - * @return |
| 512 | + * @return mixed value of $x, or value stored in Article::mForUpdate |
513 | 513 | */ |
514 | 514 | public function forUpdate( $x = null ) { |
515 | 515 | return wfSetVar( $this->mForUpdate, $x ); |
— | — | @@ -611,7 +611,7 @@ |
612 | 612 | /** |
613 | 613 | * Tests if the article text represents a redirect |
614 | 614 | * |
615 | | - * @param $text String: FIXME |
| 615 | + * @param $text mixed string containing article contents, or boolean |
616 | 616 | * @return bool |
617 | 617 | */ |
618 | 618 | public function isRedirect( $text = false ) { |
— | — | @@ -663,6 +663,10 @@ |
664 | 664 | $this->mRevIdFetched = $this->mLastRevision->getId(); |
665 | 665 | } |
666 | 666 | } |
| 667 | + |
| 668 | + /** |
| 669 | + * @return string GMT timestamp of last article revision |
| 670 | + **/ |
667 | 671 | |
668 | 672 | public function getTimestamp() { |
669 | 673 | // Check if the field has been filled by ParserCache::get() |
— | — | @@ -672,27 +676,45 @@ |
673 | 677 | return wfTimestamp( TS_MW, $this->mTimestamp ); |
674 | 678 | } |
675 | 679 | |
| 680 | + /** |
| 681 | + * @return int user ID for the user that made the last article revision |
| 682 | + */ |
676 | 683 | public function getUser() { |
677 | 684 | $this->loadLastEdit(); |
678 | 685 | return $this->mUser; |
679 | 686 | } |
680 | 687 | |
| 688 | + /** |
| 689 | + * @return string username of the user that made the last article revision |
| 690 | + */ |
681 | 691 | public function getUserText() { |
682 | 692 | $this->loadLastEdit(); |
683 | 693 | return $this->mUserText; |
684 | 694 | } |
685 | 695 | |
| 696 | + /** |
| 697 | + * @return string Comment stored for the last article revision |
| 698 | + */ |
686 | 699 | public function getComment() { |
687 | 700 | $this->loadLastEdit(); |
688 | 701 | return $this->mComment; |
689 | 702 | } |
690 | 703 | |
| 704 | + /** |
| 705 | + * Returns true if last revision was marked as "minor edit" |
| 706 | + * |
| 707 | + * @return boolean Minor edit indicator for the last article revision. |
| 708 | + */ |
691 | 709 | public function getMinorEdit() { |
692 | 710 | $this->loadLastEdit(); |
693 | 711 | return $this->mMinorEdit; |
694 | 712 | } |
695 | 713 | |
696 | | - /* Use this to fetch the rev ID used on page views */ |
| 714 | + /** |
| 715 | + * Use this to fetch the rev ID used on page views |
| 716 | + * |
| 717 | + * @return int revision ID of last article revision |
| 718 | + */ |
697 | 719 | public function getRevIdFetched() { |
698 | 720 | $this->loadLastEdit(); |
699 | 721 | return $this->mRevIdFetched; |
— | — | @@ -701,6 +723,7 @@ |
702 | 724 | /** |
703 | 725 | * @param $limit Integer: default 0. |
704 | 726 | * @param $offset Integer: default 0. |
| 727 | + * @return UserArrayFromResult object with User objects of article contributors for requested range |
705 | 728 | */ |
706 | 729 | public function getContributors( $limit = 0, $offset = 0 ) { |
707 | 730 | # XXX: this is expensive; cache this info somewhere. |
— | — | @@ -1099,6 +1122,8 @@ |
1100 | 1123 | * If this request is a redirect view, send "redirected from" subtitle to |
1101 | 1124 | * $wgOut. Returns true if the header was needed, false if this is not a |
1102 | 1125 | * redirect view. Handles both local and remote redirects. |
| 1126 | + * |
| 1127 | + * @return boolean |
1103 | 1128 | */ |
1104 | 1129 | public function showRedirectedFromHeader() { |
1105 | 1130 | global $wgOut, $wgUser, $wgRequest, $wgRedirectSources; |
— | — | @@ -1285,7 +1310,8 @@ |
1286 | 1311 | /** |
1287 | 1312 | * If the revision requested for view is deleted, check permissions. |
1288 | 1313 | * Send either an error message or a warning header to $wgOut. |
1289 | | - * Returns true if the view is allowed, false if not. |
| 1314 | + * |
| 1315 | + * @return boolean true if the view is allowed, false if not. |
1290 | 1316 | */ |
1291 | 1317 | public function showDeletedRevisionHeader() { |
1292 | 1318 | global $wgOut, $wgRequest; |
— | — | @@ -1317,9 +1343,11 @@ |
1318 | 1344 | } |
1319 | 1345 | } |
1320 | 1346 | |
1321 | | - /* |
1322 | | - * Should the parser cache be used? |
1323 | | - */ |
| 1347 | + /** |
| 1348 | + * Should the parser cache be used? |
| 1349 | + * |
| 1350 | + * @return boolean |
| 1351 | + */ |
1324 | 1352 | public function useParserCache( $oldid ) { |
1325 | 1353 | global $wgUser, $wgEnableParserCache; |
1326 | 1354 | |
— | — | @@ -1352,6 +1380,8 @@ |
1353 | 1381 | * output it and return true. If it is not present, output nothing and |
1354 | 1382 | * return false. This is used as a callback function for |
1355 | 1383 | * PoolCounter::executeProtected(). |
| 1384 | + * |
| 1385 | + * @return boolean |
1356 | 1386 | */ |
1357 | 1387 | public function tryDirtyCache() { |
1358 | 1388 | global $wgOut; |
— | — | @@ -1392,9 +1422,11 @@ |
1393 | 1423 | |
1394 | 1424 | /** |
1395 | 1425 | * View redirect |
| 1426 | + * |
1396 | 1427 | * @param $target Title object or Array of destination(s) to redirect |
1397 | 1428 | * @param $appendSubtitle Boolean [optional] |
1398 | 1429 | * @param $forceKnown Boolean: should the image be shown as a bluelink regardless of existence? |
| 1430 | + * @return string containing HMTL with redirect link |
1399 | 1431 | */ |
1400 | 1432 | public function viewRedirect( $target, $appendSubtitle = true, $forceKnown = false ) { |
1401 | 1433 | global $wgOut, $wgContLang, $wgStylePath, $wgUser; |
— | — | @@ -1445,6 +1477,9 @@ |
1446 | 1478 | |
1447 | 1479 | } |
1448 | 1480 | |
| 1481 | + /** |
| 1482 | + * Builds trackback links for article display if $wgUseTrackbacks is set to true |
| 1483 | + */ |
1449 | 1484 | public function addTrackbacks() { |
1450 | 1485 | global $wgOut, $wgUser; |
1451 | 1486 | $dbr = wfGetDB( DB_SLAVE ); |
— | — | @@ -1474,6 +1509,9 @@ |
1475 | 1510 | $this->mTitle->invalidateCache(); |
1476 | 1511 | } |
1477 | 1512 | |
| 1513 | + /** |
| 1514 | + * Removes trackback record for current article from trackbacks table |
| 1515 | + */ |
1478 | 1516 | public function deletetrackback() { |
1479 | 1517 | global $wgUser, $wgRequest, $wgOut; |
1480 | 1518 | if ( !$wgUser->matchEditToken( $wgRequest->getVal( 'token' ) ) ) { |
— | — | @@ -1493,6 +1531,10 @@ |
1494 | 1532 | $wgOut->addWikiMsg( 'trackbackdeleteok' ); |
1495 | 1533 | $this->mTitle->invalidateCache(); |
1496 | 1534 | } |
| 1535 | + |
| 1536 | + /** |
| 1537 | + * Handle action=render |
| 1538 | + */ |
1497 | 1539 | |
1498 | 1540 | public function render() { |
1499 | 1541 | global $wgOut; |
— | — | @@ -1683,6 +1725,7 @@ |
1684 | 1726 | * |
1685 | 1727 | * @param $dbw Database object |
1686 | 1728 | * @param $revision Revision object |
| 1729 | + * @return mixed |
1687 | 1730 | */ |
1688 | 1731 | public function updateIfNewerOn( &$dbw, $revision ) { |
1689 | 1732 | wfProfileIn( __METHOD__ ); |