Пример #1
0
 /**
  * Validates that the downloaded file MD5 the MD5 of the file from Elliott
  *
  * @param string $downloadFilePath
  * @param string $sourceMD5
  *
  * @return bool
  */
 private function _validateUpdate($downloadFilePath, $sourceMD5)
 {
     Craft::log('Validating MD5 for ' . $downloadFilePath, LogLevel::Info, true);
     $localMD5 = IOHelper::getFileMD5($downloadFilePath);
     if ($localMD5 === $sourceMD5) {
         return true;
     }
     return false;
 }
Пример #2
0
 /**
  * @return mixed
  */
 public function getMD5()
 {
     if (!$this->_md5) {
         $this->_md5 = IOHelper::getFileMD5($this->getRealPath());
     }
     return $this->_md5;
 }