From cb3d9527e1b737062b08c4f1b4949590c014d859 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Sat, 21 Nov 2015 02:42:41 +0000 Subject: [PATCH] Avoid some external process calls when creating the global composer instance, saves a few ms of initialization time --- src/Composer/Factory.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Composer/Factory.php b/src/Composer/Factory.php index 97e859904..18f76338b 100644 --- a/src/Composer/Factory.php +++ b/src/Composer/Factory.php @@ -271,6 +271,12 @@ class Factory // load local repository $this->addLocalRepository($rm, $vendorDir); + // force-set the version of the global package if not defined as + // guessing it adds no value and only takes time + if (!$fullLoad && !isset($localConfig['version'])) { + $localConfig['version'] = '1.0.0'; + } + // load package $parser = new VersionParser; $guesser = new VersionGuesser($config, new ProcessExecutor($io), $parser);