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

Breadcrumb

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

function GitBitbucketDriver::initialize

@inheritDoc

Overrides VcsDriverInterface::initialize

File

vendor/composer/composer/src/Composer/Repository/Vcs/GitBitbucketDriver.php, line 64

Class

GitBitbucketDriver
@author Per Bernhardt <plb@webfactory.de>

Namespace

Composer\Repository\Vcs

Code

public function initialize() : void {
    if (!Preg::isMatchStrictGroups('#^https?://bitbucket\\.org/([^/]+)/([^/]+?)(?:\\.git|/?)?$#i', $this->url, $match)) {
        throw new \InvalidArgumentException(sprintf('The Bitbucket repository URL %s is invalid. It must be the HTTPS URL of a Bitbucket repository.', $this->url));
    }
    $this->owner = $match[1];
    $this->repository = $match[2];
    $this->originUrl = 'bitbucket.org';
    $this->cache = new Cache($this->io, implode('/', [
        $this->config
            ->get('cache-repo-dir'),
        $this->originUrl,
        $this->owner,
        $this->repository,
    ]));
    $this->cache
        ->setReadOnly($this->config
        ->get('cache-read-only'));
}
RSS feed
Powered by Drupal