예제 #1
0
 /**
  * Gets the data for a blob
  *
  * @param GitPHP_Blob $blob blob
  * @return string blob data
  */
 public function Load($blob)
 {
     if (!$blob) {
         return;
     }
     return $this->objectLoader->GetObject($blob->GetHash());
 }
예제 #2
0
 /**
  * Gets the data for a blob
  *
  * @param GitPHP_Blob $blob blob
  * @return string blob data
  */
 public function Load($blob)
 {
     if (!$blob) {
         return;
     }
     $result = $this->exe->GetObjectData($blob->GetProject()->GetPath(), $blob->GetHash());
     return $result['contents'];
 }
예제 #3
0
 /**
  * Load blob size using git
  *
  * @param GitPHP_Blob $blob blob
  * @return int blob size
  */
 protected function LoadSize($blob)
 {
     if (!$blob) {
         return;
     }
     $args = array();
     $args[] = '-s';
     $args[] = $blob->GetHash();
     return $this->exe->Execute($blob->GetProject()->GetPath(), GIT_CAT_FILE, $args);
 }
예제 #4
0
 /**
  * Sets the matching object
  *
  * @param GitPHP_Tree|GitPHP_Blob $object matching object
  */
 public function SetObject($object)
 {
     if ($object instanceof GitPHP_Tree) {
         $this->objectType = 'tree';
         $this->objectHash = $object->GetHash();
     } else {
         if ($object instanceof GitPHP_Blob) {
             $this->objectType = 'blob';
             $this->objectHash = $object->GetHash();
         } else {
             throw new Exception('Invalid file search result object');
         }
     }
 }