class FailedCheckumFilter in Automatic Updates 8
Same name and namespace in other branches
- 7 vendor/drupal/php-signify/src/FailedCheckumFilter.php \Drupal\Signify\FailedCheckumFilter
Hierarchy
- class \Drupal\Signify\FailedCheckumFilter extends \Drupal\Signify\FilterIterator
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\SignifyView 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
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
FailedCheckumFilter:: |
protected | property | ||
FailedCheckumFilter:: |
public | function | ||
FailedCheckumFilter:: |
public | function |