本文整理汇总了PHP中TYPO3\CMS\Core\Resource\File::getSha1方法的典型用法代码示例。如果您正苦于以下问题:PHP File::getSha1方法的具体用法?PHP File::getSha1怎么用?PHP File::getSha1使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TYPO3\CMS\Core\Resource\File
的用法示例。
在下文中一共展示了File::getSha1方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: needsReprocessing
/**
* Checks if the ProcessedFile needs reprocessing
*
* @return bool
*/
public function needsReprocessing()
{
$fileMustBeRecreated = false;
// if original is missing we can not reprocess the file
if ($this->originalFile->isMissing()) {
return false;
}
// processedFile does not exist
if (!$this->usesOriginalFile() && !$this->exists()) {
$fileMustBeRecreated = true;
}
// hash does not match
if (array_key_exists('checksum', $this->properties) && $this->calculateChecksum() !== $this->properties['checksum']) {
$fileMustBeRecreated = true;
}
// original file changed
if ($this->originalFile->getSha1() !== $this->originalFileSha1) {
$fileMustBeRecreated = true;
}
if (!array_key_exists('uid', $this->properties)) {
$fileMustBeRecreated = true;
}
// remove outdated file
if ($fileMustBeRecreated && $this->exists()) {
$this->delete();
}
return $fileMustBeRecreated;
}
示例2: getSha1
/**
* Returns the Sha1 of this file
*
* @return string
*/
public function getSha1()
{
return $this->originalFile->getSha1();
}