/** * 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()); }
/** * 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']; }
/** * 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); }
/** * 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'); } } }