MediaWiki master
MediaWiki\Utils\FileContentsHasher Class Reference

Generate hash digests of file contents to help with cache invalidation. More...

Collaboration diagram for MediaWiki\Utils\FileContentsHasher:

Public Member Functions

 __construct ()

Static Public Member Functions

static getFileContentsHash ( $filePaths)
 Get a hash of the combined contents of one or more files, either by retrieving a previously-computed hash from the cache, or by computing a hash from the files.
static singleton ()
 Get the singleton instance of this class.

Protected Attributes

BagOStuff $cache

Detailed Description

Generate hash digests of file contents to help with cache invalidation.

Definition at line 16 of file FileContentsHasher.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\Utils\FileContentsHasher::__construct ( )

Definition at line 25 of file FileContentsHasher.php.

Member Function Documentation

◆ getFileContentsHash()

MediaWiki\Utils\FileContentsHasher::getFileContentsHash ( $filePaths)
static

Get a hash of the combined contents of one or more files, either by retrieving a previously-computed hash from the cache, or by computing a hash from the files.

Parameters
string | string[]$filePathsOne or more file paths.
Returns
string|bool Hash of files' contents, or false if no file could not be read.

Definition at line 76 of file FileContentsHasher.php.

Referenced by MediaWiki\Html\TemplateParser\compile(), and MediaWiki\Html\TemplateParser\getTemplate().

◆ singleton()

MediaWiki\Utils\FileContentsHasher::singleton ( )
static

Get the singleton instance of this class.

Definition at line 32 of file FileContentsHasher.php.

Member Data Documentation

◆ $cache

BagOStuff MediaWiki\Utils\FileContentsHasher::$cache
protected

Definition at line 20 of file FileContentsHasher.php.


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