MediaWiki  master
IStoreKeyEncoder Interface Reference

Generic interface for object stores with key encoding methods. More...

Inheritance diagram for IStoreKeyEncoder:

Public Member Functions

 makeGlobalKey ( $collection,... $components)
 Make a cache key using the "global" keyspace for the given components. More...
 
 makeKey ( $collection,... $components)
 Make a cache key using the default keyspace for the given components. More...
 

Detailed Description

Generic interface for object stores with key encoding methods.

Since
1.34

Definition at line 9 of file IStoreKeyEncoder.php.

Member Function Documentation

◆ makeGlobalKey()

IStoreKeyEncoder::makeGlobalKey (   $collection,
  $components 
)

Make a cache key using the "global" keyspace for the given components.

Callers should:

  • Limit the collection name (first component) to 48 characters
  • Use hashes for any components based on user-supplied input

Encoding is limited to the escaping of delimiter (":") and escape ("%") characters. Any backend-specific encoding should be delegated to methods that use the network.

Parameters
string$collectionKey collection name component
string|int...$components Additional, ordered, key components for entity IDs
Returns
string Colon-separated, keyspace-prepended, ordered list of encoded components

Implemented in WANObjectCache, ReplicatedBagOStuff, MultiWriteBagOStuff, MediumSpecificBagOStuff, CachedBagOStuff, and BagOStuff.

Referenced by Wikimedia\Rdbms\LoadMonitor\makeStateKey().

◆ makeKey()

IStoreKeyEncoder::makeKey (   $collection,
  $components 
)

Make a cache key using the default keyspace for the given components.

Callers should:

  • Limit the collection name (first component) to 48 characters
  • Use hashes for any components based on user-supplied input

Encoding is limited to the escaping of delimiter (":") and escape ("%") characters. Any backend-specific encoding should be delegated to methods that use the network.

Parameters
string$collectionKey collection name component
string|int...$components Additional, ordered, key components for entity IDs
Returns
string Colon-separated, keyspace-prepended, ordered list of encoded components

Implemented in WANObjectCache, ReplicatedBagOStuff, MultiWriteBagOStuff, MediumSpecificBagOStuff, CachedBagOStuff, and BagOStuff.


The documentation for this interface was generated from the following file: