Methods

Compares the hashes of a list of files with what is actually on the disk.

compareHashes(array $hashes) : array
Static

Parameters

$hashes

array

[file] => hash

Returns

arrayList of errors, [file] => missing or mismatch

Hashes the content of a file in a line-ending agnostic way.

getFileContentsHash(string $contents) : string
Static

Parameters

$contents

string

Contents of file

Returns

stringHash of contents

Returns the text of a PHP class called $className that includes a static method called getSums(), which returns an the single-dimension associative array $fileHashes.

getHashClassCode(string $className, array $fileHashes) : string
Static

Parameters

$className

string

$fileHashes

array

Returns

string

Return an array containing the MD5sum of every file with the given $fileExtensions within the given $path, excluding any directories matching $excludeDirs.

hashDirectory(string $path, array $fileExtensions, array $exclude) : array
Static

Parameters

$path

string

$fileExtensions

array

$exclude

Returns

array[filepath => md5, ...]