|
@@ -51,7 +51,7 @@ class GitBitbucketDriver extends VcsDriver implements VcsDriverInterface
|
|
|
public function getRootIdentifier()
|
|
|
{
|
|
|
if (null === $this->rootIdentifier) {
|
|
|
- $repoData = json_decode(file_get_contents($this->getHttpSupport() . '://api.bitbucket.org/1.0/repositories/'.$this->owner.'/'.$this->repository), true);
|
|
|
+ $repoData = json_decode(file_get_contents($this->getScheme() . '://api.bitbucket.org/1.0/repositories/'.$this->owner.'/'.$this->repository), true);
|
|
|
$this->rootIdentifier = !empty($repoData['main_branch']) ? $repoData['main_branch'] : 'master';
|
|
|
}
|
|
|
|
|
@@ -82,7 +82,7 @@ class GitBitbucketDriver extends VcsDriver implements VcsDriverInterface
|
|
|
public function getDist($identifier)
|
|
|
{
|
|
|
$label = array_search($identifier, $this->getTags()) ?: $identifier;
|
|
|
- $url = $this->getHttpSupport() . '://bitbucket.org/'.$this->owner.'/'.$this->repository.'/get/'.$label.'.zip';
|
|
|
+ $url = $this->getScheme() . '://bitbucket.org/'.$this->owner.'/'.$this->repository.'/get/'.$label.'.zip';
|
|
|
|
|
|
return array('type' => 'zip', 'url' => $url, 'reference' => $label, 'shasum' => '');
|
|
|
}
|
|
@@ -93,7 +93,7 @@ class GitBitbucketDriver extends VcsDriver implements VcsDriverInterface
|
|
|
public function getComposerInformation($identifier)
|
|
|
{
|
|
|
if (!isset($this->infoCache[$identifier])) {
|
|
|
- $composer = @file_get_contents($this->getHttpSupport() . '://bitbucket.org/'.$this->owner.'/'.$this->repository.'/raw/'.$identifier.'/composer.json');
|
|
|
+ $composer = @file_get_contents($this->getScheme() . '://bitbucket.org/'.$this->owner.'/'.$this->repository.'/raw/'.$identifier.'/composer.json');
|
|
|
if (!$composer) {
|
|
|
throw new \UnexpectedValueException('Failed to retrieve composer information for identifier '.$identifier.' in '.$this->getUrl());
|
|
|
}
|
|
@@ -101,7 +101,7 @@ class GitBitbucketDriver extends VcsDriver implements VcsDriverInterface
|
|
|
$composer = JsonFile::parseJson($composer);
|
|
|
|
|
|
if (!isset($composer['time'])) {
|
|
|
- $changeset = json_decode(file_get_contents($this->getHttpSupport() . '://api.bitbucket.org/1.0/repositories/'.$this->owner.'/'.$this->repository.'/changesets/'.$identifier), true);
|
|
|
+ $changeset = json_decode(file_get_contents($this->getScheme() . '://api.bitbucket.org/1.0/repositories/'.$this->owner.'/'.$this->repository.'/changesets/'.$identifier), true);
|
|
|
$composer['time'] = $changeset['timestamp'];
|
|
|
}
|
|
|
$this->infoCache[$identifier] = $composer;
|
|
@@ -116,7 +116,7 @@ class GitBitbucketDriver extends VcsDriver implements VcsDriverInterface
|
|
|
public function getTags()
|
|
|
{
|
|
|
if (null === $this->tags) {
|
|
|
- $tagsData = json_decode(file_get_contents($this->getHttpSupport() . '://api.bitbucket.org/1.0/repositories/'.$this->owner.'/'.$this->repository.'/tags'), true);
|
|
|
+ $tagsData = json_decode(file_get_contents($this->getScheme() . '://api.bitbucket.org/1.0/repositories/'.$this->owner.'/'.$this->repository.'/tags'), true);
|
|
|
$this->tags = array();
|
|
|
foreach ($tagsData as $tag => $data) {
|
|
|
$this->tags[$tag] = $data['raw_node'];
|
|
@@ -132,7 +132,7 @@ class GitBitbucketDriver extends VcsDriver implements VcsDriverInterface
|
|
|
public function getBranches()
|
|
|
{
|
|
|
if (null === $this->branches) {
|
|
|
- $branchData = json_decode(file_get_contents($this->getHttpSupport() . '://api.bitbucket.org/1.0/repositories/'.$this->owner.'/'.$this->repository.'/branches'), true);
|
|
|
+ $branchData = json_decode(file_get_contents($this->getScheme() . '://api.bitbucket.org/1.0/repositories/'.$this->owner.'/'.$this->repository.'/branches'), true);
|
|
|
$this->branches = array();
|
|
|
foreach ($branchData as $branch => $data) {
|
|
|
$this->branches[$branch] = $data['raw_node'];
|