Commit graph

9 commits

Author SHA1 Message Date
Aryeh Gregor
5e2199c5b0 BadFileLookup to replace wfIsBadImage
I think this probably shouldn't be directly in the MediaWiki namespace,
but I don't know where is a better place to put it.

In order to avoid gratuitous use of TitleFormatter, I changed the cache
format -- the old implementation used getPrefixedDBkey() and I switched
to an ns/dbkey pair. I also changed the cache keys to use SHA1 instead
of MD5, by Daniel's request.

The previous implementation cached the parsed blacklist for one minute
without invalidation, so it could return slightly stale results, but it
didn't retrieve the bad image list message on a cache hit. The new
implementation unconditionally retrieves the bad image list message, but
uses a hash of it in the cache key and caches for one day. The new
behavior happens to be more cleanly implementable in a service.

Bug: T200882
Bug: T139216
Change-Id: I69fed1b1f3cfc1aa149e0739780e67f6de01609d
2019-08-21 20:45:37 +03:00
Aaron Schulz
3a044ca51c parser: inject a Logger into Parser instead of using wfDebug()
Add Parser::setOutputFlag helper method to reduce code duplication.
Also, clean up various Parser and SaveParse debug log messages.

Bug: T226785
Change-Id: I5dce2220bd43f5d642c017b88d02870dcb92f44e
2019-07-17 21:30:55 -07:00
Aryeh Gregor
7149153754 Don't pass Config to Parser(Factory)
Change-Id: I5996b7cad8c8a61518d2997e955a4547c64a73a5
2019-05-20 11:19:21 -05:00
Aryeh Gregor
80590a15dc Update Parser to use NamespaceInfo
Change-Id: I668a51487786e4ab05a153ca3995388e79c13b42
2019-04-11 15:40:49 +03:00
Aryeh Gregor
21f7ab7e22 Inject LinkRendererFactory into Parser
Change-Id: Idaf5a0f897dc3bd2aa9bf03be280281836bfc645
2019-04-07 15:02:30 +03:00
Aryeh Gregor
5173d5ee60 Inject Config into Parser instead of using globals
Change-Id: Ib4394f370cb561ccf195338a1c2e9e465dcb3dc3
2018-10-02 21:26:01 +03:00
Kunal Mehta
2852255186 Inject SpecialPageFactory into Parser
Change-Id: I6a6a94cbdafdc724ce02408cd9e744e7b3eda92b
2018-08-17 12:03:13 -07:00
Aryeh Gregor
bca6085920 Use ParserFactory in a bunch of places
I wasn't sure how to convert the rest of the occurrences in core (there
are a significant number).

Bug: T200881
Change-Id: I114bba946cd3ea8a293121e275588c3c4d174f94
2018-08-11 00:16:17 -06:00
Aryeh Gregor
62515f7b15 Introduce ParserFactory service
Bug: T200881
Change-Id: I257e78200983cb10afb76de1f07dd1b9d531c52a
2018-08-11 00:15:52 -06:00