|
28 | 28 | use Composer\Installer\PackageEvent;
|
29 | 29 | use Composer\Installer\PackageEvents;
|
30 | 30 | use Composer\Installer\SuggestedPackagesReporter;
|
| 31 | +use Composer\IO\ConsoleIO; |
31 | 32 | use Composer\IO\IOInterface;
|
32 | 33 | use Composer\IO\NullIO;
|
33 | 34 | use Composer\Json\JsonFile;
|
|
46 | 47 | use Composer\Script\Event;
|
47 | 48 | use Composer\Script\ScriptEvents;
|
48 | 49 | use Symfony\Component\Console\Input\ArgvInput;
|
| 50 | +use Symfony\Component\Console\Output\OutputInterface; |
49 | 51 | use Symfony\Flex\Event\UpdateEvent;
|
50 | 52 | use Symfony\Flex\Unpack\Operation;
|
51 | 53 | use Symfony\Thanks\Thanks;
|
|
56 | 58 | */
|
57 | 59 | class Flex implements PluginInterface, EventSubscriberInterface
|
58 | 60 | {
|
| 61 | + /** |
| 62 | + * @var Composer |
| 63 | + */ |
59 | 64 | private $composer;
|
| 65 | + |
| 66 | + /** |
| 67 | + * @var IOInterface |
| 68 | + */ |
60 | 69 | private $io;
|
| 70 | + |
61 | 71 | private $config;
|
62 | 72 | private $options;
|
63 | 73 | private $configurator;
|
@@ -415,14 +425,30 @@ public function update(Event $event = null, $operations = [])
|
415 | 425 | }, $this->installer, $this->installer)();
|
416 | 426 | $this->composer->getEventDispatcher()->__construct($this->composer, $this->io);
|
417 | 427 |
|
| 428 | + $status = $this->installer->run(); |
| 429 | + if (0 !== $status) { |
| 430 | + exit($status); |
| 431 | + } |
| 432 | + |
418 | 433 | $unpacker = new Unpacker($this->composer, new PackageResolver($this->downloader), $this->dryRun);
|
419 | 434 | $result = $unpacker->unpack($unpackOp);
|
420 | 435 | $unpacker->updateLock($result, $this->io);
|
421 | 436 |
|
422 |
| - $status = $this->installer->run(); |
423 |
| - if (0 !== $status) { |
424 |
| - exit($status); |
| 437 | + if ($this->io instanceof ConsoleIO) { |
| 438 | + \Closure::bind(function () { |
| 439 | + $this->output->setVerbosity(OutputInterface::VERBOSITY_QUIET); |
| 440 | + }, $this->io, $this->io)(); |
425 | 441 | }
|
| 442 | + |
| 443 | + \Closure::bind(function ($locker) { |
| 444 | + $this->locker = $locker; |
| 445 | + $this->dumpAutoloader = false; |
| 446 | + $this->runScripts = false; |
| 447 | + $this->ignorePlatformReqs = true; |
| 448 | + $this->update = false; |
| 449 | + }, $this->installer, $this->installer)($this->composer->getLocker()); |
| 450 | + |
| 451 | + $this->installer->run(); |
426 | 452 | }
|
427 | 453 |
|
428 | 454 | public function install(Event $event = null)
|
|
0 commit comments