From fe45e616ab0fbfc3ac9835dfb94e21b248738a05 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Fri, 10 Mar 2017 09:59:45 +0100 Subject: [PATCH 1/4] Add missing link --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4dbbaf154..1e358fa72 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -520,6 +520,7 @@ * Initial release +[1.4.1]: https://github.com/composer/composer/compare/1.4.0...1.4.1 [1.4.0]: https://github.com/composer/composer/compare/1.3.3...1.4.0 [1.3.3]: https://github.com/composer/composer/compare/1.3.2...1.3.3 [1.3.2]: https://github.com/composer/composer/compare/1.3.1...1.3.2 From a4c9c1235eaa8e81ca8a23c4c0c442da04f9c83b Mon Sep 17 00:00:00 2001 From: David Zuelke Date: Tue, 14 Mar 2017 16:59:39 +0100 Subject: [PATCH 2/4] fix #6244 --- src/Composer/Downloader/ArchiveDownloader.php | 4 ---- src/Composer/Downloader/FileDownloader.php | 5 ++++- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/Composer/Downloader/ArchiveDownloader.php b/src/Composer/Downloader/ArchiveDownloader.php index 8f7d751a3..cc6b34c2f 100644 --- a/src/Composer/Downloader/ArchiveDownloader.php +++ b/src/Composer/Downloader/ArchiveDownloader.php @@ -91,10 +91,6 @@ abstract class ArchiveDownloader extends FileDownloader break; } - - if ($output) { - $this->io->writeError(''); - } } /** diff --git a/src/Composer/Downloader/FileDownloader.php b/src/Composer/Downloader/FileDownloader.php index 293be3a1d..8bdf0a519 100644 --- a/src/Composer/Downloader/FileDownloader.php +++ b/src/Composer/Downloader/FileDownloader.php @@ -90,7 +90,8 @@ class FileDownloader implements DownloaderInterface $urls = $package->getDistUrls(); while ($url = array_shift($urls)) { try { - return $this->doDownload($package, $path, $url); + $fileName = $this->doDownload($package, $path, $url); + break; } catch (\Exception $e) { if ($this->io->isDebug()) { $this->io->writeError(''); @@ -109,6 +110,8 @@ class FileDownloader implements DownloaderInterface if ($output) { $this->io->writeError(''); } + + return $fileName; } protected function doDownload(PackageInterface $package, $path, $url) From 4ba3c741f50d8d706ce8733bd918e63ff9b6efb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jose=20Miguel=20Pe=CC=81rez=20Ruiz?= Date: Thu, 16 Mar 2017 01:43:54 +0100 Subject: [PATCH 3/4] Fix Init Command to accept author names with Unicode combining diacritical marks --- src/Composer/Command/InitCommand.php | 2 +- tests/Composer/Test/Command/InitCommandTest.php | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/Composer/Command/InitCommand.php b/src/Composer/Command/InitCommand.php index 7c3ce96f5..94ac109fc 100644 --- a/src/Composer/Command/InitCommand.php +++ b/src/Composer/Command/InitCommand.php @@ -320,7 +320,7 @@ EOT */ public function parseAuthorString($author) { - if (preg_match('/^(?P[- .,\p{L}\p{N}\'’"()]+) <(?P.+?)>$/u', $author, $match)) { + if (preg_match('/^(?P[- .,\p{L}\p{N}\p{Mn}\'’"()]+) <(?P.+?)>$/u', $author, $match)) { if ($this->isValidEmail($match['email'])) { return array( 'name' => trim($match['name']), diff --git a/tests/Composer/Test/Command/InitCommandTest.php b/tests/Composer/Test/Command/InitCommandTest.php index 23bc32acb..81aaf0d17 100644 --- a/tests/Composer/Test/Command/InitCommandTest.php +++ b/tests/Composer/Test/Command/InitCommandTest.php @@ -33,6 +33,16 @@ class InitCommandTest extends TestCase $this->assertEquals('matti@example.com', $author['email']); } + public function testParseValidUtf8AuthorStringWithNonSpacingMarks() + { + // \xCC\x88 is UTF-8 for U+0308 diaeresis (umlaut) combining mark + $utf8_expected = "Matti Meika\xCC\x88la\xCC\x88inen"; + $command = new InitCommand; + $author = $command->parseAuthorString($utf8_expected." "); + $this->assertEquals($utf8_expected, $author['name']); + $this->assertEquals('matti@example.com', $author['email']); + } + public function testParseNumericAuthorString() { $command = new InitCommand; From 7aeb1b0c413c0a8131b378aaf2aa9b3f29a03c56 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Fri, 17 Mar 2017 22:09:51 +0100 Subject: [PATCH 4/4] Fix conversion of repo format in config command, fixes #6245, closes #6271 --- src/Composer/Config/JsonConfigSource.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/Composer/Config/JsonConfigSource.php b/src/Composer/Config/JsonConfigSource.php index cbfb2292c..68de49ab3 100644 --- a/src/Composer/Config/JsonConfigSource.php +++ b/src/Composer/Config/JsonConfigSource.php @@ -60,6 +60,21 @@ class JsonConfigSource implements ConfigSourceInterface public function addRepository($name, $config) { $this->manipulateJson('addRepository', $name, $config, function (&$config, $repo, $repoConfig) { + // if converting from an array format to hashmap format, and there is a {"packagist.org":false} repo, we have + // to convert it to "packagist.org": false key on the hashmap otherwise it fails schema validation + if (isset($config['repositories'])) { + foreach ($config['repositories'] as $index => $val) { + if ($index === $repo) { + continue; + } + if (is_numeric($index) && ($val === array('packagist' => false) || $val === array('packagist.org' => false))) { + unset($config['repositories'][$index]); + $config['repositories']['packagist.org'] = false; + break; + } + } + } + $config['repositories'][$repo] = $repoConfig; }); }