From 8a2d1a2ee26fa7a2d29621adcf59706a891a3076 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Fri, 19 Feb 2016 16:25:25 +0000 Subject: [PATCH] Make artifact paths in lock file cross-platform, fixes #3832 --- src/Composer/Repository/ArtifactRepository.php | 2 +- tests/Composer/Test/Repository/ArtifactRepositoryTest.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Composer/Repository/ArtifactRepository.php b/src/Composer/Repository/ArtifactRepository.php index ece78bb1c..e0f01dc33 100644 --- a/src/Composer/Repository/ArtifactRepository.php +++ b/src/Composer/Repository/ArtifactRepository.php @@ -143,7 +143,7 @@ class ArtifactRepository extends ArrayRepository implements ConfigurableReposito $package = JsonFile::parseJson($json, $composerFile); $package['dist'] = array( 'type' => 'zip', - 'url' => $file->getPathname(), + 'url' => strtr($file->getPathname(), '\\', '/'), 'shasum' => sha1_file($file->getRealPath()), ); diff --git a/tests/Composer/Test/Repository/ArtifactRepositoryTest.php b/tests/Composer/Test/Repository/ArtifactRepositoryTest.php index 66c02acdc..a77cf1a72 100644 --- a/tests/Composer/Test/Repository/ArtifactRepositoryTest.php +++ b/tests/Composer/Test/Repository/ArtifactRepositoryTest.php @@ -60,7 +60,7 @@ class ArtifactRepositoryTest extends TestCase $repo = new ArtifactRepository($coordinates, new NullIO(), new Config()); foreach ($repo->getPackages() as $package) { - $this->assertTrue(strpos($package->getDistUrl(), $absolutePath) === 0); + $this->assertTrue(strpos($package->getDistUrl(), strtr($absolutePath, '\\', '/')) === 0); } }