diff --git a/src/Composer/EventDispatcher/EventDispatcher.php b/src/Composer/EventDispatcher/EventDispatcher.php index d19245ad3..d5cd9aabd 100644 --- a/src/Composer/EventDispatcher/EventDispatcher.php +++ b/src/Composer/EventDispatcher/EventDispatcher.php @@ -253,7 +253,14 @@ class EventDispatcher } } else { $args = implode(' ', array_map(array('Composer\Util\ProcessExecutor', 'escape'), $event->getArguments())); - $exec = $callable . ($args === '' ? '' : ' '.$args); + + // @putenv does not receive arguments + if (strpos($callable, '@putenv ') === 0) { + $exec = $callable; + } else { + $exec = $callable . ($args === '' ? '' : ' '.$args); + } + if ($this->io->isVerbose()) { $this->io->writeError(sprintf('> %s: %s', $event->getName(), $exec)); } elseif ($event->getName() !== '__exec_command') { diff --git a/src/Composer/Repository/PathRepository.php b/src/Composer/Repository/PathRepository.php index ce1babd3c..2a77a83db 100644 --- a/src/Composer/Repository/PathRepository.php +++ b/src/Composer/Repository/PathRepository.php @@ -226,7 +226,11 @@ class PathRepository extends ArrayRepository implements ConfigurableRepositoryIn } } - $this->addPackage($this->loader->load($package)); + try { + $this->addPackage($this->loader->load($package)); + } catch (\Exception $e) { + throw new \RuntimeException('Failed loading the package in '.$composerFilePath, 0, $e); + } } }