From 433968de1736958adeb1bf624f538c06d8f35e27 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Fri, 17 Jul 2020 11:30:03 +0200 Subject: [PATCH] Fix usage of create-project with local filesystem repos --- src/Composer/Command/CreateProjectCommand.php | 2 +- src/Composer/Command/InitCommand.php | 4 ++-- tests/Composer/Test/AllFunctionalTest.php | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Composer/Command/CreateProjectCommand.php b/src/Composer/Command/CreateProjectCommand.php index d633e1519..ddebbac8c 100644 --- a/src/Composer/Command/CreateProjectCommand.php +++ b/src/Composer/Command/CreateProjectCommand.php @@ -356,7 +356,7 @@ EOT $repositorySet->addRepository(new CompositeRepository(RepositoryFactory::defaultRepos($io, $config))); } else { foreach ($repositories as $repo) { - $repoConfig = RepositoryFactory::configFromString($io, $config, $repo); + $repoConfig = RepositoryFactory::configFromString($io, $config, $repo, true); if ( (isset($repoConfig['packagist']) && $repoConfig === array('packagist' => false)) || (isset($repoConfig['packagist.org']) && $repoConfig === array('packagist.org' => false)) diff --git a/src/Composer/Command/InitCommand.php b/src/Composer/Command/InitCommand.php index 111edbde9..204038951 100644 --- a/src/Composer/Command/InitCommand.php +++ b/src/Composer/Command/InitCommand.php @@ -98,7 +98,7 @@ EOT if ($repositories) { $config = Factory::createConfig($io); foreach ($repositories as $repo) { - $options['repositories'][] = RepositoryFactory::configFromString($io, $config, $repo); + $options['repositories'][] = RepositoryFactory::configFromString($io, $config, $repo, true); } } @@ -173,7 +173,7 @@ EOT $repos = array(new PlatformRepository); $createDefaultPackagistRepo = true; foreach ($repositories as $repo) { - $repoConfig = RepositoryFactory::configFromString($io, $config, $repo); + $repoConfig = RepositoryFactory::configFromString($io, $config, $repo, true); if ( (isset($repoConfig['packagist']) && $repoConfig === array('packagist' => false)) || (isset($repoConfig['packagist.org']) && $repoConfig === array('packagist.org' => false)) diff --git a/tests/Composer/Test/AllFunctionalTest.php b/tests/Composer/Test/AllFunctionalTest.php index 5e8ebb5c4..bd8e7b853 100644 --- a/tests/Composer/Test/AllFunctionalTest.php +++ b/tests/Composer/Test/AllFunctionalTest.php @@ -100,7 +100,7 @@ class AllFunctionalTest extends TestCase * @dataProvider getTestFiles * @depends testBuildPhar */ - public function testIntegration(\SplFileInfo $testFile) + public function testIntegration($testFile) { $testData = $this->parseTestFile($testFile); @@ -133,15 +133,15 @@ class AllFunctionalTest extends TestCase { $tests = array(); foreach (Finder::create()->in(__DIR__.'/Fixtures/functional')->name('*.test')->files() as $file) { - $tests[] = array($file); + $tests[] = array($file->getRealPath()); } return $tests; } - private function parseTestFile(\SplFileInfo $file) + private function parseTestFile($file) { - $tokens = preg_split('#(?:^|\n*)--([A-Z-]+)--\n#', file_get_contents($file->getRealPath()), null, PREG_SPLIT_DELIM_CAPTURE); + $tokens = preg_split('#(?:^|\n*)--([A-Z-]+)--\n#', file_get_contents($file), null, PREG_SPLIT_DELIM_CAPTURE); $data = array(); $section = null;