コード例 #1
0
ファイル: UpgradeTask.php プロジェクト: aschempp/tenside-core
 /**
  * {@inheritDoc}
  */
 protected function prepareCommand()
 {
     RuntimeHelper::setupHome($this->file->get(self::SETTING_HOME));
     $command = new UpdateCommand();
     $command->setComposer(Factory::create($this->getIO()));
     return $command;
 }
コード例 #2
0
ファイル: RequirePackageTask.php プロジェクト: tenside/core
 /**
  * {@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());
 }
コード例 #3
0
 /**
  * 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);
 }
コード例 #4
0
ファイル: RuntimeHelperTest.php プロジェクト: tenside/core
 /**
  * Test the setupHome method.
  *
  * @return void
  *
  * @expectedException \InvalidArgumentException
  */
 public function testSetupHomeBailsWithEmptyHome()
 {
     RuntimeHelper::setupHome('');
 }
コード例 #5
0
ファイル: DumpAutoloadTask.php プロジェクト: tenside/core
 /**
  * {@inheritDoc}
  */
 protected function prepareCommand()
 {
     RuntimeHelper::setupHome((string) $this->file->get(self::SETTING_HOME));
     return $this->attachComposerFactory(new DumpAutoloadCommand());
 }
コード例 #6
0
ファイル: UpgradeTask.php プロジェクト: tenside/core
 /**
  * {@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;
 }
コード例 #7
0
ファイル: Application.php プロジェクト: tenside/core-bundle
 /**
  * {@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);
 }