It does not work with unserialize because RedisBagOStuff->unserialize
expects either strings of digits, or serialized strings. A plain integer
is neither.
incr docs were incorrect, so fix and expand by copying from parent class.
Change-Id: Ifc9c7a36f221b251ceea0d9a79ae6c3ce5753dd4
SqlBagOStuff::getMulti currently returns an array with false values for missed
cache keys.
Default BagOStuff::getMulti (and other specific implementations like memcached),
however, just omit missed values.
e.g.:
$cache->getMulti( array( 'goodkey' 'badkey' ) );
should return
array( 'goodkey' => 'value' );
instead of
array( 'goodkey' => 'value', 'badkey' => false );
Bug: 65637
Change-Id: Ib2de06a0f76421094707f7ad4218346087f4dc55
Includes implementions for Redis, Sql and MemcachedPecl,
other types will fallback to using $this->set repeatedly.
Change-Id: I0924a197b28ee69e883128ccd672343e5c041929
* This can limit how many workers work on a given file at once,
regardless of which specific thumbnail parameters are requested.
* Also added a BagOStuff::incrWithInit() method per DRY.
* Tweaked the register_shutdown_function() callback to avoid
File/MediaTransformOutput references, since they may involve
TempFSFile objects.
Change-Id: Ic01461cb974ab23b179ac3b60cf6de12e36360f6
Changed closure to capital word Closure in doc and type hint,
also changed callback in docs to callable
Change-Id: I52c8e8f13d38a837052101c38b9986be780ca057
Swapped some "$var type" to "type $var" or added missing types
before the $var. Changed some other types to match the more common
spelling. Makes beginning of some text in captial.
Also added some missing @param.
Change-Id: I86fd10e3f2d4bb80e7432533038d124693acfb3c
Variants included 'in <version>', 'as of <version>' and just the
version number.
Some @deprecated annotations do not have the version number at all,
I want to hunt them down separately.
Change-Id: I8208c6097098f4735d4f51bc42254675f1f27f6d
- Added spaces after if/foreach/catch
- Added new line before end of file
- Added or removed spaces before/after parenthesis, comma
- Added spaces around string concat
Change-Id: I0590070f1b3542108e242730e8d9a3ba9831e94f
* Almost nothing actually uses this (one extension)
as it doesn't really solve race conditions like merge().
* Removed subclassed versions too.
Change-Id: I4d4123afcc0576a90a3cbf1e4e6daff7ebce39c3
Isn't useful outside of testing as the comments state, but it's
barely even useful for that. People who are testing the cache
code can use CACHE_DB if CACHE_MEMCACHED is too hard.
Change-Id: Ief0aa148376957fdd844c8bb585a133b854a012c
mehcache isn't a caching system, it's a pun.
I'm removing Ehcache support because it's an experiment didn't pan out
and the code's just sitting here abandoned now.
Change-Id: Ief5728b4c61bb5ad8f5a5f0b55415b23ef6727eb
For caches where CAS is not natively supported, we have a workaround, where the
CAS token is (based on) the stored value.
To confirm the data can be written to cache, the CAS token is compared against
"whatever is currently in cache", so we pull the cached data and rebuild the
value.
In the case of objects, we have now pulled & rebuilt (unserialized) 2 objects
that are actually the same object (for CAS purpose - it's the correct value to
overwrite), but in terms of ===, they're 2 different values.
This patch should make sure CAS tokens are always a serialized version of the
value we're saving (where no native CAS exists); these serialized versions can
reliably be compared.
Bug: 59941
Change-Id: I2760416c48f2ceb7a0e0c874dd70ec07b4dccdfc
* This works with local memcached (e.g. unix:///var/run/memcached/memcached.sock:0 )
and noticeably increases memcached mediawiki performance
Change-Id: Ie08c151caa09eb0a4269df88965d71c2367c398b
* Avoid serializing scalars like the memcached client does.
This means incr/decr can be fast and preserve the TTL.
* Properly call unwatch() in the cas() method.
* Made the expiry set on add() actually atomic.
* Also cleaned up the profiling calls.
bug: 56069
Change-Id: I3e0d1c4888062544c54aef32085f8ce608ff5423
The Line continuation Coding conventions prefers the closing parenthesis
on the same line than the beginning curly braces. This is done for ifs
and functions.
Also move some boolean operator from the end of a line to the beginning
and changed some indentation to make the condition hopefully better
readable.
Change-Id: Id0437b06bde86eb5a75bc59eefa19e7edb624426
Due to the PHP serialization, the Redis native INCR and INCRBY do not
work. This instead falls back on the parent class's incr, which uses
lock and unlock, and incrementing on the PHP side.
Bug: 55986
Change-Id: I500199aeb935963ca118fde163bd7ba0cba8f79f
Also removed some unnecessary ones. I think I've caught them all.
The spaceless version already appears in core ~300 times (after
accounting for false positives when grepping). Some consistency would
be nice.
Change-Id: I607655b5f4366e66dc78730d5fd2f57ed8776cae
When BagOStuff::lock() was called, it called $this->add() with only
two parameters, the key and the timeout. But BagOStuff::add() takes
three parameters (key, value, timeout), so all locks got an infinite
timeout.
Change-Id: I82bed11b0b799f2cda13a8a0bd0cd94908b6ce8e
And added/removed spaces around some other tokens,
like +, -, *, /, <, >, =, !
Fixed windows newline style
Change-Id: I0b9c8c408f3f6bfc0d685a074d7ec468fb848fc8
* Removed spaces around array index
* Removed double spaces or added spaces to begin or end of function
calls, method signature, conditions or foreachs
* Added braces to one-line ifs
* Changed multi line conditions to one line conditions
* Realigned some arrays
Change-Id: Ia04d2a99d663b07101013c2d53b3b2e872fd9cc3
* Ran spell-checker over code comments in /includes/
* A few spellchecking fixes for wfDebug() calls
Found one very strange (NOOP?) line in Linker.php - see "TODO: BUG?"
Change-Id: Ibb86b51073b980eda9ecce2cf0b8dd33f058adbf
Doxygen expects parameter types to come before the
parameter name in @param tags. Used a quick regex
to switch everything around where possible. This
only fixes cases where a primitve variable (or a
primitive followed by other types) is the variable
type. Other cases will need to be fixed manually.
Change-Id: Ic59fd20856eb0489d70f3469a56ebce0efb3db13