dépôts
/
lhc
/
web
/
wiklou.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
69c8de3
)
Avoid getWithSetCallback() warnings on unversioned key migration
author
Aaron Schulz
<aschulz@wikimedia.org>
Wed, 8 Jun 2016 17:25:25 +0000
(10:25 -0700)
committer
Aaron Schulz
<aschulz@wikimedia.org>
Wed, 8 Jun 2016 17:25:25 +0000
(10:25 -0700)
If an unversioned key is present, this generated a warning
previously.
Bug: T137244
Change-Id: I92df9b9fe0436348b5b27e684d239238d57c9b5f
includes/libs/objectcache/WANObjectCache.php
patch
|
blob
|
history
diff --git
a/includes/libs/objectcache/WANObjectCache.php
b/includes/libs/objectcache/WANObjectCache.php
index
f12cb4c
..
45713cc
100644
(file)
--- a/
includes/libs/objectcache/WANObjectCache.php
+++ b/
includes/libs/objectcache/WANObjectCache.php
@@
-800,7
+800,15
@@
class WANObjectCache implements IExpiringStore, LoggerAwareInterface {
$key,
$ttl,
function ( $oldValue, &$ttl, &$setOpts ) use ( $callback, $version ) {
- $oldData = $oldValue ? $oldValue[self::VFLD_DATA] : false;
+ if ( is_array( $oldValue )
+ && array_key_exists( self::VFLD_DATA, $oldValue )
+ ) {
+ $oldData = $oldValue[self::VFLD_DATA];
+ } else {
+ // VFLD_DATA is not set if an old, unversioned, key is present
+ $oldData = false;
+ }
+
return [
self::VFLD_DATA => $callback( $oldData, $ttl, $setOpts ),
self::VFLD_VERSION => $version