MediaWiki  master
FileContentsHasher Class Reference
Collaboration diagram for 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. More...
 
static singleton ()
 Get the singleton instance of this class. More...
 

Protected Attributes

BagOStuff $cache
 

Detailed Description

Definition at line 22 of file FileContentsHasher.php.

Constructor & Destructor Documentation

◆ __construct()

FileContentsHasher::__construct ( )

Definition at line 31 of file FileContentsHasher.php.

Member Function Documentation

◆ getFileContentsHash()

static 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 87 of file FileContentsHasher.php.

References $hashes, and singleton().

Referenced by TemplateParser\compile(), MediaWiki\ResourceLoader\FileModule\compileLessString(), TemplateParser\getTemplate(), and MediaWiki\ResourceLoader\Module\safeFileHash().

◆ singleton()

static FileContentsHasher::singleton ( )
static

Get the singleton instance of this class.

Returns
FileContentsHasher

Definition at line 40 of file FileContentsHasher.php.

Referenced by getFileContentsHash().

Member Data Documentation

◆ $cache

BagOStuff FileContentsHasher::$cache
protected

Definition at line 26 of file FileContentsHasher.php.


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