You are here

protected function RegistryAutoloadSearcher::checkFileNeedsUpdate in Registry Autoload 7

Checks if the is in need of an update.

Parameters

string $filename: The filename to check against the {registry_file} table.

string $hash: The hash passed by reference for later usage.

Return value

bool TRUE if the file needs an update, FALSE otherwise.

1 call to RegistryAutoloadSearcher::checkFileNeedsUpdate()
RegistryAutoloadSearcher::processFiles in ./registry_autoload.module
Processes files containing classes for the given module.

File

./registry_autoload.module, line 262
Main module for enabling core registry to support namespaced files.

Class

RegistryAutoloadSearcher
RegistryAutoloadSearcher helper class.

Code

protected function checkFileNeedsUpdate($filename, &$hash) {

  // Check if hash matches still.
  $stored_hash = !empty($this->parsedFiles[$filename]['hash']) ? $this->parsedFiles[$filename]['hash'] : NULL;
  $hash = hash_file('sha256', $filename);
  if (!empty($stored_hash) && $stored_hash == $hash) {
    return FALSE;
  }
  return TRUE;
}