From 3d1e0e79ccc79af687beaf807123496fa74053d3 Mon Sep 17 00:00:00 2001 From: Kath Young Date: Tue, 22 Jan 2019 11:18:35 +1030 Subject: [PATCH] Allow for no-api for Github to be a composer configuration as well as repo specific --- src/Composer/Config.php | 5 +++-- src/Composer/Repository/Vcs/GitHubDriver.php | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Composer/Config.php b/src/Composer/Config.php index 7b4220724..c34d8f38f 100644 --- a/src/Composer/Config.php +++ b/src/Composer/Config.php @@ -61,6 +61,7 @@ class Config 'archive-format' => 'tar', 'archive-dir' => '.', 'htaccess-protect' => true, + 'no-api' => false, // valid keys without defaults (auth config stuff): // bitbucket-oauth // github-oauth @@ -317,10 +318,10 @@ class Config case 'disable-tls': return $this->config[$key] !== 'false' && (bool) $this->config[$key]; - case 'secure-http': return $this->config[$key] !== 'false' && (bool) $this->config[$key]; - + case 'no-api': + return $this->config[$key] !== 'false' && (bool) $this->config[$key]; default: if (!isset($this->config[$key])) { return null; diff --git a/src/Composer/Repository/Vcs/GitHubDriver.php b/src/Composer/Repository/Vcs/GitHubDriver.php index d0b721af9..14e51699f 100644 --- a/src/Composer/Repository/Vcs/GitHubDriver.php +++ b/src/Composer/Repository/Vcs/GitHubDriver.php @@ -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); - 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); return;