|
@@ -19,9 +19,9 @@ class GitRepository implements RepositoryInterface
|
|
|
return json_decode(file_get_contents('http://github.com/api/v2/json/repos/show/'.$this->owner.'/'.$this->repository), true);
|
|
|
}
|
|
|
|
|
|
- public function getSource()
|
|
|
+ public function getType()
|
|
|
{
|
|
|
- return array('type' => 'git', 'url' => $this->getUrl());
|
|
|
+ return 'git';
|
|
|
}
|
|
|
|
|
|
public function getUrl()
|
|
@@ -29,13 +29,11 @@ class GitRepository implements RepositoryInterface
|
|
|
return 'http://github.com/'.$this->owner.'/'.$this->repository.'.git';
|
|
|
}
|
|
|
|
|
|
- public function getDist($tag)
|
|
|
+ protected function getDist($tag)
|
|
|
{
|
|
|
$repoData = $this->getRepoData();
|
|
|
if ($repoData['repository']['has_downloads']) {
|
|
|
- $downloadUrl = 'https://github.com/'.$this->owner.'/'.$this->repository.'/zipball/'.$tag;
|
|
|
- $checksum = hash_file('sha1', $downloadUrl);
|
|
|
- return array('type' => 'zip', 'url' => $downloadUrl, 'shasum' => $checksum ?: '');
|
|
|
+ return 'https://github.com/'.$this->owner.'/'.$this->repository.'/zipball/'.$tag;
|
|
|
} else {
|
|
|
|
|
|
}
|
|
@@ -43,7 +41,7 @@ class GitRepository implements RepositoryInterface
|
|
|
|
|
|
public function getAllComposerFiles()
|
|
|
{
|
|
|
- if(!$this->getRepoData()) {
|
|
|
+ if(!$repoData = $this->getRepoData()) {
|
|
|
throw new \Exception();
|
|
|
}
|
|
|
|
|
@@ -58,6 +56,8 @@ class GitRepository implements RepositoryInterface
|
|
|
$file['time'] = $commit['commit']['committed_date'];
|
|
|
}
|
|
|
|
|
|
+ $file['download'] = $this->getDist($tag);
|
|
|
+
|
|
|
$files[$tag] = $file;
|
|
|
}
|
|
|
}
|