dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "Fix and make some types in PHPDoc and JSDoc tags more specific"
[lhc/web/wiklou.git]
/
includes
/
libs
/
objectcache
/
MultiWriteBagOStuff.php
diff --git
a/includes/libs/objectcache/MultiWriteBagOStuff.php
b/includes/libs/objectcache/MultiWriteBagOStuff.php
index
9dcfa7c
..
d94578d
100644
(file)
--- a/
includes/libs/objectcache/MultiWriteBagOStuff.php
+++ b/
includes/libs/objectcache/MultiWriteBagOStuff.php
@@
-181,6
+181,12
@@
class MultiWriteBagOStuff extends BagOStuff {
$ret = true;
$args = array_slice( func_get_args(), 3 );
$ret = true;
$args = array_slice( func_get_args(), 3 );
+ if ( $count > 1 && $asyncWrites ) {
+ // Deep-clone $args to prevent misbehavior when something writes an
+ // object to the BagOStuff then modifies it afterwards, e.g. T168040.
+ $args = unserialize( serialize( $args ) );
+ }
+
foreach ( $this->caches as $i => $cache ) {
if ( $i >= $count ) {
break; // ignore the lower tiers
foreach ( $this->caches as $i => $cache ) {
if ( $i >= $count ) {
break; // ignore the lower tiers
@@
-226,4
+232,12
@@
class MultiWriteBagOStuff extends BagOStuff {
return $ret;
}
return $ret;
}
+
+ public function makeKey() {
+ return call_user_func_array( [ $this->caches[0], __FUNCTION__ ], func_get_args() );
+ }
+
+ public function makeGlobalKey() {
+ return call_user_func_array( [ $this->caches[0], __FUNCTION__ ], func_get_args() );
+ }
}
}