From 9aa213b32927c82895341223f888403bb648d04c Mon Sep 17 00:00:00 2001 From: johnstevenson Date: Tue, 10 Jan 2017 23:30:56 +0000 Subject: [PATCH 1/2] Work-around for Windows opcache bug, fixes #6052 --- src/Composer/XdebugHandler.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Composer/XdebugHandler.php b/src/Composer/XdebugHandler.php index fb0570925..ad2343c0e 100644 --- a/src/Composer/XdebugHandler.php +++ b/src/Composer/XdebugHandler.php @@ -173,7 +173,12 @@ class XdebugHandler $content .= $data.PHP_EOL; } - $content .= PHP_EOL.'memory_limit='.ini_get('memory_limit').PHP_EOL; + $content .= 'memory_limit='.ini_get('memory_limit').PHP_EOL; + + if (defined('PHP_WINDOWS_VERSION_BUILD')) { + // Work-around for PHP windows bug, see issue #6052 + $content .= 'opcache.enable_cli=0'.PHP_EOL; + } return @file_put_contents($this->tmpIni, $content); } From f3d0e4660d3c2d5771ea408c393e20e01e145b49 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Fri, 27 Jan 2017 18:01:24 +0100 Subject: [PATCH 2/2] Fix urlencoding of gitlab dots, fixes #6064 --- src/Composer/Repository/Vcs/GitLabDriver.php | 4 +++- tests/Composer/Test/Repository/Vcs/GitLabDriverTest.php | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Composer/Repository/Vcs/GitLabDriver.php b/src/Composer/Repository/Vcs/GitLabDriver.php index 5f3538869..c5d794321 100644 --- a/src/Composer/Repository/Vcs/GitLabDriver.php +++ b/src/Composer/Repository/Vcs/GitLabDriver.php @@ -220,7 +220,9 @@ class GitLabDriver extends VcsDriver $encoded = ''; for ($i = 0; isset($string[$i]); $i++) { $character = $string[$i]; - if (!ctype_alnum($character)) $character = '%' . sprintf('%02X', ord($character)); + if (!ctype_alnum($character) && !in_array($character, array('-', '_'), true)) { + $character = '%' . sprintf('%02X', ord($character)); + } $encoded .= $character; } return $encoded; diff --git a/tests/Composer/Test/Repository/Vcs/GitLabDriverTest.php b/tests/Composer/Test/Repository/Vcs/GitLabDriverTest.php index 268d0c0a0..2190410e3 100644 --- a/tests/Composer/Test/Repository/Vcs/GitLabDriverTest.php +++ b/tests/Composer/Test/Repository/Vcs/GitLabDriverTest.php @@ -290,8 +290,8 @@ JSON; public function testGitlabSubDirectory() { - $url = 'https://mycompany.com/gitlab/mygroup/myproject'; - $apiUrl = 'https://mycompany.com/gitlab/api/v3/projects/mygroup%2Fmyproject'; + $url = 'https://mycompany.com/gitlab/mygroup/my-pro.ject'; + $apiUrl = 'https://mycompany.com/gitlab/api/v3/projects/mygroup%2Fmy-pro%2Eject'; $driver = new GitLabDriver(array('url' => $url), $this->io->reveal(), $this->config, $this->process->reveal(), $this->remoteFilesystem->reveal()); $driver->initialize();