From 4dc8748e685734e020801f3f8cb2feaa1b663856 Mon Sep 17 00:00:00 2001 From: Matt Isenhower Date: Fri, 19 May 2017 20:06:18 -0700 Subject: [PATCH 1/3] Update GitLab personal access token URL and the token config command --- src/Composer/Util/GitLab.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Composer/Util/GitLab.php b/src/Composer/Util/GitLab.php index 99fcac73f..30c28d3da 100644 --- a/src/Composer/Util/GitLab.php +++ b/src/Composer/Util/GitLab.php @@ -112,8 +112,8 @@ class GitLab $this->io->writeError('Maximum number of login attempts exceeded. Please try again later.'); } - $this->io->writeError('You can also manually create a personal token at '.$scheme.'://'.$originUrl.'/profile/applications'); - $this->io->writeError('Add it using "composer config gitlab-oauth.'.$originUrl.' "'); + $this->io->writeError('You can also manually create a personal token at '.$scheme.'://'.$originUrl.'/profile/personal_access_tokens'); + $this->io->writeError('Add it using "composer config gitlab-token.'.$originUrl.' "'); continue; } From 2eb69cd6790206db577a0e6d72de44439c91df4e Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Sun, 21 May 2017 16:45:03 +0200 Subject: [PATCH 2/3] Always recommend using global config to store auth tokens --- src/Composer/Util/Bitbucket.php | 6 +++--- src/Composer/Util/GitHub.php | 4 ++-- src/Composer/Util/GitLab.php | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Composer/Util/Bitbucket.php b/src/Composer/Util/Bitbucket.php index cba9fd25d..1c578576f 100644 --- a/src/Composer/Util/Bitbucket.php +++ b/src/Composer/Util/Bitbucket.php @@ -109,7 +109,7 @@ class Bitbucket return false; } elseif (in_array($e->getCode(), array(403, 401))) { $this->io->writeError('Invalid OAuth consumer provided.'); - $this->io->writeError('You can also add it manually later by using "composer config bitbucket-oauth.bitbucket.org "'); + $this->io->writeError('You can also add it manually later by using "composer config --global --auth bitbucket-oauth.bitbucket.org "'); return false; } @@ -144,7 +144,7 @@ class Bitbucket if (!$consumerKey) { $this->io->writeError('No consumer key given, aborting.'); - $this->io->writeError('You can also add it manually later by using "composer config bitbucket-oauth.bitbucket.org "'); + $this->io->writeError('You can also add it manually later by using "composer config --global --auth bitbucket-oauth.bitbucket.org "'); return false; } @@ -153,7 +153,7 @@ class Bitbucket if (!$consumerSecret) { $this->io->writeError('No consumer secret given, aborting.'); - $this->io->writeError('You can also add it manually later by using "composer config bitbucket-oauth.bitbucket.org "'); + $this->io->writeError('You can also add it manually later by using "composer config --global --auth bitbucket-oauth.bitbucket.org "'); return false; } diff --git a/src/Composer/Util/GitHub.php b/src/Composer/Util/GitHub.php index a8fd3dc70..8415c9a5c 100644 --- a/src/Composer/Util/GitHub.php +++ b/src/Composer/Util/GitHub.php @@ -94,7 +94,7 @@ class GitHub if (!$token) { $this->io->writeError('No token given, aborting.'); - $this->io->writeError('You can also add it manually later by using "composer config github-oauth.github.com "'); + $this->io->writeError('You can also add it manually later by using "composer config --global --auth github-oauth.github.com "'); return false; } @@ -110,7 +110,7 @@ class GitHub } catch (TransportException $e) { if (in_array($e->getCode(), array(403, 401))) { $this->io->writeError('Invalid token provided.'); - $this->io->writeError('You can also add it manually later by using "composer config github-oauth.github.com "'); + $this->io->writeError('You can also add it manually later by using "composer config --global --auth github-oauth.github.com "'); return false; } diff --git a/src/Composer/Util/GitLab.php b/src/Composer/Util/GitLab.php index 30c28d3da..fb809e2d4 100644 --- a/src/Composer/Util/GitLab.php +++ b/src/Composer/Util/GitLab.php @@ -113,7 +113,7 @@ class GitLab } $this->io->writeError('You can also manually create a personal token at '.$scheme.'://'.$originUrl.'/profile/personal_access_tokens'); - $this->io->writeError('Add it using "composer config gitlab-token.'.$originUrl.' "'); + $this->io->writeError('Add it using "composer config --global --auth gitlab-token.'.$originUrl.' "'); continue; } From d7b2e42fa9bb43a00933160baa19ba71701efa68 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Sun, 21 May 2017 17:15:27 +0200 Subject: [PATCH 3/3] Do not split repo names on dots, fixes #6424 --- src/Composer/Json/JsonManipulator.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Composer/Json/JsonManipulator.php b/src/Composer/Json/JsonManipulator.php index 773d9bae6..f69d72db6 100644 --- a/src/Composer/Json/JsonManipulator.php +++ b/src/Composer/Json/JsonManipulator.php @@ -184,7 +184,7 @@ class JsonManipulator $decoded = JsonFile::parseJson($this->contents); $subName = null; - if (in_array($mainNode, array('config', 'repositories', 'extra')) && false !== strpos($name, '.')) { + if (in_array($mainNode, array('config', 'extra')) && false !== strpos($name, '.')) { list($name, $subName) = explode('.', $name, 2); } @@ -304,7 +304,7 @@ class JsonManipulator } $subName = null; - if (in_array($mainNode, array('config', 'repositories', 'extra')) && false !== strpos($name, '.')) { + if (in_array($mainNode, array('config', 'extra')) && false !== strpos($name, '.')) { list($name, $subName) = explode('.', $name, 2); }