|
|
@ -124,50 +124,52 @@ abstract class BitbucketDriver extends VcsDriver
|
|
|
|
|
|
|
|
|
|
|
|
$composer = $this->getBaseComposerInformation($identifier);
|
|
|
|
$composer = $this->getBaseComposerInformation($identifier);
|
|
|
|
|
|
|
|
|
|
|
|
// specials for bitbucket
|
|
|
|
if ($composer) {
|
|
|
|
if (!isset($composer['support']['source'])) {
|
|
|
|
// specials for bitbucket
|
|
|
|
$label = array_search(
|
|
|
|
if (!isset($composer['support']['source'])) {
|
|
|
|
$identifier,
|
|
|
|
$label = array_search(
|
|
|
|
$this->getTags()
|
|
|
|
$identifier,
|
|
|
|
) ?: array_search(
|
|
|
|
$this->getTags()
|
|
|
|
$identifier,
|
|
|
|
) ?: array_search(
|
|
|
|
$this->getBranches()
|
|
|
|
$identifier,
|
|
|
|
) ?: $identifier;
|
|
|
|
$this->getBranches()
|
|
|
|
|
|
|
|
) ?: $identifier;
|
|
|
|
if (array_key_exists($label, $tags = $this->getTags())) {
|
|
|
|
|
|
|
|
$hash = $tags[$label];
|
|
|
|
if (array_key_exists($label, $tags = $this->getTags())) {
|
|
|
|
} elseif (array_key_exists($label, $branches = $this->getBranches())) {
|
|
|
|
$hash = $tags[$label];
|
|
|
|
$hash = $branches[$label];
|
|
|
|
} elseif (array_key_exists($label, $branches = $this->getBranches())) {
|
|
|
|
}
|
|
|
|
$hash = $branches[$label];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (! isset($hash)) {
|
|
|
|
if (! isset($hash)) {
|
|
|
|
$composer['support']['source'] = sprintf(
|
|
|
|
$composer['support']['source'] = sprintf(
|
|
|
|
'https://%s/%s/%s/src',
|
|
|
|
'https://%s/%s/%s/src',
|
|
|
|
|
|
|
|
$this->originUrl,
|
|
|
|
|
|
|
|
$this->owner,
|
|
|
|
|
|
|
|
$this->repository
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
$composer['support']['source'] = sprintf(
|
|
|
|
|
|
|
|
'https://%s/%s/%s/src/%s/?at=%s',
|
|
|
|
|
|
|
|
$this->originUrl,
|
|
|
|
|
|
|
|
$this->owner,
|
|
|
|
|
|
|
|
$this->repository,
|
|
|
|
|
|
|
|
$hash,
|
|
|
|
|
|
|
|
$label
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!isset($composer['support']['issues']) && $this->hasIssues) {
|
|
|
|
|
|
|
|
$composer['support']['issues'] = sprintf(
|
|
|
|
|
|
|
|
'https://%s/%s/%s/issues',
|
|
|
|
$this->originUrl,
|
|
|
|
$this->originUrl,
|
|
|
|
$this->owner,
|
|
|
|
$this->owner,
|
|
|
|
$this->repository
|
|
|
|
$this->repository
|
|
|
|
);
|
|
|
|
);
|
|
|
|
} else {
|
|
|
|
|
|
|
|
$composer['support']['source'] = sprintf(
|
|
|
|
|
|
|
|
'https://%s/%s/%s/src/%s/?at=%s',
|
|
|
|
|
|
|
|
$this->originUrl,
|
|
|
|
|
|
|
|
$this->owner,
|
|
|
|
|
|
|
|
$this->repository,
|
|
|
|
|
|
|
|
$hash,
|
|
|
|
|
|
|
|
$label
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (!isset($composer['homepage'])) {
|
|
|
|
if (!isset($composer['support']['issues']) && $this->hasIssues) {
|
|
|
|
$composer['homepage'] = empty($this->website) ? $this->homeUrl : $this->website;
|
|
|
|
$composer['support']['issues'] = sprintf(
|
|
|
|
}
|
|
|
|
'https://%s/%s/%s/issues',
|
|
|
|
|
|
|
|
$this->originUrl,
|
|
|
|
|
|
|
|
$this->owner,
|
|
|
|
|
|
|
|
$this->repository
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!isset($composer['homepage'])) {
|
|
|
|
|
|
|
|
$composer['homepage'] = empty($this->website) ? $this->homeUrl : $this->website;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$this->infoCache[$identifier] = $composer;
|
|
|
|
$this->infoCache[$identifier] = $composer;
|
|
|
|