Commit graph

62 commits

Author SHA1 Message Date
Siebrand Mazeland
dfc7416fbe Various documentation updates for includes/parser/
Change-Id: I16dd3a792cc83f8c80b3652d42c055730f6d177a
2014-05-11 18:18:26 +02:00
Siebrand Mazeland
2527cca6de Fix most CodeSniffer issues in includes/parser/
Remaining are the classes containing underscores and possibly a few other
issues that will be addressed soonish.

Change-Id: Icf56374c71afc134420ebbcfecf12dcb29dc9564
2014-05-11 08:44:52 +00:00
umherirrender
7f9fd63901 Fixed some @params documentation (includes/parser)
Swapped some "$var type" to "type $var" or added missing types
before the $var. Changed some other types to match the more common
spelling. Makes beginning of some text in captial.
Also added some missing @param.

Change-Id: I49f8f48b521878de7abd9cc40efdeff6cf9a37e0
2014-04-22 01:38:39 +02:00
umherirrender
725d9d125d Removed unneeded spaces and colons in @param and friends
Also swapped some "$var type" to "type $var" or added missing types
before the $var. Changed some other types to match the more common
spelling. Makes beginning of some text in captial.

Change-Id: Ic36c8c7820a6c2d603f1138130670c6bf6a1ca59
2014-04-08 16:02:49 +00:00
Brad Jorsch
78aad9802d Include parsed revision ID in parser cache
One theory for what's behind bug 46014 is that the vandal submits the
edit, then someone (maybe the vandal) gets into the branch of
Article::view that uses PoolWorkArticleView, then ClueBot comes along
and reverts before the PoolWorkArticleView actually executes. Once that
PoolWorkArticleView actually does execute, it overwrites the parser
cache entry from ClueBot's revert with the one from the old edit.

To detect this sort of thing, let's include the revision id in the
parser cache entry and consider it expired if that doesn't match. Which
makes sense to do anyway.

And for good measure, let's have PoolWorkArticleView not save to the
parser cache if !$isCurrent.

Bug: 46014
Change-Id: Ifcc4d2f67f3b77f990eb2fa45417a25bd6c7b790
2014-04-01 12:15:34 -04:00
jenkins-bot
c131c00ea5 Merge "Document parser cache key control." 2014-02-08 19:40:57 +00:00
Siebrand Mazeland
0eb2e0c6d8 Update documentation for ParserCache::save()
The second parameter is a WikiPage, not an Article. Rename the variable
to $page to avoid confusion.

Change-Id: I4655aa9d8c7469805362c8ec43559bb5f9be4b06
2014-01-02 14:13:19 +00:00
tonythomas01
247b8ede25 Removed trailing whitespace from ParserCache.php
Follow up from Change I705a056665.

Change-Id: I31bdede4347b1d55be113e8ba7c44f3683c2ab46
2013-12-30 20:22:49 +00:00
tonythomas01
3006f76fdf Removed const ParserCache::try116cache
Version 1.16 is long ago and there seems no need to keep the const
ParserCache::try116cache in core.
Removed the if(self:: try116cache) block

Bug: 59127
Change-Id: I705a056665441f81516a4dbb6fe317a44da91d43
2013-12-31 00:36:58 +05:30
daniel
22e75a7ca7 Document parser cache key control.
This documents how implementations of the Content interface
can control the parser cache key by calling ParserOutput::recordOption()

Change-Id: I9e8ad1e33e06aceea6e63c7d5575679f84ce4004
2013-12-03 12:56:29 +01:00
Siebrand Mazeland
3f968db2cc Update some documentation in CacheTime and ParserCache
Change-Id: I31be0d4639f2a7189e15b622b34595564fad2a3d
2013-11-17 20:25:37 +00:00
Aaron Schulz
9750150c2e Reduce chance for parser cache race conditions
* Move cache time definition to happen before parse so it is less likely
  to override the cache with a stale value and a high cache timestamp.

