Commit graph

61 commits

Author SHA1 Message Date
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
Sam Reed
9d41b95053 Kill various unused variables
Comment some out also

Add some bits of documentation
2011-10-29 01:17:26 +00:00
Platonides
924d12407e We don't need anything from the marker. The title is outside. 2011-10-07 21:05:22 +00:00
Platonides
570b984533 Forgot to commit this file in r99250. 2011-10-07 21:00:06 +00:00
Sam Reed
937fc3bcfd Back out r95396 and friends 2011-09-29 22:08:00 +00:00
Aaron Schulz
b741bcd227 FU r84610: Renamed getImageTimeKeys() to getFileSearchOptions() 2011-09-14 19:05:43 +00:00
Sam Reed
44020e254c Merge the iwtransclusion branch back into trunk
Hexmode fixed broken unit tests in revisions after last time
2011-08-24 13:03:03 +00:00
Alexandre Emsenhuber
93075f0af3 Per Platonides, follow-up r93758: rename ParserOutput::addOutputPage() to ParserOutput::addOutputPageMetadata() to match its behaviour 2011-08-02 16:31:22 +00:00
Alexandre Emsenhuber
700aec3775 * (bug 15558) Allow includable special pages to be parameterized using wiki syntax
* Changed SpecialPageFactory::capturePath() to take the same parameters as SpecialPageFactory::executePath() (except the last one) and made it always return a bool instead of bool-or-string. The result HTML can be fetched from the OutputPage object of the context.
* Added module styles, scritps and messages members to ParserOutput in addition to modules. The first one is needed to display Special:RecentChanges correctly when transcluded since EnhancedChangesList::beginRecentChangesList() calls addModuleStyles( 'mediawiki.special.changeslist' )

Yes, this means that you can use {{Special:Recentchanges|enhanced=0}} to use the old changes list. For the ones that wonder, {{Special:Recentchanges|uselang=something}} will not work since the Language object is forced to the one used by the parser.
2011-08-02 15:40:03 +00:00
Mark A. Hershberger
cb2105b6a1 fixes Bug #27543 - “Warning: in_array() [function.in-array]: Wrong datatype for second argument in ParserOptions.php”
AFAICT, result of ParserOutput::getUsedOptions() is only used by ParserOptions::optionsHash() but that method doesn't account for a non-array value.

Patch supplied on bug.
2011-08-01 15:50:49 +00:00
Mark A. Hershberger
e201e2307d w/s changes: “svn diff -x-w” is clean 2011-08-01 15:40:02 +00:00
Sam Reed
183d2dab37 Back out r93533, r93531, r93530
Breaks unit tests as below, not going to be able to fix them before I disappear for the evening, so might aswell leave trunk clean

ArticleTablesTest testbug14404

Error:
ArticleTablesTest::testbug14404
Undefined offset: 0

/home/ci/cruisecontrol-bin-2.8.3/projects/mw/source/tests/phpunit/includes/ArticleTablesTest.php:31
/home/ci/cruisecontrol-bin-2.8.3/projects/mw/source/tests/phpunit/MediaWikiTestCase.php:60
/home/ci/cruisecontrol-bin-2.8.3/projects/mw/source/tests/phpunit/MediaWikiPHPUnitCommand.php:20
/home/ci/cruisecontrol-bin-2.8.3/projects/mw/source/tests/phpunit/phpunit.php:60

ParserTests testParserTest #552 - testParserTest with data set #551

Failure:
ParserTests::testParserTest with data set #551 ('RAW magic word', '{{RAW:QUERTY}}', '<p><a href="/index.php?title=Template:QUERTY&amp;action=edit&amp;redlink=1" class="new" title="Template:QUERTY (page does not exist)">Template:QUERTY</a>
</p>', '', '')
RAW magic word
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-<p><a href="/index.php?title=Template:QUERTY&amp;action=edit&amp;redlink=1" class="new" title="Template:QUERTY (page does not exist)">Template:QUERTY</a>
+<p><a href="/index.php?title=Template:RAW:QUERTY&amp;action=edit&amp;redlink=1" class="new" title="Template:RAW:QUERTY (page does not exist)">Template:RAW:QUERTY</a>
 </p>

