protected function execute(InputInterface $input, OutputInterface $output) { $helper = $this->getHelper('package'); Util\TmpDir::set($input->getOption('tmp-dir')); /* TODO Rework this to use the Info package command */ $cb = function (Interfaces\Package $package) use($helper, $output) { $helper->showInfo($output, $package); }; $path = rtrim($input->getArgument('path'), '/\\'); /* Getting package unpacked first, then use the path*/ $package = $this->getHelper('package')->convey($input, $output, $path); $release = Release::factory($package->getRootDir(), $cb, $input->getOption('no-convert'), $input->getOption('binary')); if ($input->getOption('binary')) { list($optionsValue, $force_opts) = $this->buildOptions($package, $input, $output); $build = \Pickle\Package\Command\Build::factory($package, $optionsValue); try { $build->prepare(); $build->createTempDir($package->getUniqueNameForFs()); $build->configure($force_opts); $build->make(); $this->saveBuildLogs($input, $build); } catch (\Exception $e) { if ($input->getOption('pack-logs')) { $release->packLog($build); } else { $this->saveBuildLogs($input, $build); } $output->writeln('The following error(s) happened: ' . $e->getMessage()); } $args = array('build' => $build); try { $release->create($args); if ($input->getOption('pack-logs')) { $release->packLog(); } } catch (Exception $e) { if ($input->getOption('pack-logs')) { $release->packLog(); } $build->cleanup(); throw new \Exception($e->getMessage()); } } else { /* imply --source */ try { $release->create(); if ($input->getOption('pack-logs')) { $release->packLog(); } } catch (Exception $e) { if ($input->getOption('pack-logs')) { $release->packLog(); } throw new \Exception($e->getMessage()); } } }
protected function execute(InputInterface $input, OutputInterface $output) { Util\TmpDir::set($input->getOption('tmp-dir')); $helper = $this->getHelper('package'); $cb = function (\Pickle\Base\Interfaces\Package $package) use($helper, $output) { $output->writeln('<info>Successfully converted ' . $package->getPrettyName() . '</info>'); $helper->showInfo($output, $package); }; $convert = Convert::factory($input->getArgument('path'), $cb); $convert->process(); }
protected function execute(InputInterface $input, OutputInterface $output) { $path = rtrim($input->getArgument('path'), '/\\'); $helper = $this->getHelper('package'); Util\TmpDir::set($input->getOption('tmp-dir')); $cb = function (Interfaces\Package $package) use($helper, $output) { /* TODO Rework this to use the Info package command */ $helper->showInfo($output, $package); $output->writeln(trim($package->getDescription())); }; $validate = Validate::factory($path, $cb); $validate->process(); }
protected function execute(InputInterface $input, OutputInterface $output) { Util\TmpDir::set($input->getOption('tmp-dir')); $helper = $this->getHelper('package'); $cb = function (Interfaces\Package\Info $info) use($helper, $output) { /* TODO The part of the helper showing package info plus the concrete info class implementation should be reworked. The concrete Info class should provide information for this callback, whereby the output format and how it is shown should be controleld by the helper. */ $helper->showInfo($output, $info->getPackage()); $output->writeln(['', trim($info->getPackage()->getDescription()), '']); $output->writeln('<info>Configure options</info>'); $helper->showOptions($output, $info->getPackage()); }; $path = rtrim($input->getArgument('path'), DIRECTORY_SEPARATOR); $package = $helper->convey($input, $output, $path); $info = Info::factory($package, $cb); $info->show(); }
protected function execute(InputInterface $input, OutputInterface $output) { $path = rtrim($input->getArgument('path'), '/\\'); Util\TmpDir::set($input->getOption('tmp-dir')); /* if windows, try bin install by default */ if (defined('PHP_WINDOWS_VERSION_MAJOR')) { $sourceRequested = $input->getOption('source'); if (!$sourceRequested) { $this->binaryInstallWindows($path, $input, $output); return 0; } } $package = $this->getHelper('package')->convey($input, $output, $path); /* TODO Info package command should be used here. */ $this->getHelper('package')->showInfo($output, $package); list($optionsValue, $force_opts) = $this->buildOptions($package, $input, $output); if ($input->getOption('dry-run')) { return 0; } $this->sourceInstall($package, $input, $output, $optionsValue, $force_opts); return 0; }