bug: 46014
Change-Id: I021d27885ac260d89232ff11ec3cccf976e44f0f
2013-09-24 13:57:51 -07:00
umherirrender
6c38a5eb72 Fixed spacing in logging/parser/profiler/rl/revdel/search folder
Added spaces before if, foreach
Added some braces for one line statements

Change-Id: I11bbcfa351e945b7bde10c2105d61a3cf5622205
2013-04-20 17:38:24 +02:00
umherirrender
570dda0455 fix some spacing
Change-Id: I88e73d47a552918880514d88a876296a6cb80d88
2013-02-04 20:09:18 +00:00
umherirrender
85d8ee1f87 Remove a bunch of trailing spaces and unneeded newlines
Change-Id: I00f369641320acd7f087427ef031f3ee7efa0997
2012-10-10 20:14:40 +02:00
Siebrand Mazeland
d4b046a893 Update docs for return and exception info
* Removed some inline tabs in the process.
* IDE fixed some incorrect leading spaces, too.

Change-Id: Ic9303eff6db4424ac3f1fa2816839692b43e6190
2012-10-09 09:41:58 +00:00
Antoine Musso
d5737f8f17 update @param @return doc in several files
Change-Id: I0e23227330f90dc4121fd2a313d2e9a33c3c97a7
2012-07-10 17:08:52 +02:00
Alexandre Emsenhuber
0fc8c8e14e Added missing GPLv2 headers in some places.
Also made file/class documentation more consistent.

Change-Id: I10c077f27a2077a266a64048fa137f7b1f8e226c
2012-05-01 09:05:48 +02:00
Sam Reed
c052fc3b7b Documentation followups from lastnight 2012-02-10 15:37:33 +00:00
Sam Reed
2ec09c5165 More return documentation 2012-02-09 21:35:05 +00:00
Sam Reed
f3cc77aaee Fixing some of the "@return true" or "@return false", need to be "@return bool" and then the metadata can say true if foo, false if bar
Other documentation improvements
2012-02-09 17:41:50 +00:00
Antoine Musso
fc6bc233be Fix doxygen docs before REL1_19 branching 2012-02-01 20:53:38 +00:00
Alexandre Emsenhuber
f5b75f1e98 Cleanup to statistics:
* Removed 'pcache_miss_invalid' from stats.php and clear_stats.php, no longer used
* Added missing 'job-insert' and 'job-pop' to clear_stats.php
* Added missing call to wfIncrStats( 'pcache_miss_absent' ) when there's no key in ParserCacge::get()
* Removed useless 'pcache_not_possible' stat from OutputPage::addWikiTextTitle() since that function is mostly used for interface messages
2012-01-23 16:27:13 +00:00
Alexandre Emsenhuber
2629c3649f * Added revision's timestamp to OutputPage along with revision ID; avoid a DB hit in Skin::lastModified() when showing parser cache's content. This changed with the removal of $wgArticle in Skin since now it's a different WikiPage object and thus WikiPage::setTimetstamp() call is useless (but still kept).
* Added ParserOutput::(get|set)Timestamp() and the $mTimestamp member; avoid messing with isset()
2011-12-10 16:30:40 +00:00
Antoine Musso
30fc9f2913 update ParserCache debug message
"Found." was not very helpfull when indicating we found a cached
ParserOutput object.
2011-11-08 09:08:15 +00:00
Platonides
4d065bb19f Bug 31445: "Section edit links do not show"
Always generate the mw:editsection placeholders.
Remove them if not used.
Update the ParserOutput if fetching from ParserCache
2011-10-07 20:50:10 +00:00
Robin Pepermans
4f0d606069 r97636: ParserCache meant to be committed already too 2011-09-20 15:58:01 +00:00
Niklas Laxström
c48b41201a Revert r96798 - makes parser go infinite loop somewhere 2011-09-14 11:23:58 +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
Sam Reed
53851419a1 Upstreaming wikia change to WebRequest
Trim trailing whitespace

Tweak documentation
2011-08-18 00:54:06 +00:00
Sam Reed
896f05efde Trim trailing whitespace
Add documentation

Remove unused variables

