Ejemplo n.º 1
0
 /**
  * Get the SHA-1 of a file in storage when this operation is attempted
  * 
  * @param $source string Storage path
  * @param $predicates Array
  * @return string|false 
  */
 protected final function fileSha1($source, array $predicates)
 {
     if (isset($predicates['sha1'][$source])) {
         return $predicates['sha1'][$source];
         // previous op assures this
     } else {
         $params = array('src' => $source, 'latest' => $this->useLatest);
         return $this->backend->getFileSha1Base36($params);
     }
 }
Ejemplo n.º 2
0
 /**
  * Get the SHA-1 of a file in storage when this operation is attempted
  *
  * @param string $source Storage path
  * @param array $predicates
  * @return string|bool False on failure
  */
 protected final function fileSha1($source, array $predicates)
 {
     if (isset($predicates['sha1'][$source])) {
         return $predicates['sha1'][$source];
         // previous op assures this
     } elseif (isset($predicates['exists'][$source]) && !$predicates['exists'][$source]) {
         return false;
         // previous op assures this
     } else {
         $params = ['src' => $source, 'latest' => true];
         return $this->backend->getFileSha1Base36($params);
     }
 }