You are here

function hacked_get_file_hasher in Hacked! 7.2

Same name and namespace in other branches
  1. 8.2 hacked.module \hacked_get_file_hasher()
  2. 6.2 hacked.module \hacked_get_file_hasher()

Return the file hasher that is currently selected by the user.

2 calls to hacked_get_file_hasher()
hackedFileGroup::__construct in includes/hackedFileGroup.inc
Constructor.
hacked_diff_changed in ./hacked.diff.inc
Generate a diff report for a specific file in a project.

File

./hacked.module, line 341
The Hacked! module, shows which project have been changed since download.

Code

function hacked_get_file_hasher($name = NULL) {
  if (is_null($name)) {
    $name = variable_get('hacked_selected_file_hasher', HACKED_DEFAULT_FILE_HASHER);
  }
  if (!module_exists('hacked')) {
    $hashers = hacked_hacked_file_hashers_info();
  }
  else {
    $hashers = hacked_get_file_hashers();
  }
  $class_name = $hashers[$name]['class'];
  return new $class_name();
}