Index: trunk/phase3/tests/phpunit/includes/MessageTest.php |
— | — | @@ -47,7 +47,7 @@ |
48 | 48 | $this->assertEquals( 'Main Page', wfMessage( 'mainpage' )->inContentLanguage()->plain(), 'ForceUIMsg disabled' ); |
49 | 49 | $wgForceUIMsgAsContentMsg['testInContentLanguage'] = 'mainpage'; |
50 | 50 | $this->assertEquals( 'Accueil', wfMessage( 'mainpage' )->inContentLanguage()->plain(), 'ForceUIMsg enabled' ); |
51 | | - |
| 51 | + |
52 | 52 | /* Restore globals */ |
53 | 53 | $wgLang = $oldLang; |
54 | 54 | unset( $wgForceUIMsgAsContentMsg['testInContentLanguage'] ); |
Index: trunk/phase3/includes/parser/Parser.php |
— | — | @@ -5292,7 +5292,7 @@ |
5293 | 5293 | * not found, $mode=get will return $newtext, and $mode=replace will return $text. |
5294 | 5294 | * |
5295 | 5295 | * Section 0 is always considered to exist, even if it only contains the empty |
5296 | | - * string. If $text is the empty string and section 0 is replaced, $newText is |
| 5296 | + * string. If $text is the empty string and section 0 is replaced, $newText is |
5297 | 5297 | * returned. |
5298 | 5298 | * |
5299 | 5299 | * @param $mode String: one of "get" or "replace" |
— | — | @@ -5427,7 +5427,7 @@ |
5428 | 5428 | |
5429 | 5429 | /** |
5430 | 5430 | * This function returns $oldtext after the content of the section |
5431 | | - * specified by $section has been replaced with $text. If the target |
| 5431 | + * specified by $section has been replaced with $text. If the target |
5432 | 5432 | * section does not exist, $oldtext is returned unchanged. |
5433 | 5433 | * |
5434 | 5434 | * @param $oldtext String: former text of the article |
Index: trunk/phase3/includes/cache/MessageCache.php |
— | — | @@ -544,6 +544,8 @@ |
545 | 545 | /** |
546 | 546 | * Represents a write lock on the messages key |
547 | 547 | * |
| 548 | + * @param $key string |
| 549 | + * |
548 | 550 | * @return Boolean: success |
549 | 551 | */ |
550 | 552 | function lock( $key ) { |
— | — | @@ -576,6 +578,8 @@ |
577 | 579 | * fallback). |
578 | 580 | * @param $isFullKey Boolean: specifies whether $key is a two part key |
579 | 581 | * "msg/lang". |
| 582 | + * |
| 583 | + * @return string|false |
580 | 584 | */ |
581 | 585 | function get( $key, $useDB = true, $langcode = true, $isFullKey = false ) { |
582 | 586 | global $wgLanguageCode, $wgContLang; |
— | — | @@ -677,6 +681,8 @@ |
678 | 682 | * |
679 | 683 | * @param $title String: Message cache key with initial uppercase letter. |
680 | 684 | * @param $code String: code denoting the language to try. |
| 685 | + * |
| 686 | + * @return string|false |
681 | 687 | */ |
682 | 688 | function getMsgFromNamespace( $title, $code ) { |
683 | 689 | global $wgAdaptiveMessageCache; |
— | — | @@ -795,10 +801,9 @@ |
796 | 802 | |
797 | 803 | /** |
798 | 804 | * @param $text string |
799 | | - * @param $string Title|string |
800 | 805 | * @param $title Title |
| 806 | + * @param $linestart bool |
801 | 807 | * @param $interface bool |
802 | | - * @param $linestart bool |
803 | 808 | * @param $language |
804 | 809 | * @return ParserOutput |
805 | 810 | */ |
— | — | @@ -859,6 +864,10 @@ |
860 | 865 | $this->mLoadedLanguages = array(); |
861 | 866 | } |
862 | 867 | |
| 868 | + /** |
| 869 | + * @param $key |
| 870 | + * @return array |
| 871 | + */ |
863 | 872 | public function figureMessage( $key ) { |
864 | 873 | global $wgLanguageCode; |
865 | 874 | $pieces = explode( '/', $key ); |
— | — | @@ -916,6 +925,9 @@ |
917 | 926 | wfProfileOut( __METHOD__ ); |
918 | 927 | } |
919 | 928 | |
| 929 | + /** |
| 930 | + * @return array |
| 931 | + */ |
920 | 932 | public function getMostUsedMessages() { |
921 | 933 | wfProfileIn( __METHOD__ ); |
922 | 934 | $cachekey = wfMemcKey( 'message-profiling' ); |
Index: trunk/phase3/includes/Message.php |
— | — | @@ -11,7 +11,7 @@ |
12 | 12 | * $button = Xml::button( wfMessage( 'submit' )->text() ); |
13 | 13 | * </pre> |
14 | 14 | * Messages can have parameters: |
15 | | - * wfMessage( 'welcome-to' )->params( $wgSitename )->text(); |
| 15 | + * wfMessage( 'welcome-to' )->params( $wgSitename )->text(); |
16 | 16 | * {{GRAMMAR}} and friends work correctly |
17 | 17 | * wfMessage( 'are-friends', $user, $friend ); |
18 | 18 | * wfMessage( 'bad-message' )->rawParams( '<script>...</script>' )->escaped(); |
— | — | @@ -60,7 +60,7 @@ |
61 | 61 | * means the current interface language, false content language. |
62 | 62 | */ |
63 | 63 | protected $interface = true; |
64 | | - |
| 64 | + |
65 | 65 | /** |
66 | 66 | * In which language to get this message. Overrides the $interface |
67 | 67 | * variable. |
— | — | @@ -68,7 +68,7 @@ |
69 | 69 | * @var Language |
70 | 70 | */ |
71 | 71 | protected $language = null; |
72 | | - |
| 72 | + |
73 | 73 | /** |
74 | 74 | * The message key. |
75 | 75 | */ |
— | — | @@ -101,6 +101,11 @@ |
102 | 102 | protected $title = null; |
103 | 103 | |
104 | 104 | /** |
| 105 | + * @var string |
| 106 | + */ |
| 107 | + protected $message; |
| 108 | + |
| 109 | + /** |
105 | 110 | * Constructor. |
106 | 111 | * @param $key: message key, or array of message keys to try and use the first non-empty message for |
107 | 112 | * @param $params Array message parameters |
— | — | @@ -181,7 +186,7 @@ |
182 | 187 | } |
183 | 188 | return $this; |
184 | 189 | } |
185 | | - |
| 190 | + |
186 | 191 | /** |
187 | 192 | * Add parameters that are numeric and will be passed through |
188 | 193 | * Language::formatNum before substitution |
— | — | @@ -198,7 +203,7 @@ |
199 | 204 | } |
200 | 205 | return $this; |
201 | 206 | } |
202 | | - |
| 207 | + |
203 | 208 | /** |
204 | 209 | * Request the message in any language that is supported. |
205 | 210 | * As a side effect interface message status is unconditionally |
— | — | @@ -216,7 +221,7 @@ |
217 | 222 | } else { |
218 | 223 | $type = gettype( $lang ); |
219 | 224 | throw new MWException( __METHOD__ . " must be " |
220 | | - . "passed a String or Language object; $type given" |
| 225 | + . "passed a String or Language object; $type given" |
221 | 226 | ); |
222 | 227 | } |
223 | 228 | $this->interface = false; |
— | — | @@ -268,10 +273,10 @@ |
269 | 274 | */ |
270 | 275 | public function toString() { |
271 | 276 | $string = $this->getMessageText(); |
272 | | - |
| 277 | + |
273 | 278 | # Replace parameters before text parsing |
274 | 279 | $string = $this->replaceParameters( $string, 'before' ); |
275 | | - |
| 280 | + |
276 | 281 | # Maybe transform using the full parser |
277 | 282 | if( $this->format === 'parse' ) { |
278 | 283 | $string = $this->parseText( $string ); |
— | — | @@ -287,10 +292,10 @@ |
288 | 293 | $string = $this->transformText( $string ); |
289 | 294 | $string = htmlspecialchars( $string, ENT_QUOTES, 'UTF-8', false ); |
290 | 295 | } |
291 | | - |
| 296 | + |
292 | 297 | # Raw parameter replacement |
293 | 298 | $string = $this->replaceParameters( $string, 'after' ); |
294 | | - |
| 299 | + |
295 | 300 | return $string; |
296 | 301 | } |
297 | 302 | |
— | — | @@ -303,7 +308,7 @@ |
304 | 309 | public function __toString() { |
305 | 310 | return $this->toString(); |
306 | 311 | } |
307 | | - |
| 312 | + |
308 | 313 | /** |
309 | 314 | * Fully parse the text from wikitext to HTML |
310 | 315 | * @return String parsed HTML |
Index: trunk/extensions/Cite/Cite_body.php |
— | — | @@ -71,7 +71,7 @@ |
72 | 72 | * @var int |
73 | 73 | */ |
74 | 74 | var $mInCnt = 0; |
75 | | - |
| 75 | + |
76 | 76 | /** |
77 | 77 | * Counter to track the total number of (useful) calls to either the |
78 | 78 | * ref or references tag hook |
— | — | @@ -617,9 +617,9 @@ |
618 | 618 | |
619 | 619 | /** |
620 | 620 | * Make output to be returned from the references() function |
621 | | - * |
| 621 | + * |
622 | 622 | * @param $group |
623 | | - * |
| 623 | + * |
624 | 624 | * @return string XHTML ready for output |
625 | 625 | */ |
626 | 626 | function referencesFormat( $group ) { |
— | — | @@ -1020,11 +1020,11 @@ |
1021 | 1021 | * |
1022 | 1022 | * @return bool |
1023 | 1023 | */ |
1024 | | - function clearState( $parser ) { |
| 1024 | + function clearState( &$parser ) { |
1025 | 1025 | if ( $parser->extCite !== $this ) { |
1026 | 1026 | return $parser->extCite->clearState( $parser ); |
1027 | 1027 | } |
1028 | | - |
| 1028 | + |
1029 | 1029 | # Don't clear state when we're in the middle of parsing |
1030 | 1030 | # a <ref> tag |
1031 | 1031 | if ( $this->mInCite || $this->mInReferences ) { |
— | — | @@ -1055,7 +1055,7 @@ |
1056 | 1056 | if ( $parser->extCite !== $this ) { |
1057 | 1057 | return $parser->extCite->checkRefsNoReferences( $parser, $text ); |
1058 | 1058 | } |
1059 | | - |
| 1059 | + |
1060 | 1060 | if ( $parser->getOptions()->getIsSectionPreview() ) { |
1061 | 1061 | return true; |
1062 | 1062 | } |
— | — | @@ -1073,13 +1073,13 @@ |
1074 | 1074 | } |
1075 | 1075 | return true; |
1076 | 1076 | } |
1077 | | - |
| 1077 | + |
1078 | 1078 | /** |
1079 | 1079 | * Hook for the InlineEditor extension. If any ref or reference reference tag is in the text, the entire |
1080 | 1080 | * page should be reparsed, so we return false in that case. |
1081 | 1081 | * |
1082 | 1082 | * @param $output |
1083 | | - * |
| 1083 | + * |
1084 | 1084 | * @return bool |
1085 | 1085 | */ |
1086 | 1086 | function checkAnyCalls( &$output ) { |
— | — | @@ -1099,7 +1099,7 @@ |
1100 | 1100 | global $wgHooks; |
1101 | 1101 | |
1102 | 1102 | $parser->extCite = new self(); |
1103 | | - |
| 1103 | + |
1104 | 1104 | if ( !Cite::$hooksInstalled ) { |
1105 | 1105 | $wgHooks['ParserClearState'][] = array( $parser->extCite, 'clearState' ); |
1106 | 1106 | $wgHooks['ParserBeforeTidy'][] = array( $parser->extCite, 'checkRefsNoReferences' ); |