From: Aaron Schulz Date: Fri, 8 Mar 2019 21:11:54 +0000 (-0800) Subject: objectcache: move ERR_* constants to IExpiringStore X-Git-Tag: 1.34.0-rc.0~2596^2 X-Git-Url: http://git.cyclocoop.org/%28?a=commitdiff_plain;h=74be3a015069ca50ce30e13ae58b9607758ef93b;p=lhc%2Fweb%2Fwiklou.git objectcache: move ERR_* constants to IExpiringStore Also removed unused ERR_* constant from WANObjectCache and fixed comment in the constructor. Change-Id: I4377fc3f533113a459b648fad084ba097ff51762 --- diff --git a/includes/libs/objectcache/BagOStuff.php b/includes/libs/objectcache/BagOStuff.php index a3c020e98d..6f1fa69195 100644 --- a/includes/libs/objectcache/BagOStuff.php +++ b/includes/libs/objectcache/BagOStuff.php @@ -87,12 +87,6 @@ abstract class BagOStuff implements IExpiringStore, LoggerAwareInterface { /** @var int[] Map of (ATTR_* class constant => QOS_* class constant) */ protected $attrMap = []; - /** Possible values for getLastError() */ - const ERR_NONE = 0; // no error - const ERR_NO_RESPONSE = 1; // no response - const ERR_UNREACHABLE = 2; // can't connect - const ERR_UNEXPECTED = 3; // response gave some error - /** Bitfield constants for get()/getMulti() */ const READ_LATEST = 1; // use latest data for replicated stores const READ_VERIFIED = 2; // promise that caller can tell when keys are stale diff --git a/includes/libs/objectcache/IExpiringStore.php b/includes/libs/objectcache/IExpiringStore.php index 7bab20a3b9..c1edff794d 100644 --- a/includes/libs/objectcache/IExpiringStore.php +++ b/includes/libs/objectcache/IExpiringStore.php @@ -56,4 +56,9 @@ interface IExpiringStore { const QOS_SYNCWRITES_SS = 4; // strict-serializable, nodes refuse reads if possible stale // Generic "unknown" value that is useful for comparisons (e.g. always good enough) const QOS_UNKNOWN = INF; + + const ERR_NONE = 0; // no error + const ERR_NO_RESPONSE = 1; // no response + const ERR_UNREACHABLE = 2; // can't connect + const ERR_UNEXPECTED = 3; // response gave some error } diff --git a/includes/libs/objectcache/WANObjectCache.php b/includes/libs/objectcache/WANObjectCache.php index bed7965149..69c2a4db00 100644 --- a/includes/libs/objectcache/WANObjectCache.php +++ b/includes/libs/objectcache/WANObjectCache.php @@ -214,12 +214,6 @@ class WANObjectCache implements IExpiringStore, LoggerAwareInterface { const FLD_FLAGS = 4; // key to the flags bitfield (reserved number) const FLD_HOLDOFF = 5; // key to any hold-off TTL - const ERR_NONE = 0; // no error - const ERR_NO_RESPONSE = 1; // no response - const ERR_UNREACHABLE = 2; // can't connect - const ERR_UNEXPECTED = 3; // response gave some error - const ERR_RELAY = 4; // relay broadcast failed - const VALUE_KEY_PREFIX = 'WANCache:v:'; const INTERIM_KEY_PREFIX = 'WANCache:i:'; const TIME_KEY_PREFIX = 'WANCache:t:'; @@ -237,7 +231,7 @@ class WANObjectCache implements IExpiringStore, LoggerAwareInterface { * @param array $params * - cache : BagOStuff object for a persistent cache * - logger : LoggerInterface object - * - stats : LoggerInterface object + * - stats : StatsdDataFactoryInterface object * - asyncHandler : A function that takes a callback and runs it later. If supplied, * whenever a preemptive refresh would be triggered in getWithSetCallback(), the * current cache value is still used instead. However, the async-handler function