Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. GitLabDriver.php

function GitLabDriver::fetchProject

2 calls to GitLabDriver::fetchProject()
GitLabDriver::getRepoData in vendor/composer/composer/src/Composer/Repository/Vcs/GitLabDriver.php
Gives back the loaded <gitlab-api>/projects/<owner>/<repo> result
GitLabDriver::initialize in vendor/composer/composer/src/Composer/Repository/Vcs/GitLabDriver.php
Extracts information from the repository url.

File

vendor/composer/composer/src/Composer/Repository/Vcs/GitLabDriver.php, line 380

Class

GitLabDriver
Driver for GitLab API, use the Git driver for local checkouts.

Namespace

Composer\Repository\Vcs

Code

protected function fetchProject() : void {
    if (!is_null($this->project)) {
        return;
    }
    // we need to fetch the default branch from the api
    $resource = $this->getApiUrl();
    $this->project = $this->getContents($resource, true)
        ->decodeJson();
    if (isset($this->project['visibility'])) {
        $this->isPrivate = $this->project['visibility'] !== 'public';
    }
    else {
        // client is not authenticated, therefore repository has to be public
        $this->isPrivate = false;
    }
}
RSS feed
Powered by Drupal