public function run_install() { ob_start(); $input = new ArgvInput(array()); $output = new ConsoleOutput(); $helper = new HelperSet(); $config = new Config(); $output->setVerbosity(0); $io = new ConsoleIO($input, $output, $helper); $composer = Factory::create($io); $composer->setConfig($config); $update = new InstallCommand(); $update->setComposer($composer); $out = $update->run($input, $output); ob_end_clean(); return $out; }
protected function execute(InputInterface $input, OutputInterface $output) { $newWorkDir = $this->getNewWorkingDir($input); if (!is_dir($newWorkDir)) { throw new \RuntimeException("Not found directory:" . $newWorkDir); } $oldWorkingDir = getcwd(); chdir($newWorkDir); $io = new ConsoleIO($input, $output, $this->getHelperSet()); $composer = Factory::create($io); $this->setComposer($composer); $this->setIO($io); $statusCode = parent::execute($input, $output); if (isset($oldWorkingDir)) { chdir($oldWorkingDir); } return $statusCode; }