'IP' => __DIR__ . '/includes/libs/IP.php',
'IPTC' => __DIR__ . '/includes/media/IPTC.php',
'IRCColourfulRCFeedFormatter' => __DIR__ . '/includes/rcfeed/IRCColourfulRCFeedFormatter.php',
+ 'IStoreKeyEncoder' => __DIR__ . '/includes/libs/objectcache/IStoreKeyEncoder.php',
'IcuCollation' => __DIR__ . '/includes/collation/IcuCollation.php',
'IdentityCollation' => __DIR__ . '/includes/collation/IdentityCollation.php',
'ImageBuilder' => __DIR__ . '/maintenance/rebuildImages.php',
*
* @ingroup Cache
*/
-abstract class BagOStuff implements IExpiringStore, LoggerAwareInterface {
+abstract class BagOStuff implements IExpiringStore, IStoreKeyEncoder, LoggerAwareInterface {
/** @var array[] Lock tracking */
protected $locks = [];
/** @var int ERR_* class constant */
--- /dev/null
+<?php
+
+/**
+ * Generic interface for object stores with key encoding methods.
+ *
+ * @ingroup Cache
+ * @since 1.34
+ */
+interface IStoreKeyEncoder {
+ /**
+ * Make a global cache key.
+ *
+ * @param string $class Key class
+ * @param string|null $component [optional] Key component (starting with a key collection name)
+ * @return string Colon-delimited list of $keyspace followed by escaped components of $args
+ */
+ public function makeGlobalKey( $class, $component = null );
+
+ /**
+ * Make a cache key, scoped to this instance's keyspace.
+ *
+ * @param string $class Key class
+ * @param string|null $component [optional] Key component (starting with a key collection name)
+ * @return string Colon-delimited list of $keyspace followed by escaped components of $args
+ */
+ public function makeKey( $class, $component = null );
+}
* @ingroup Cache
* @since 1.26
*/
-class WANObjectCache implements IExpiringStore, LoggerAwareInterface {
+class WANObjectCache implements IExpiringStore, IStoreKeyEncoder, LoggerAwareInterface {
/** @var BagOStuff The local datacenter cache */
protected $cache;
/** @var MapCacheLRU[] Map of group PHP instance caches */