* @param string $file Filename
* @param array $context Additional logging context data
* @throws MWException
- * @deprecated since 1.25 Use MediaWiki\Logger\LegacyLogger::emit or UDPTransport
+ * @deprecated since 1.25 Use \\MediaWiki\\Logger\\LegacyLogger::emit or UDPTransport
*/
function wfErrorLog( $text, $file, array $context = array() ) {
wfDeprecated( __METHOD__, '1.25' );
* @return string
*/
function wfMemcKey( /*...*/ ) {
- global $wgCachePrefix;
- $prefix = $wgCachePrefix === false ? wfWikiID() : $wgCachePrefix;
- $args = func_get_args();
- $key = $prefix . ':' . implode( ':', $args );
- return strtr( $key, ' ', '_' );
+ return call_user_func_array(
+ array( ObjectCache::getMainClusterInstance(), 'makeKey' ),
+ func_get_args()
+ );
}
/**
*/
function wfForeignMemcKey( $db, $prefix /*...*/ ) {
$args = array_slice( func_get_args(), 2 );
- if ( $prefix ) {
- // Match wfWikiID() logic
- $key = "$db-$prefix:" . implode( ':', $args );
- } else {
- $key = $db . ':' . implode( ':', $args );
- }
- return strtr( $key, ' ', '_' );
+ $keyspace = $prefix ? "$db-$prefix" : $db;
+ return call_user_func_array(
+ array( ObjectCache::getMainClusterInstance(), 'makeKeyInternal' ),
+ array( $keyspace, $args )
+ );
}
/**
* @return string
*/
function wfGlobalCacheKey( /*...*/ ) {
- $args = func_get_args();
- $key = 'global:' . implode( ':', $args );
- return strtr( $key, ' ', '_' );
+ return call_user_func_array(
+ array( ObjectCache::getMainClusterInstance(), 'makeGlobalKey' ),
+ func_get_args()
+ );
}
/**