Commit graph

65 commits

Author SHA1 Message Date
Jeroen De Dauw
49cdca93be add missing deprecation notices and added deprecation version to existing ones 2011-12-13 05:19:05 +00:00
John Du Hart
216d661d3b Bug 29524 - Rename RequestContext::getLang to getLanguage
I'll be amazed if this doens't break any tests.
2011-11-21 16:13:21 +00:00
Alexandre Emsenhuber
f05d7ee8ee Unstub $wgLang if still stubbed before storing it; avoid storing a StubUserLang instance in ParserOptions and errors when getting the object (per report of Lockal on IRC) 2011-10-25 18:14:30 +00:00
Alexandre Emsenhuber
bd548f36e9 * Changed ParserOptions to store a Language object instead of only a string, avoids object -> string -> object conversion
* ParserOptions::getUserLang() will still return a string for compatibility, added ParserOptions::getUserLangObj() to get the object
* Added ParserOptions::newFromUserAndLang() and ParserOptions::newFromContext() to easily get a ParserOptions object when a context is available or when someone wants to force the language
* Updated OutputPage and Preferences to use newFromContext() and WikiPage to use newFromUserAndLang()
* ParserOptions::setUserLang() still accepts either a string or a Language object, but changed the calls to pass an object instead of a string
* Changed Parser::getFunctionLang() to return the Language object from ParserOptions when parsing interface messages rather than $wgLang directly and updated the documentation to say that $wgLang should not be used directly (as $wgUser, $wgTitle and $wgRequest)
2011-10-19 14:16:01 +00:00
Aaron Schulz
87c7cf57f8 FU r98412: added version to wfDeprecated call 2011-09-29 21:30:00 +00:00
Alexandre Emsenhuber
1e94b1be89 Per Aaron, follow-up r96859: add @deprecated comment, a wfDeprecated() and mark it for removal in next version since it's not used anywhere 2011-09-29 15:21:54 +00:00
Robin Pepermans
07dc087494 Re-do r96798 ("LanguageConverter now depends on the page content language"), without the change in WikiPage which caused an infinite loop (see bug 31098) 2011-09-22 20:31:23 +00:00
Robin Pepermans
20edfc8ee3 * follow-up r97636: decrease indentation & mention revision per Nikerabbit
* add @since for r97071
2011-09-21 19:30:08 +00:00
Robin Pepermans
3fc94ebd11 Re-do several things of r96798 in preparation of re-doing the rest (there's a bug somewhere that needs fixing).
* Do additional validation and is_array() check in LanguageConverter
* Make redirects be in content language again (remove from Title->getPageLanguage())
* Pass title object from ParserCache to ParserOptions->optionsHash
2011-09-20 15:55:08 +00:00
Niklas Laxström
c48b41201a Revert r96798 - makes parser go infinite loop somewhere 2011-09-14 11:23:58 +00:00
Alexandre Emsenhuber
077d6e218f Turn ParserOptions::setSkin() into a no-op since mSkin is no more used 2011-09-12 16:29:21 +00:00
Robin Pepermans
9a6efcc3e4 (Bug 30364) LanguageConverter should depend on the page content language instead of the wiki content language. Remains largely the same, except for extensions using the PageContentLanguage hook like Translate and WikimediaIncubator.
* Made variant tabs hidden on special pages (has no or sometimes wrong/inconsistent effect there; plus it's mainly in the user language)
* Made redirects be in content language again (remove from Title->getPageLanguage())
2011-09-11 17:56:27 +00:00
Alexandre Emsenhuber
d01e497b7f Stylised ParserOptions.php 2011-07-10 06:45:40 +00:00
Robin Pepermans
ca6fcb7e3f Address comment by Platonides on r90320:
* undefined variable $list in CategoryPage.php
* move code in ParserOptions to a new member of Title class, which falls back to $wgContLang
2011-06-18 14:49:01 +00:00
Robin Pepermans
9077baef30 Follow-up to r90265: directionality improvements as part of bug 6100 (under $wgBetterDirectionality):
* Correct directionality when viewing diffs
* Correct arrows for Pager
* CSS/JS pages always 'en' (LTR)
* Messages on Special:Allmessages have lang and dir attributes based on the selected language
2011-06-18 13:12:52 +00:00
Robin Pepermans
0288575c25 Follow-up to r90265: directionality improvements as part of bug 6100 (under $wgBetterDirectionality):
* Use ParserOptions()->getTargetLanguage() for setting the page language/direction
* Set headings on categories in user language/direction
* Only set language/direction when viewing a page (or editing but only preview and textarea)
2011-06-17 21:48:43 +00:00
Platonides
e23aadab89 Revert r88988 2011-06-16 16:54:06 +00:00
Niklas Laxström
0da0377d1f * Fix I18nTags #languagename to use ParserOptions::getUserLang()
* Fix ParserOptions::getUserLang() to return code as documented
2011-06-13 07:47:39 +00:00
Ilmari Karonen
84aa3fd282 bug 29123: record use of the "editsection" option so that users who can't edit (or have section edit links disabled) get a different cache key; also simplify freaky code layout (briefly tested, seem to work) 2011-05-27 18:51:26 +00:00
Siebrand Mazeland
75c6696aa8 Use consistent notation for "@todo FIXME". Should update http://svn.wikimedia.org/doc/todo.html nicely. 2011-05-17 22:03:20 +00:00
Niklas Laxström
7fe4a8e1bb Fixed a bug in transformation where previous language could leak into later transformations in UI language. Not sure what do with userlang. 2011-05-15 07:16:25 +00:00
Sam Reed
21d35067b9 Kill some more long deprecated unused functions
Add more @deprecated since where appropriate
2011-05-06 21:09:34 +00:00
Daniel Friesen
8a1b7a1d1d Add a getSkin that returns a dummy linker for BC with extensions still abusing it to access the linker. 2011-04-03 23:32:52 +00:00
Daniel Friesen
e844afb09c Followup r85244; Define all methods as static, implement a DummyLinker to forward calls for passing to hooks and finish off anything in the way. 2011-04-03 12:04:04 +00:00
Daniel Friesen
c817a24081 Drop connetion between Skin and Linker and turn Linker into a staticly usable class. 2011-04-03 11:44:11 +00:00
Sam Reed
e1f5c11aee More bits of documentation 2011-02-27 15:23:41 +00:00
Alexandre Emsenhuber
19f1eccc53 Per Platonides; follow-up r78201: add "stubthreshold" to ParserOptions; also provides a proper fix to r81765 2011-02-20 15:03:25 +00:00
Sam Reed
7d98280f3e More function and variable documentation 2011-02-19 01:02:56 +00:00
Platonides
8272ebfe6b Hack to shortcut it to zero until User::getStubThreshold() produces a call to optionUsed() 2011-02-08 17:58:53 +00:00
Robert Leverington
2a30aa1d25 Add new hook ArticlePrepareTextForEdit, called when preparing text to be saved.
Add new parser option "PreSaveTransform" that allows the pre-save transformation to be selectively disabled.
2011-01-16 21:12:26 +00:00
Platonides
8de91ab2e4 Partial revert of r79520, follow up to r79558. Unconditionally use the new format.
For environments post r70783, they will need to rerender pages with __NOEDITSECTION__ or no headings (hopefully those will be simple pages).
There will be no extra parser cache misses for environments pre r70783.
2011-01-04 11:31:06 +00:00
Daniel Friesen
969561ae3c Try to output editsection markers instead of rendered editsection links and defer the rendering to a point where the markup does not need to be stored in the cache.
Doing this allows skins to override doEditSectionLinks without poluting the parser cache or fragmenting the parser cache more.
As a side effect it eliminates the primary cause of user language based parser cache fragmentation.
Because this makes most old parser cache entries invalid $wgUseEditSectionTokens is provided so that large installations like Wikipedia can keep their old parser cache entries.
2011-01-03 20:17:20 +00:00
Platonides
fe14fdefa7 Store the options used by the parsing in ParserOutput, per r70783 CR. 2010-12-26 19:21:45 +00:00
Alexandre Emsenhuber
933f0cd240 Fix for r78570: correct default value 2010-12-18 22:02:35 +00:00
Alexandre Emsenhuber
3da8358022 Moved constant values from initialiseFromUser() to class definition 2010-12-18 17:56:38 +00:00
Mark A. Hershberger
2e18112d60 Whitespace changes (before others) — “svn diff -x-w” shows no changes 2010-12-11 03:52:35 +00:00
Alexandre Emsenhuber
510309e4ab * (bug 19006) {{REVISIONUSER}} no longer acts like {{CURRENTUSER}} in some cases
* Removed other usages of $wgUser in Parser stuff, as stated in doc
* Added mechanism to get an User object in Parser, based either on the object given in Paser::preSaveTransform() or the ParserOptions otherwise
2010-12-10 18:17:20 +00:00
Priyanka Dhanda
3d0db4ad13 Using getDateFormat instead of mDateFormat in ParserOptions::optionsHash. This was causing parser cache misses when using ApiParse 2010-11-01 23:00:53 +00:00
Ryan Kaldari
4b4a065501 fixing per comments at r70517 2010-09-29 17:25:17 +00:00
Sam Reed
9b52cb83b1 Add some $retval = '' before some wfShellExec 2010-09-02 22:15:20 +00:00
Alexandre Emsenhuber
dc50e1a4bf * Added file description headers
* Added @file where needed
2010-08-22 14:31:05 +00:00
Platonides
a72332929c getSkin() should get a Title as parameter. 2010-08-11 17:11:24 +00:00
Platonides
3f7fcd51a5 Add an extra option for extensions adding an extra key directly instead of the hook or $wgRenderHashAppend, so that they can be added only to some instances. 2010-08-10 14:38:14 +00:00
Platonides
34d35fb6f9 Use only the page relevant pieces in the parser cache key. Eg. two users with different math options will now
use the same parsercache entry for articles without <math> tags.
The cache key format is kept as a fallback so the old cached entries can be reused.

Should boost parsercache hits, but it also makes easier to pollute the parsercache by tag hooks that behave 
badly, directly using $wgUser or $wgLang.

Extensions hooking PageRenderingHash now see !edit=0 and the !printable=1 bits.

Fixes bug 24714 - Usage of {{#dateformat: }} in wikis without $wgUseDynamicDates can lead to unexpected results

Builds upon r70498, r70498, r70501, r70517, r70651, r70653, r70765, r70780.
2010-08-09 21:53:21 +00:00
Platonides
5001cf3583 Follow up r70653. Missing line. 2010-08-09 20:39:48 +00:00
Platonides
6d20e79faf Make thumbsize option go through ParserOptions.
Yet another parameter for makeImageLink2...
2010-08-07 22:35:23 +00:00
Platonides
3f4877b1a0 Revert r70533 and the piece of r70501 that it tried to fix. Note and open bug for the issue.
This has been present since introduction of {{#formatdate: }} in r48249 (bug 4582)
2010-08-07 21:21:28 +00:00
Platonides
9c143c5900 Use ParserOptions accessors.
Only one direct usage remains, in ParserCache::getKey, which will be rewritten.
2010-08-05 19:01:47 +00:00
Platonides
e1e71bde41 Make intfunction go accross the ParserOptions.
Things like calling setUserLang( true ) to use the content language are unsupported and shouldn't be done.
2010-08-05 18:43:49 +00:00
Platonides
3b8b3fd067 Move the math option inside ParserOptions instead of having Math.php directly sneaking into $wgUser.
Throw an exception if trying to use the DateFormat ParserOption and the UseDynamicDates option is not set.
2010-08-05 15:24:36 +00:00