/** * {@inheritDoc} */ protected function prepareCommand() { RuntimeHelper::setupHome($this->file->get(self::SETTING_HOME)); $command = new UpdateCommand(); $command->setComposer(Factory::create($this->getIO())); return $command; }
/** * {@inheritDoc} */ protected function prepareCommand() { // Switch home first, this is needed as the command manipulates the RAW composer.json prior to creating the // composer instance. RuntimeHelper::setupHome($this->getHome()); return $this->attachComposerFactory(new RequireCommand()); }
/** * Retrieve a composer instance. * * @param null|IOInterface $inputOutput The input/output handler to use. * * @return Composer */ public function getComposer(IOInterface $inputOutput = null) { if (null === $inputOutput) { $inputOutput = $this->getInputOutput(); } RuntimeHelper::setupHome($this->getTensideHome()); return ComposerFactory::create($inputOutput); }
/** * Test the setupHome method. * * @return void * * @expectedException \InvalidArgumentException */ public function testSetupHomeBailsWithEmptyHome() { RuntimeHelper::setupHome(''); }
/** * {@inheritDoc} */ protected function prepareCommand() { RuntimeHelper::setupHome((string) $this->file->get(self::SETTING_HOME)); return $this->attachComposerFactory(new DumpAutoloadCommand()); }
/** * {@inheritDoc} */ protected function prepareCommand() { RuntimeHelper::setupHome($this->getHome()); $command = new UpdateCommand(); $command->setComposer(Factory::create($this->getIO())); if ($this->isDryRun()) { $pendingUpgrades = $this->getDataDir() . DIRECTORY_SEPARATOR . 'upgrades.json'; $installationManager = new InstallationManager(new JsonFile($pendingUpgrades, null)); $command->getComposer()->setInstallationManager($installationManager); $command->getComposer()->getEventDispatcher()->addListener(InstallerEvents::PRE_DEPENDENCIES_SOLVING, function (InstallerEvent $event) use($installationManager) { $installationManager->setPool($event->getPool()); }); } return $command; }
/** * {@inheritDoc} */ public function doRun(InputInterface $input, OutputInterface $output) { $this->kernel->boot(); if (!$this->commandsRegistered) { $this->registerCommands($output); $this->commandsRegistered = true; } $container = $this->kernel->getContainer(); foreach ($this->all() as $command) { if ($command instanceof ContainerAwareInterface) { $command->setContainer($container); } } $this->setDispatcher($container->get('event_dispatcher')); RuntimeHelper::setupHome($container->get('tenside.home')->homeDir()); $this->inputOutput = new ConsoleIO($input, $output, $this->getHelperSet()); $this->isUpdateNeeded($input, $output); return parent::doRun($input, $output); }