You are here

class FailedCheckumFilter in Automatic Updates 8

Same name and namespace in other branches
  1. 7 vendor/drupal/php-signify/src/FailedCheckumFilter.php \Drupal\Signify\FailedCheckumFilter

Hierarchy

Expanded class hierarchy of FailedCheckumFilter

2 files declare their use of FailedCheckumFilter
InPlaceUpdate.php in src/Services/InPlaceUpdate.php
ModifiedFiles.php in src/Services/ModifiedFiles.php

File

vendor/drupal/php-signify/src/FailedCheckumFilter.php, line 7

Namespace

Drupal\Signify
View source
class FailedCheckumFilter extends \FilterIterator {
  protected $workingDirectory;
  public function __construct(Iterator $iterator, $working_directory) {
    parent::__construct($iterator);
    $this->workingDirectory = $working_directory;
  }

  /**
   * {@inheritdoc}
   */
  public function accept() {

    /** @var \Drupal\Signify\VerifierFileChecksum $checksum */
    $checksum = $this
      ->current();
    $hash_file_path = $this->workingDirectory . DIRECTORY_SEPARATOR . $checksum->filename;
    $algorithm = strtolower($checksum->algorithm);
    $hash = @hash_file($algorithm, $hash_file_path);
    return $hash !== $checksum->hex_hash;
  }

}

Members