Index: trunk/phase3/includes/Article.php |
— | — | @@ -2505,7 +2505,10 @@ |
2506 | 2506 | |
2507 | 2507 | /** |
2508 | 2508 | * Auto-generates a deletion reason |
| 2509 | + * |
2509 | 2510 | * @param &$hasHistory Boolean: whether the page has a history |
| 2511 | + * @return mixed String containing deletion reason or empty string, or boolean false |
| 2512 | + * if no revision occurred |
2510 | 2513 | */ |
2511 | 2514 | public function generateReason( &$hasHistory ) { |
2512 | 2515 | global $wgContLang; |
— | — | @@ -2911,7 +2914,16 @@ |
2912 | 2915 | /** |
2913 | 2916 | * Back-end article deletion |
2914 | 2917 | * Deletes the article with database consistency, writes logs, purges caches |
2915 | | - * Returns success |
| 2918 | + * |
| 2919 | + * @param $reason string delete reason for deletion log |
| 2920 | + * @param suppress bitfield |
| 2921 | + * Revision::DELETED_TEXT |
| 2922 | + * Revision::DELETED_COMMENT |
| 2923 | + * Revision::DELETED_USER |
| 2924 | + * Revision::DELETED_RESTRICTED |
| 2925 | + * @param $id int article ID |
| 2926 | + * @param $commit boolean defaults to true, triggers transaction end |
| 2927 | + * @return boolean true if successful |
2916 | 2928 | */ |
2917 | 2929 | public function doDeleteArticle( $reason, $suppress = false, $id = 0, $commit = true ) { |
2918 | 2930 | global $wgUseSquid, $wgDeferredUpdateList; |
— | — | @@ -3583,7 +3595,9 @@ |
3584 | 3596 | * This function is called right before saving the wikitext, |
3585 | 3597 | * so we can do things like signatures and links-in-context. |
3586 | 3598 | * |
3587 | | - * @param $text String |
| 3599 | + * @param $text String article contents |
| 3600 | + * @return string article contents with altered wikitext markup (signatures |
| 3601 | + * converted, {{subst:}}, templates, etc.) |
3588 | 3602 | */ |
3589 | 3603 | public function preSaveTransform( $text ) { |
3590 | 3604 | global $wgParser, $wgUser; |
— | — | @@ -3596,6 +3610,8 @@ |
3597 | 3611 | * checkLastModified returns true if it has taken care of all |
3598 | 3612 | * output to the client that is necessary for this request. |
3599 | 3613 | * (that is, it has sent a cached version of the page) |
| 3614 | + * |
| 3615 | + * @return boolean true if cached version send, false otherwise |
3600 | 3616 | */ |
3601 | 3617 | protected function tryFileCache() { |
3602 | 3618 | static $called = false; |
— | — | @@ -3638,7 +3654,7 @@ |
3639 | 3655 | |
3640 | 3656 | /** |
3641 | 3657 | * Loads page_touched and returns a value indicating if it should be used |
3642 | | - * |
| 3658 | + * @return boolean true if not a redirect |
3643 | 3659 | */ |
3644 | 3660 | public function checkTouched() { |
3645 | 3661 | if ( !$this->mDataLoaded ) { |
— | — | @@ -3649,6 +3665,7 @@ |
3650 | 3666 | |
3651 | 3667 | /** |
3652 | 3668 | * Get the page_touched field |
| 3669 | + * @return string containing GMT timestamp |
3653 | 3670 | */ |
3654 | 3671 | public function getTouched() { |
3655 | 3672 | # Ensure that page data has been loaded |
— | — | @@ -3660,6 +3677,7 @@ |
3661 | 3678 | |
3662 | 3679 | /** |
3663 | 3680 | * Get the page_latest field |
| 3681 | + * @return integer rev_id of current revision |
3664 | 3682 | */ |
3665 | 3683 | public function getLatest() { |
3666 | 3684 | if ( !$this->mDataLoaded ) { |
— | — | @@ -3782,7 +3800,10 @@ |
3783 | 3801 | $title->purgeSquid(); |
3784 | 3802 | $title->deleteTitleProtection(); |
3785 | 3803 | } |
3786 | | - |
| 3804 | + |
| 3805 | + /** |
| 3806 | + * Clears caches when article is deleted |
| 3807 | + */ |
3787 | 3808 | public static function onArticleDelete( $title ) { |
3788 | 3809 | global $wgMessageCache; |
3789 | 3810 | # Update existence markers on article/talk tabs... |
— | — | @@ -3912,7 +3933,7 @@ |
3913 | 3934 | * on a given page. If page does not exist, returns false. |
3914 | 3935 | * |
3915 | 3936 | * @param $title Title object |
3916 | | - * @return array |
| 3937 | + * @return mixed array or boolean false |
3917 | 3938 | */ |
3918 | 3939 | public function pageCountInfo( $title ) { |
3919 | 3940 | $id = $title->getArticleId(); |
— | — | @@ -4042,6 +4063,7 @@ |
4043 | 4064 | * |
4044 | 4065 | * @param $text String |
4045 | 4066 | * @param $cache Boolean |
| 4067 | + * @param $parserOptions mixed ParserOptions object, or boolean false |
4046 | 4068 | */ |
4047 | 4069 | public function outputWikiText( $text, $cache = true, $parserOptions = false ) { |
4048 | 4070 | global $wgOut; |
— | — | @@ -4054,6 +4076,11 @@ |
4055 | 4077 | * This does all the heavy lifting for outputWikitext, except it returns the parser |
4056 | 4078 | * output instead of sending it straight to $wgOut. Makes things nice and simple for, |
4057 | 4079 | * say, embedding thread pages within a discussion system (LiquidThreads) |
| 4080 | + * |
| 4081 | + * @param $text string |
| 4082 | + * @param $cache boolean |
| 4083 | + * @param $parserOptions parsing options, defaults to false |
| 4084 | + * @return string containing parsed output |
4058 | 4085 | */ |
4059 | 4086 | public function getOutputFromWikitext( $text, $cache = true, $parserOptions = false ) { |
4060 | 4087 | global $wgParser, $wgOut, $wgEnableParserCache, $wgUseFileCache; |
— | — | @@ -4089,6 +4116,7 @@ |
4090 | 4117 | |
4091 | 4118 | /** |
4092 | 4119 | * Get parser options suitable for rendering the primary article wikitext |
| 4120 | + * @return mixed ParserOptions object or boolean false |
4093 | 4121 | */ |
4094 | 4122 | public function getParserOptions() { |
4095 | 4123 | global $wgUser; |
— | — | @@ -4099,6 +4127,12 @@ |
4100 | 4128 | } |
4101 | 4129 | return $this->mParserOptions; |
4102 | 4130 | } |
| 4131 | + |
| 4132 | + /** |
| 4133 | + * Updates cascading protections |
| 4134 | + * |
| 4135 | + * @param $parserOutput mixedParseerOptions object, or boolean false |
| 4136 | + **/ |
4103 | 4137 | |
4104 | 4138 | protected function doCascadeProtectionUpdates( $parserOutput ) { |
4105 | 4139 | if ( !$this->isCurrent() || wfReadOnly() || !$this->mTitle->areRestrictionsCascading() ) { |
— | — | @@ -4153,7 +4187,6 @@ |
4154 | 4188 | * |
4155 | 4189 | * @param $added array The names of categories that were added |
4156 | 4190 | * @param $deleted array The names of categories that were deleted |
4157 | | - * @return null |
4158 | 4191 | */ |
4159 | 4192 | public function updateCategoryCounts( $added, $deleted ) { |
4160 | 4193 | $ns = $this->mTitle->getNamespace(); |
— | — | @@ -4207,11 +4240,14 @@ |
4208 | 4241 | } |
4209 | 4242 | } |
4210 | 4243 | |
4211 | | - /** Lightweight method to get the parser output for a page, checking the parser cache |
| 4244 | + /** |
| 4245 | + * Lightweight method to get the parser output for a page, checking the parser cache |
4212 | 4246 | * and so on. Doesn't consider most of the stuff that Article::view is forced to |
4213 | 4247 | * consider, so it's not appropriate to use there. |
| 4248 | + * |
| 4249 | + * @param $oldid mixed integer Revision ID or null |
4214 | 4250 | */ |
4215 | | - function getParserOutput( $oldid = null ) { |
| 4251 | + public function getParserOutput( $oldid = null ) { |
4216 | 4252 | global $wgEnableParserCache, $wgUser, $wgOut; |
4217 | 4253 | |
4218 | 4254 | // Should the parser cache be used? |