objectcache: add IStoreKeyEncoder interface for key generation helper methods
[lhc/web/wiklou.git] / includes / libs / objectcache / IStoreKeyEncoder.php
1 <?php
2
3 /**
4 * Generic interface for object stores with key encoding methods.
5 *
6 * @ingroup Cache
7 * @since 1.34
8 */
9 interface IStoreKeyEncoder {
10 /**
11 * Make a global cache key.
12 *
13 * @param string $class Key class
14 * @param string|null $component [optional] Key component (starting with a key collection name)
15 * @return string Colon-delimited list of $keyspace followed by escaped components of $args
16 */
17 public function makeGlobalKey( $class, $component = null );
18
19 /**
20 * Make a cache key, scoped to this instance's keyspace.
21 *
22 * @param string $class Key class
23 * @param string|null $component [optional] Key component (starting with a key collection name)
24 * @return string Colon-delimited list of $keyspace followed by escaped components of $args
25 */
26 public function makeKey( $class, $component = null );
27 }