From: Daimona Eaytoy Date: Sun, 14 Apr 2019 17:13:48 +0000 (+0200) Subject: Cache: Make APCUBagOStuff::set return a useful value X-Git-Tag: 1.34.0-rc.0~1976^2 X-Git-Url: https://git.cyclocoop.org/%242?a=commitdiff_plain;h=7dc4f6c83291b005cce83249564ad8a22da51e50;p=lhc%2Fweb%2Fwiklou.git Cache: Make APCUBagOStuff::set return a useful value It took me lots of time to debug a CI failure in I9b3bc36b552901bc6ca7609ee51e80be2979a9c4. I was deceived by $cache->set returning true, which according to the docs means that the store was successful. But instead, this function just returns true, even in case of failure. Make it return the result of apcu_store, which is already in the format true = success, false = failure. Change-Id: I2619845c12460e1acb5af696d2c11a5a4dee1bd3 --- diff --git a/includes/libs/objectcache/APCUBagOStuff.php b/includes/libs/objectcache/APCUBagOStuff.php index 0483ee7ef2..ed4eb35cd7 100644 --- a/includes/libs/objectcache/APCUBagOStuff.php +++ b/includes/libs/objectcache/APCUBagOStuff.php @@ -54,13 +54,11 @@ class APCUBagOStuff extends BagOStuff { } public function set( $key, $value, $exptime = 0, $flags = 0 ) { - apcu_store( + return apcu_store( $key . self::KEY_SUFFIX, $this->serialize( $value ), $exptime ); - - return true; } public function add( $key, $value, $exptime = 0, $flags = 0 ) {