wiki.techinc.nl/includes/libs/objectcache/IStoreKeyEncoder.php
Aaron Schulz 670687fae0 objectcache: add IStoreKeyEncoder interface for key generation helper methods
If a key is stored in both BagOStuff and WANObjectCache, it useful to have
one common method for generating the cache and storage keys.

Change-Id: I8b77651746a55e8a98a79db298226e334d15a494
2019-07-08 22:33:07 +00:00

27 lines
830 B
PHP

<?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 );
}