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:
parent
ec2722f879
commit
6832eacb01
2 changed files with 23 additions and 23 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue