*/
use MediaWiki\MediaWikiServices;
-use Wikimedia\Rdbms\ResultWrapper;
+use Wikimedia\Rdbms\IResultWrapper;
use Wikimedia\Rdbms\Database;
use Wikimedia\Rdbms\IDatabase;
}
$method = __METHOD__;
- $redirDbKey = MediaWikiServices::getInstance()->getMainWANObjectCache()->getWithSetCallback(
+ $redirDbKey = $this->wanCache->getWithSetCallback(
$memcKey,
$expiry,
function ( $oldValue, &$ttl, array &$setOpts ) use ( $method, $title ) {
);
};
- $applyMatchingFiles = function ( ResultWrapper $res, &$searchSet, &$finalFiles )
+ $applyMatchingFiles = function ( IResultWrapper $res, &$searchSet, &$finalFiles )
use ( $fileMatchesSearch, $flags )
{
+ $contLang = MediaWikiServices::getInstance()->getContentLanguage();
$info = $this->getInfo();
foreach ( $res as $row ) {
$file = $this->newFileFromRow( $row );
$dbKeysLook = [ strtr( $file->getName(), ' ', '_' ) ];
if ( !empty( $info['initialCapital'] ) ) {
// Search keys for "hi.png" and "Hi.png" should use the "Hi.png file"
- $dbKeysLook[] = MediaWikiServices::getInstance()->getContentLanguage()->
- lcfirst( $file->getName() );
+ $dbKeysLook[] = $contLang->lcfirst( $file->getName() );
}
foreach ( $dbKeysLook as $dbKey ) {
if ( isset( $searchSet[$dbKey] )
/**
* Get a key on the primary cache for this repository.
* Returns false if the repository's cache is not accessible at this site.
- * The parameters are the parts of the key, as for wfMemcKey().
+ * The parameters are the parts of the key.
*
* @return string
*/
function getSharedCacheKey( /*...*/ ) {
$args = func_get_args();
- return wfMemcKey( ...$args );
+ return $this->wanCache->makeKey( ...$args );
}
/**
if ( $key ) {
$this->getMasterDB()->onTransactionPreCommitOrIdle(
function () use ( $key ) {
- MediaWikiServices::getInstance()->getMainWANObjectCache()->delete( $key );
+ $this->wanCache->delete( $key );
},
__METHOD__
);