You are here

function hacked_get_file_hasher in Hacked! 8.2

Same name and namespace in other branches
  1. 6.2 hacked.module \hacked_get_file_hasher()
  2. 7.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()
HackedDiffController::hackedProjectDiff in src/Controller/HackedDiffController.php
Shows a diff report for a specific file in a project.
hackedFileGroup::__construct in src/hackedFileGroup.php
Constructor.

File

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

Code

function hacked_get_file_hasher($name = NULL) {
  if (is_null($name)) {
    $name = \Drupal::config('hacked.settings')
      ->get('selected_file_hasher');
  }
  $hashers = hacked_get_file_hashers();
  $class_name = $hashers[$name]['class'];
  return new $class_name();
}