/** @var FileContentsHasher */
private static $instance;
- /**
- * Constructor.
- */
public function __construct() {
$this->cache = ObjectCache::getLocalServerInstance( 'hash' );
}
return false;
}
- $cacheKey = wfGlobalCacheKey( __CLASS__, $filePath, $mtime, $algo );
+ $cacheKey = $this->cache->makeGlobalKey( __CLASS__, $filePath, $mtime, $algo );
$hash = $this->cache->get( $cacheKey );
if ( $hash ) {
$filePaths = (array)$filePaths;
}
- MediaWiki\suppressWarnings();
+ Wikimedia\suppressWarnings();
if ( count( $filePaths ) === 1 ) {
$hash = $instance->getFileContentsHashInternal( $filePaths[0], $algo );
- MediaWiki\restoreWarnings();
+ Wikimedia\restoreWarnings();
return $hash;
}
return $instance->getFileContentsHashInternal( $filePath, $algo ) ?: '';
}, $filePaths );
- MediaWiki\restoreWarnings();
+ Wikimedia\restoreWarnings();
$hashes = implode( '', $hashes );
return $hashes ? hash( $algo, $hashes ) : false;