MediaWiki REL1_40
IStoreKeyEncoder Interface Reference

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

Inherited by BagOStuff, and WANObjectCache.

Public Member Functions

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

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 BagOStuff, CachedBagOStuff, MediumSpecificBagOStuff, MultiWriteBagOStuff, ReplicatedBagOStuff, and WANObjectCache.

◆ 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 BagOStuff, CachedBagOStuff, MediumSpecificBagOStuff, MultiWriteBagOStuff, ReplicatedBagOStuff, and WANObjectCache.


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