You are here

class hackedFileIgnoreEndingsHasher in Hacked! 8.2

Class hackedFileIgnoreEndingsHasher @package Drupal\hacked

Hierarchy

Expanded class hierarchy of hackedFileIgnoreEndingsHasher

File

src/hackedFileIgnoreEndingsHasher.php, line 9

Namespace

Drupal\hacked
View source
class hackedFileIgnoreEndingsHasher extends hackedFileHasher {

  /**
   * Returns a hash of the given filename.
   *
   * Ignores file line endings.
   */
  function perform_hash($filename) {
    if (!hacked_file_is_binary($filename)) {
      $file = file($filename, FILE_IGNORE_NEW_LINES);
      return sha1(serialize($file));
    }
    else {
      return sha1_file($filename);
    }
  }
  function fetch_lines($filename) {
    return file($filename, FILE_IGNORE_NEW_LINES);
  }

}

Members

Namesort descending Modifiers Type Description Overrides
hackedFileHasher::cache_get function
hackedFileHasher::cache_key function
hackedFileHasher::cache_set function
hackedFileHasher::hash function Returns a hash of the given filename.
hackedFileIgnoreEndingsHasher::fetch_lines function Compute and return the lines of the given file. Overrides hackedFileHasher::fetch_lines
hackedFileIgnoreEndingsHasher::perform_hash function Returns a hash of the given filename. Overrides hackedFileHasher::perform_hash