The module provides a generic bucketing function - it accepts an
experiment specification and a token that identifies a unique user - and
doesn't have any side effects, i.e. the bucket isn't persisted to
storage. It is therefore assumed that clients are responsible for either
storing the token or storing the bucket for the duration of an
experiment.
The module was extracted from the - admittedly, unused - module of the
same name in the MobileFrontend extension as it's intended to be used by
the Gather and QuickSurveys extensions.
Bug: T109010
Change-Id: Icf7f6fedf0c2deb5d5548c9e24456cc7a7c6a743
In the interest of not blocking other work, I4b0e55fe worked around an
issue locally in ApiParse while filing T110269 for the larger task that
would be needed to properly fix the problem.
This adds a @todo comment referring to that task to make the situation a
bit more clear, since I4b0e55fe was merged too hastily to get the
comment included there.
Change-Id: I5be690aa5316cba1d498358635d497aa465a9972
Set the $commit parameter of WikiPage::doDeleteArticle() to true so
the transaction it starts is explicitly committed. Also fixed similar
bugs in two other maintenance scripts.
Follows-up 02f17b5790.
Bug: T110189
Change-Id: Ifde98066e25cb616f23c8998f9461ebf7a2073d6
* Rename disablepp to disablelimitreport, since it does not disable the
preprocessor (which is what PP stands for in "NewPP").
* Introduce new option "disabletidy" for T89331
* Suppress the use of the parser cache when options are specified that
affect the output but are not in ParserOptions::optionsHash(). This
was already broken, but the damage was fairly limited since the
options rarely caused user-visible changes. It would break very badly
if I use the disabletidy option for what I am intending.
Change-Id: I4b0e55fe34e237a68450f583bf59bab7dd703a29
The xenon logs on performance.wikimedia.org show this function as being on-CPU
about 1% of the time, making it a candidate for optimization. The version in
this patch is about 30-50% faster in my benchmarks.
Change-Id: I26385ade7600fc11965d94468b57e41ec257de51
There are imho too many ObjectCache methods, $wg*Cache* variables,
CACHE_ types, and wfGet*Cache() functions to know which ones
should actually be used publicly. This should make it easier to
know which ones should be used.
The difference between them was also harder to understand with the
main documentation sections about each of these living in
conceptually different places:
- classes (WANObjectCache)
- methods (ObjectCache::getMainStashInstance)
- variables (DefaultSettings: wgMainCacheType, wgMainWANCache, wgMainStash)
Also:
* Correct wfGetCache() documentation.
* Add the missing keywords for 'public' visibility.
Change-Id: I3b05fdb8b7888bf7e3f05bdca36538f3484556b8
Also remove confusing use of $wgMemc in LoadMonitorMySQL which
should always be the same as wfGetMainCache().
Change-Id: I4fb9d075a37d3d45af71a5026ccf2eb17f24d7b0
* Placed an LB shutdown() call in dePreOutputCommit() so that the
positions are properly included in sessions before session write().
They need to be part of the synchronous updates that happen before
the user gets the response, otherwise it defeats the whole point of
the system.
Bug: T101224
Change-Id: Idf367c2aa9aae432a0c4d7cc697366aa544d77f2
The finishUpload() function did not check for errors previously, which
caused errors that only surface at this point (e.g. invalid file name)
to be ignored.
Change-Id: I61a1e6bb93b6db34e875689c5d769a1b7e4db0be
* mw.Api#ajax can already handle FormData, if instructed to, since
d19432a332 (which seems to have been a
part of mobile uploads experiments).
* MobileFrontend's api.js already had code to provide upload progress
events while using mw.Api, lifted it from there.
With this change, we should be able to just use mw.ForeignApi (being
added in Ic20b9682d28633baa87d22e6e9fb71ce507da58d) to upload to a
different wiki. (Assuming that the browser supports FormData.)
Additionally:
* Improve detection of whether we can use FormData: if we are given a
HTMLInputElement, try to get a File from it before we fall back to
iframe form upload.
* mediawiki.api.edit: In #postWithEditToken, pass through the
ajaxOptions parameter to #postWithToken.
Change-Id: Ib9abe32ee3320c67ac0a4544c942b844a5550562
For some reason, slaves but not masters are filesorting on the query
here. So add another special case for MySQL to vary the query in a
manner that makes both happy.
Bug: T78276
Change-Id: I4d0c48e7c28f6a6b2e8c317275d15301bf158f03