Skip to content

Commit

Permalink
Ensure plugins from CWD/vendor do not get loaded when running create-…
Browse files Browse the repository at this point in the history
…project, fixes #10935
  • Loading branch information
Seldaek committed Jul 12, 2022
1 parent 8323e85 commit 75ef490
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/Composer/Command/CreateProjectCommand.php
Expand Up @@ -403,7 +403,15 @@ protected function installRootPackage(IOInterface $io, Config $config, $packageN
throw new \InvalidArgumentException('Invalid stability provided ('.$stability.'), must be one of: '.implode(', ', array_keys(BasePackage::$stabilities)));
}

$composer = Factory::create($io, $config->all(), $disablePlugins);
$composerJson = array_merge(
// prevent version guessing from happening
array('version' => '1.0.0'),
$config->all(),
// ensure the vendor dir and its plugins does not get loaded if CWD/vendor has plugins in it
array('config' => array('vendor-dir' => Platform::getDevNull()))
);
$factory = new Factory;
$composer = $factory->createComposer($io, $composerJson, $disablePlugins, Platform::getDevNull(), true, $disableScripts);
$config = $composer->getConfig();
$rm = $composer->getRepositoryManager();

Expand Down

0 comments on commit 75ef490

Please sign in to comment.