1
0
Fork 0
mirror of https://github.com/composer/composer synced 2025-05-09 00:22:53 +00:00

Update GitLab API usage to v4, fixes #6453

This commit is contained in:
Jordi Boggiano 2017-08-07 13:03:02 +02:00
parent ec2722f879
commit 6832eacb01
2 changed files with 23 additions and 23 deletions

View file

@ -126,7 +126,7 @@ class GitLabDriver extends VcsDriver
}
}
$resource = $this->getApiUrl().'/repository/blobs/'.$identifier.'?filepath=' . $file;
$resource = $this->getApiUrl().'/repository/files/'.$this->urlEncodeAll($file).'/raw?ref='.$identifier;
try {
$content = $this->getContents($resource);
@ -248,7 +248,7 @@ class GitLabDriver extends VcsDriver
*/
public function getApiUrl()
{
return $this->scheme.'://'.$this->originUrl.'/api/v3/projects/'.$this->urlEncodeAll($this->namespace).'%2F'.$this->urlEncodeAll($this->repository);
return $this->scheme.'://'.$this->originUrl.'/api/v4/projects/'.$this->urlEncodeAll($this->namespace).'%2F'.$this->urlEncodeAll($this->repository);
}
/**
@ -300,7 +300,7 @@ class GitLabDriver extends VcsDriver
// we need to fetch the default branch from the api
$resource = $this->getApiUrl();
$this->project = JsonFile::parseJson($this->getContents($resource, true), $resource);
$this->isPrivate = !$this->project['public'];
$this->isPrivate = $this->project['visibility'] !== 'public';
}
protected function attemptCloneFallback()