1
0
Fork 0

Remove the http protocol from github-protocols, refs #1955

pull/2053/head
Jordi Boggiano 2013-06-28 19:16:12 +02:00
parent a6e3b23ca5
commit e68d455c5c
3 changed files with 14 additions and 6 deletions

View File

@ -606,9 +606,10 @@ The following options are supported:
* **preferred-install:** Defaults to `auto` and can be any of `source`, `dist` or * **preferred-install:** Defaults to `auto` and can be any of `source`, `dist` or
`auto`. This option allows you to set the install method Composer will prefer to `auto`. This option allows you to set the install method Composer will prefer to
use. use.
* **github-protocols:** Defaults to `["git", "https", "http"]`. A list of * **github-protocols:** Defaults to `["git", "https"]`. A list of protocols to
protocols to use when cloning from github.com, in priority order. Use this if you use when cloning from github.com, in priority order. You can reconfigure it to
are behind a proxy or have somehow bad performances with the git protocol. prioritize the https protocol if you are behind a proxy or have somehow bad
performances with the git protocol.
* **github-oauth:** A list of domain names and oauth keys. For example using * **github-oauth:** A list of domain names and oauth keys. For example using
`{"github.com": "oauthtoken"}` as the value of this option will use `oauthtoken` `{"github.com": "oauthtoken"}` as the value of this option will use `oauthtoken`
to access private repositories on github and to circumvent the low IP-based to access private repositories on github and to circumvent the low IP-based

View File

@ -297,8 +297,8 @@ EOT
} }
foreach ($vals as $val) { foreach ($vals as $val) {
if (!in_array($val, array('git', 'https', 'http'))) { if (!in_array($val, array('git', 'https'))) {
return 'valid protocols include: git, https, http'; return 'valid protocols include: git, https';
} }
} }

View File

@ -24,7 +24,7 @@ class Config
'use-include-path' => false, 'use-include-path' => false,
'preferred-install' => 'auto', 'preferred-install' => 'auto',
'notify-on-install' => true, 'notify-on-install' => true,
'github-protocols' => array('git', 'https', 'http'), 'github-protocols' => array('git', 'https'),
'vendor-dir' => 'vendor', 'vendor-dir' => 'vendor',
'bin-dir' => '{$vendor-dir}/bin', 'bin-dir' => '{$vendor-dir}/bin',
'cache-dir' => '{$home}/cache', 'cache-dir' => '{$home}/cache',
@ -200,6 +200,13 @@ class Config
return $this->config[$key]; return $this->config[$key];
case 'github-protocols':
if (reset($this->config['github-protocols']) === 'http') {
throw new \RuntimeException('The http protocol for github is not available anymore, update your config\'s github-protocols to use "https" or "git"');
}
return $this->config[$key];
default: default:
if (!isset($this->config[$key])) { if (!isset($this->config[$key])) {
return null; return null;