Allow for no-api for Github to be a composer configuration as well as repo specific
parent
0fca816d8f
commit
3d1e0e79cc
|
@ -61,6 +61,7 @@ class Config
|
||||||
'archive-format' => 'tar',
|
'archive-format' => 'tar',
|
||||||
'archive-dir' => '.',
|
'archive-dir' => '.',
|
||||||
'htaccess-protect' => true,
|
'htaccess-protect' => true,
|
||||||
|
'no-api' => false,
|
||||||
// valid keys without defaults (auth config stuff):
|
// valid keys without defaults (auth config stuff):
|
||||||
// bitbucket-oauth
|
// bitbucket-oauth
|
||||||
// github-oauth
|
// github-oauth
|
||||||
|
@ -317,10 +318,10 @@ class Config
|
||||||
|
|
||||||
case 'disable-tls':
|
case 'disable-tls':
|
||||||
return $this->config[$key] !== 'false' && (bool) $this->config[$key];
|
return $this->config[$key] !== 'false' && (bool) $this->config[$key];
|
||||||
|
|
||||||
case 'secure-http':
|
case 'secure-http':
|
||||||
return $this->config[$key] !== 'false' && (bool) $this->config[$key];
|
return $this->config[$key] !== 'false' && (bool) $this->config[$key];
|
||||||
|
case 'no-api':
|
||||||
|
return $this->config[$key] !== 'false' && (bool) $this->config[$key];
|
||||||
default:
|
default:
|
||||||
if (!isset($this->config[$key])) {
|
if (!isset($this->config[$key])) {
|
||||||
return null;
|
return null;
|
||||||
|
|
|
@ -56,7 +56,7 @@ class GitHubDriver extends VcsDriver
|
||||||
}
|
}
|
||||||
$this->cache = new Cache($this->io, $this->config->get('cache-repo-dir').'/'.$this->originUrl.'/'.$this->owner.'/'.$this->repository);
|
$this->cache = new Cache($this->io, $this->config->get('cache-repo-dir').'/'.$this->originUrl.'/'.$this->owner.'/'.$this->repository);
|
||||||
|
|
||||||
if (isset($this->repoConfig['no-api']) && $this->repoConfig['no-api']) {
|
if ( $this->config->get('no-api') === true || (isset($this->repoConfig['no-api']) && $this->repoConfig['no-api'] ) ){
|
||||||
$this->setupGitDriver($this->url);
|
$this->setupGitDriver($this->url);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in New Issue