Browse Source

Bullet-proof global composer instantiation

Jordi Boggiano 10 years ago
parent
commit
d621c51b2c
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/Composer/Factory.php

+ 2 - 2
src/Composer/Factory.php

@@ -353,12 +353,12 @@ class Factory
         }
 
         $composer = null;
-        chdir($config->get('home'));
         try {
+            chdir($config->get('home'));
             $composer = self::createComposer($io, null, $disablePlugins, false);
         } catch (\Exception $e) {
         }
-        chdir($oldCwd);
+        @chdir($oldCwd);
 
         return $composer;
     }