/home/ci/cruisecontrol-bin-2.8.3/projects/mw/source/tests/phpunit/includes/parser/NewParserTest.php:545
/home/ci/cruisecontrol-bin-2.8.3/projects/mw/source/tests/phpunit/MediaWikiTestCase.php:60
/home/ci/cruisecontrol-bin-2.8.3/projects/mw/source/tests/phpunit/MediaWikiPHPUnitCommand.php:20
/home/ci/cruisecontrol-bin-2.8.3/projects/mw/source/tests/phpunit/phpunit.php:60
2011-07-30 15:56:54 +00:00
Sam Reed
dc9d39887e Merge iwtransclusion branch into trunk 2011-07-30 15:30:01 +00:00
Sam Reed
b15737fa83 And even more documentation, the last of this batch 2011-05-28 19:00:01 +00:00
Sam Reed
4c29198850 And some more.... 2011-05-28 17:51:33 +00:00
Aaron Schulz
3a49b629e6 Follow-up changes to r84610:
* Cleaned up mImageTimeKeys format
* ImageMap: Removed redundant addImage call (makeImage handes this)
* ParserFunctions: added time/sha1 to addImage() call
* Removed excess ampersands in hooks
* Added some function doc comments
2011-04-04 01:22:08 +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
Aaron Schulz
1ecbf96a58 Follow-up r84610: made makeImage() b/c for callers 2011-03-23 21:45:32 +00:00
Aaron Schulz
a2e9b8be7e * Put parser output file version tracking to core
* Added some ParserOutput accessors
* A few cleanups to fetchFile()
2011-03-23 17:35:40 +00:00
Alexandre Emsenhuber
9e0c678ddf Only call ParserOptions::getNumberHeadings() when needed for the benefit of cache sharing when this is not used.
Also fixed a bug in ParserOutput when no option is used; otherwise getUsedOptions() will return false and throw warnings in ParserOptions::optionsHash().
2011-03-06 21:16:22 +00:00
Sam Reed
7d98280f3e More function and variable documentation 2011-02-19 01:02:56 +00:00
Daniel Friesen
f0fd318a4e Followup r81583, break some of the long lines and centralize the regex. 2011-02-08 01:31:21 +00:00
Daniel Friesen
d06c054971 Switch <editsection> to <mw:editsection> and start hiding these editsection tags from Tidy so it doesn't break them. 2011-02-06 01:38:33 +00:00
Daniel Friesen
beded16563 *sigh* I was looking at parser tests, but not notices in a site this time... Followup r79558 fix a small php notice. 2011-01-04 04:23:01 +00:00
Daniel Friesen
d3b9fcdc4a Followup r79520 and r79528, one of the args was missing when calling doEditSectionLink. Additionally the LanguageConverter was screwing up editsection markers really badly. Switched to <editsection> pesudo-xml style markers for best compatibility with the language converter. (tags are already escaped so we don't need to worry about similar user input) 2011-01-04 04:20:09 +00:00
Daniel Friesen
ecd545b1fd Followup r79520, some characters inside the encoded data were being modified by the parser causing it to break. Switching to a encoding scheme without that issue and adding a test to throw a less fatal error. 2011-01-03 21:04:05 +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
Niklas Laxström
114c072177 Follow up r23393, also remove the getter method 2010-12-28 09:54:25 +00:00
Platonides
fe14fdefa7 Store the options used by the parsing in ParserOutput, per r70783 CR. 2010-12-26 19:21:45 +00:00
Roan Kattouw
f9066a7528 Fix indentation 2010-09-27 12:30:04 +00:00
Roan Kattouw
32377424b9 Merging resourceloader branch into trunk. Full documentation is at http://www.mediawiki.org/wiki/ResourceLoader and a general overview has been posted on wikitech-li <http://lists.wikimedia.org/pipermail/wikitech-l/2010-September/049253.html>. One important change is that all JS is now loaded at the bottom, so any scripts assuming things from wikibits or whatever are present will fail. 2010-09-04 04:00:09 +00:00
Chad Horohoe
9e6c7cc8ef Get rid of PHP4-style constructors 2010-08-30 16:52:51 +00:00
Alexandre Emsenhuber
dc50e1a4bf * Added file description headers
* Added @file where needed
2010-08-22 14:31:05 +00:00
Platonides
0825b757f6 Move pieces related to ParserOutput expiry into a new CacheTime class. 2010-08-09 14:58:08 +00:00
Bryan Tong Minh
a3aac44f04 (bug 14685) Double underscore magic word usage is now tracked in the page_props table, as well as the behavioral magic words {{DEFAULTSORT}} and {{DISPLAYTITLE}}. 2010-07-10 11:30:11 +00:00
Chad Horohoe
6d993be4c5 Partial revert r67707, included half-baked patch 2010-06-09 11:54:18 +00:00
Chad Horohoe
44229b50e6 Fixed a bunch of silly instances of [^!=]==\s*(true|false) 2010-06-09 11:44:05 +00:00
Daniel Kinzler
36c68af119 allow parser/extensions to control for how long a ParserOutput gets cached. Introduced updateCacheExpiry(), Cleaned up use of getCacheTime() for marking uncacheable objects. 2010-06-01 14:28:51 +00:00
Alexandre Emsenhuber
2c5cd049a7 Fixed some doxygen warnings 2010-05-15 20:16:26 +00:00
Brion Vibber
e1d1404372 Cleanup for bugs in r65104 (iwlinks table), that'll teach me not to commit at 4am after drinking with the wikimedia devs! 2010-04-18 00:39:12 +00:00
Brion Vibber
8eac509ab5 * (bug 14473) Add iwlinks table to track inline interwiki link usage
Like langlinks, this stores the interwiki prefix (as iwl_prefix) and full page title (as iwl_title), attached to the page doing the liking (as iwl_from -> page_id).
Unlike langlinks, there can be multiple entries stored per interwiki prefix.

Updater to add the table confirmed on MySQL, untested on SQLite but should work.
Someone may still need to add and test a PostgreSQL updater.

Refactored makeWhereFrom2d() out of LinkBatch to Database so it could be re-used for the similar mapping for the interwiki links, which need a string prefix rather than an int namespace key.
Also cleaned it up internally to reuse existing code for building where clauses from arrays. (Tim & Domas -- if the previous more verbose code was there to reduce function call and array processing overhead on very large link lists, feel free to unroll it again if the difference is measurable. Just swap the var names around from the old LinkBatch code and escape the base key value if it's not an integer, it'll be functionally equivalent.)
2010-04-16 01:40:05 +00:00
Mark A. Hershberger
5259e9009d * When I found it, I cried. fixes bug #22501
* Also, fix up showtitle for parser tests to always give a title, whether we're setting a display title or not.
2010-02-16 03:37:19 +00:00
Sam Reed
8e0e897034 * (bug 22061) API: add prop=headitems to action=parse
Patch contributed by Paul Copperman
2010-01-16 13:07:58 +00:00
Mark A. Hershberger
96bcae9729 follow up r61101, fix cut-n-paste error 2010-01-15 19:48:34 +00:00
Mark A. Hershberger
2800ca2db7 follow up r60832 and follow up r60763
* Don't set Parser::$mTitle to random garbage.
* Remove ParserOutput::$displayTitle, make setDisplayTitle() and
  getDisplayTitle() wrappers for their *TitleText() equivalents.
* Remove Parser::$mDo*Convert member variables, move test for
  $mDoubleUnderScores[] directives closer to the action.
* Remove bogus "global $wgContLang".
* Use accessor to get at $mConvRuleTitle
* Fix up showtitle option in parserTests.inc
* TODO: refactor FakeConverter class away
2010-01-15 19:14:23 +00:00
Alex Z
95ef1b6fd6 (bug 19814) - Interwiki links from file links - [[File:Foo.jpg|link=de:Test]] - are no longer recorded in the pagelinks table
Also update Parser::makeImage() docs for the link option
2009-07-18 22:49:31 +00:00
Domas Mituzas
f0c63dfe2f good catch, $wgServer definitely needs trailing slash added =) 2009-07-11 08:15:37 +00:00
Domas Mituzas
f7f573c3d0 Fix Bug#19637 - self-referencing externals will be by default filtered out 2009-07-11 08:04:31 +00:00
Roan Kattouw
ae130186e8 Core changes for NavigableTOC extension:
* Add TOC HTML to ParserOutput
* Add class tocsection-$section to <li> elements in the TOC representing sections in the current page (as opposed to transcluded sections)
2009-06-20 21:47:10 +00:00
Brion Vibber
92079d3b1c * (bug 16335) __NONEWSECTIONLINK__ magic word to suppress new section link.
Patch by Carlin: https://bugzilla.wikimedia.org/attachment.cgi?id=5680
With slight whitespace tweaks.
2009-02-19 22:14:59 +00:00