本文整理匯總了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();
}