From bddba72e132cfd67576682bff709f535e5d912ea Mon Sep 17 00:00:00 2001 From: xelan Date: Fri, 25 Jul 2014 12:37:11 +0200 Subject: [PATCH] Option to disable inclusion of hostname in OAuth app name --- src/Composer/Config.php | 1 + src/Composer/Util/GitHub.php | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Composer/Config.php b/src/Composer/Config.php index d5b41efe2..e740bb8c7 100644 --- a/src/Composer/Config.php +++ b/src/Composer/Config.php @@ -39,6 +39,7 @@ class Config 'optimize-autoloader' => false, 'prepend-autoloader' => true, 'github-domains' => array('github.com'), + 'github-expose-hostname' => true, 'store-auths' => 'prompt', // valid keys without defaults (auth config stuff): // github-oauth diff --git a/src/Composer/Util/GitHub.php b/src/Composer/Util/GitHub.php index 784cb51c9..8624edc04 100644 --- a/src/Composer/Util/GitHub.php +++ b/src/Composer/Util/GitHub.php @@ -97,8 +97,10 @@ class GitHub // build up OAuth app name $appName = 'Composer'; - if (0 === $this->process->execute('hostname', $output)) { + if ($this->config->get('github-expose-hostname') === true && 0 === $this->process->execute('hostname', $output)) { $appName .= ' on ' . trim($output); + } else { + $appName .= ' [' . date('YmdHis') . ']'; } $headers = array();