Jeroen De Dauw posted a comment on MediaWiki.r114180.
URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/114180#c32382
Commit summary for MediaWiki.r114180:
make more generic: do not assume we want to add html to the output. Also get
rid of action=purge from key args
Jeroen De Dauw's comment:
Indeed, this is to bad. In my original version you could use these as you would
normally. That approach lacked the capability the have multiple blocks of
cached HTML (or other values for that matter) though. So it does not work for
pages that have non-cacheabale stuff through them. But it was definitely nicer
for the simplest use case where you simply want to cache the entire output of a
page (which possibly some non-cached stuff before and after).
What I did after that approach was trying to extend OutputPage, to have a
addCachedHTML method, which would be ideal. But I did not find a way to make
this work. The problem is that you have an instance of OutputPage and want to
change it into an instance of CachedOutputPage or whatever. Now since we got
comments and checks everywhere to make sure that this object derives from
OutputPage, CachedOutputPage better does this. So bye bye decorator pattern. If
you know a way to do this without changing all the checks to some interface or
whatever, then please let me know, because I think it would be nicer then what
I ended up with now. This is what I ended up with after trying to get it to
find a way to make it work (and then gave up on it):
http://svn.wikimedia.org/viewvc/mediawiki/trunk/extensions/EducationProgram/specials/SpecialCachedPage.php?revision=114044view=markuppathrev=114044
___
MediaWiki-CodeReview mailing list
mediawiki-coderev...@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-codereview