* To make this work, a slaveOnly flag was added to SqlBagOStuff
and it no longer prunes expired items on get(), it just treats
them as missing. The use of garbageCollect() for the writeFactory
cache and the use of replace() on updates already makes this
a non-issue.
* This also makes the default $wgMainStash non-bogus.
Bug: T88493
Change-Id: I9d1f31305e08430de29a3cd521cdb10a82dffd10
* The session will be renewed on access if it will expire in 10 minutes
* This avoids a problem both with 532ef78 + PHP <= 5.5 or any PHP >= 5.6
Bug: T102199
Change-Id: I8cad100bc35e86fa95ad144bcad338f3cb5d82a1
- Removed space after casts
- Removed spaces in array index
- Added spaces around string concat
- Added space after words: switch, foreach
- else if -> elseif
- Removed parentheses around require_once, because it is not a function
- Added newline at end of file
- Removed double spaces
- Added spaces around operations
- Removed repeated newlines
Bug: T102609
Change-Id: Ib860222b24f8ad8e9062cd4dc42ec88dc63fb49e
wfSuppressWarnings() and wfRestoreWarnings() were split out into a
separate library. All usages in core were replaced with the new
functions, and the wf* global functions are marked as deprecated.
Additionally, some uses of @ were replaced due to composer's autoloader
being loaded even earlier.
Ie1234f8c12693408de9b94bf6f84480a90bd4f8e adds the library to
mediawiki/vendor.
Bug: T100923
Change-Id: I5c35079a0a656180852be0ae6b1262d40f6534c4
* Whitespace.
* Simplify logic.
* Apply coding conventions to documentation blocks (empty line
before annotations, no empty lines between annotation, consistent
order of annotations).
Change-Id: I3e5268d6a6295643d5725c66ea2a01bccf610ed8
* This provides factory/config more appropriate for stashes
* Cleaned up some neighboring config comments while at it
Bug: T88493
Bug: T97620
Change-Id: Id370ee50be6e493a4700c858df863a183abc05fd
This class handles caching across distance sites where purges
must reach both. It also aims to make purging more reliable in
the face of network glitches and node consistent hash ejection.
bug: T88492
Change-Id: I686811b3075bf22e2f4de45127e8461e54648ead
Move the MWLogger PSR-3 logging related classes into the
MediaWiki\Logger namespace. Create shim classes to ease migration of
existing MWLoggerFactory usage to the namespaced classes.
Bug: T93406
Change-Id: I359cc81fbd2dcf8937742311dcc7d3dee08747b0
* Set a custom profiler with no expectations to avoid tripping
the "0 write" expection. This avoids useless log entries.
Change-Id: Iac849a729eb36b1a8affb0dbc8b8c195fab4b03a
The base BagOStuff class and some of the implementations are
not dependent on MediaWiki and can be in the libs folder.
Change-Id: I299f9abb778abc65a70461a2aff3015c02a1f04d
* merge() using the locking version by default. The callers that implement cas()
override merge() to use the cas-based version. Those that do not no longer
need to define the unused dummy method.
* Removed some redundant doc blocks.
Change-Id: I49f7dd5432efa8d76f4758c273f0859376ddafb7
ObjectCache::newFromParams() will handle a 'loggroup' parameter
specially, getting an instance of \Psr\Log\LoggerInterface to
pass to the BagsOStuff.
BagOStuff implementations can use $this->logger which will be
an implementation of \Psr\Log\LoggerInterface. As this is set in
BagOStuff::__construct(), all subclasses must now call the
parent constructor.
The goal of this is to make the logging in BagOStuff non-MediaWiki
specific, in the hopes of separating it out into a separate library
in the future.
Change-Id: I8a8e278e6f028814499d8457d6d5341d03eabc7a
Xhprof generates this data now. Custom profiling of various
sub-function units are kept.
Calls to profiler represented about 3% of page execution
time on Special:BlankPage (1.5% in/out); after this change
it's down to about 0.98% of page execution time.
Change-Id: Id9a1dc9d8f80bbd52e42226b724a1e1213d07af7
Partial deletion percentage progess was computed using
$remainingSeconds. This is incorrect since $remainingSeconds
is going to *decrease* ( instead of increase ) while the
process continues.
The correct implementation uses 'processed seconds' instead.
Change-Id: Ic745f6e8375a85da543de36703fad6d31f62ea90
Avoid an unnecessary serialize() call on get() requests, which makes it
faster and also happens to work around a nasty crash bug which is
causing lots of segfaults right now.
CAS semantics should be the same, if the caller handles a CAS token in
an opaque way and does not assume it is a string. I could only find one
caller of cas() in core and WMF deployed extensions, and that is
BagOStuff::mergeViaCas(), which does correctly handle CAS tokens of any
type.
Bug: 71724
Change-Id: I0b0b5f0157c005ec7f76210dfb8576c056314733