Remove an extract from ImageFunctionsTest
2011-07-24 21:36:04 +00:00
Aaron Schulz
930ccf282c * Split off WikiPage class from Article, WikiFilePage class from ImagePage, and WikiCategoryPage from CategoryPage.
* WikiPage functions/fields are "magically" part of Article when accessed for b/c. Magic is kind of ugly but there are too many callers to make breaking changes atm. Some functions are just wrappers for WikiPage ones (were magic won't work).
* Added newFromID() to each WikiPage subclass (works around pre-existing inheritance problem).
* Added Page class for convenient type hinting and changed hints from Article -> Page. This lets things use WikiPage objects without getting type errors.
* Updated FlaggedPage to extend WikiPage. Worked around getOldIdFromRequest().
* Added setTimestamp() to WikiPage and moved some timestamp setting code from ParserCache to Article.
* Removed ampersands from $dbw arguments.
* @TODO: dependency inject user objects for WikiPage

The idea is to migrate things to use WikiPage, as the run-of-the-mill "new Article()" call doesn't care about $oldid and $wgRequest. After that, Article, ImagePage, and CategoryPage can be rewritten as an Action class or something sane (a Viewer class of sorts).
2011-06-29 22:09:51 +00:00
Sam Reed
296f3d3f4f And even more documentation 2011-05-28 18:59:42 +00:00
Aaron Schulz
5801abee00 * Made __construct() protected
* Minor style and doc cleanups
2011-04-15 22:58:00 +00:00
Platonides
9a59164dbf Merge corrected r81741 and resolve the TODO.
Keep disabled with a class constant.
2011-03-07 19:13:19 +00:00
Sam Reed
7d98280f3e More function and variable documentation 2011-02-19 01:02:56 +00:00
Platonides
8c876f45e4 This precondition is no longer needed after r78393 2010-12-28 18:15:48 +00:00
Platonides
fe14fdefa7 Store the options used by the parsing in ParserOutput, per r70783 CR. 2010-12-26 19:21:45 +00:00
Platonides
f3aabaa1f7 Do not access to mTouched internals of Article from a different module per r70783#c12039 2010-12-14 17:49:01 +00:00
Sam Reed
43ae023260 Followup r77748, throw NEW MWException 2010-12-05 00:37:44 +00:00
Platonides
71cb2b4aa1 Revert r70202. Replace with an exception. 2010-12-04 23:36:54 +00:00
Platonides
2b9290fa6b Fix getDirty from r70783. 2010-09-15 16:58:44 +00:00
Alexandre Emsenhuber
60ae23bc9c Removed trailing spaces 2010-09-12 19:26:01 +00:00
Platonides
6e176bf6c6 Try to improve the funciton comment of getETag() per r70809 CR. Adaptation of Nikerabbit proposal. 2010-08-23 21:54:45 +00:00
Alexandre Emsenhuber
dc50e1a4bf * Added file description headers
* Added @file where needed
2010-08-22 14:31:05 +00:00
Platonides
48c2ecd244 Upgrade the warning from wfDebug to wfWarn. 2010-08-10 19:32:49 +00:00
Platonides
b1aee940fa Follow up r70783. Define variable used in debug message.
Provide the fallback prototype again, seems still used by extensions.
2010-08-10 14:11:51 +00:00
Platonides
dca6afc172 Follow up r70783 CR.
Document getETag()
2010-08-10 12:10:49 +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
7bfebad308 Change quickUserCan( 'edit' ) and getIsPrintable() into setEditSection( false )
Follow up r48544. Init ParserOptions::mIsPrintable in initialiseFromUser()
Move the "No edit section it's printable" from Parser to Article.
This leaves getIsPrintable() unused. Left there for extensions (none seems to be using it, could be removed).

The "even if the user has them on" comment wasn't accurate. The user preference only controls them via CSS.
Anyway, it would work as expected now if it got moved into ParserOptions. The setEditSection() no longer set it to true.

Remove the quickUserCan( 'edit' ) which is just a hidden way of calling $wgUser from the Parser to be explicitely 
done in Article to disable the editsection. This results in quickUserCan being called once instead of twice if $wgUseETag == true;.
2010-08-05 14:37:50 +00:00