Deploys the application to another server using a deployer.

@param string          $server   The server name
@param string          $deployer The deployer name
@param OutputInterface $output   The output object
321780
protected function deploy($server, $deployer, OutputInterface $output)
    {
        $plum    = $this->getContainer()->get('madalynn.plum');
        $options = $plum->getOptions($server);

        $dryrun = '';
        if (isset($options['dry_run']) && $options['dry_run']) {
            $dryrun = '<comment>(dry run mode)</comment>';
        }

        $output->writeln(sprintf('Starting %s to <info>%s</info> %s', $deployer, $server, $dryrun));

        // Let's go!
        $plum->deploy($server, $deployer, $options);

        $output->writeln(sprintf('Successfully %s to <info>%s</info>', $deployer, $server));
    }
411320
protected function execute(InputInterface $input, OutputInterface $output)
    {

        $serverHelper = new DetermineServer();

        $from = $input->getArgument('from');

        $fromServer = $serverHelper->getServerForCommand($from);
        $fromPath = $serverHelper->getPathForCommand($from);


        if(strpos($from, '@') === 0 ){
            exec('ssh '.$fromServer.' "cd '.$fromPath.' ; du -hs fileadmin"', $result);
            $output->writeln($result);
        }else {
            exec('du -sh '.$fromServer.'fileadmin', $result);
            $output->writeln($result);
        }


        return 0;
    }
464270
public function execute(InputInterface $input, OutputInterface $output)
    {
        $outputPath = DATADIR;

        $output->write(['', '  Generating install files...', ''], true);

        $this->dumpStructure($outputPath);
        $output->writeln('  Exported DB structure');

        $this->dumpData($outputPath);
        $output->write(['  Exported DB data', ''], true);
    }
626709
protected function execute(InputInterface $input, OutputInterface $output) : void
    {

        $io     = $this->getIO($input, $output);
        $config = $this->getConfig($input->getOption('configuration'), true);
        $repo   = new Repository(dirname($input->getOption('git-directory')));

        $installer = new Installer($io, $config, $repo);
        $installer->setForce($input->getOption('force'))
                  ->setHook((string) $input->getArgument('hook'));

        $installer->run();
    }
158725
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->startCommand($output, true);
        $countries = $this->getCountriesFromInput($input);

        foreach ($countries as $countryCode) {
            $countryCode = strtoupper($countryCode);
            if ($input->getOption('drop-if-exists')) {
                $this
                    ->deleteCountry(
                        $input,
                        $output,
                        $countryCode
                    );
            }

            try {
                $this
                    ->locationPopulator
                    ->populateCountry($countryCode);

                $this
                    ->printMessage(
                        $output,
                        'Geo',
                        'Country ' . $countryCode . ' populated from source'
                    );
            } catch (Exception $exception) {
                $this
                    ->printMessageFail(
                        $output,
                        'Geo',
                        'Country ' . $countryCode . ' cannot be populated from source'
                    );
            }
        }

        $this->finishCommand($output);
    }
1104218
protected function execute(InputInterface $input, OutputInterface $output)
    {
        /** @var ConfigurationHelper $configurationHelper */
        $configurationHelper = $this->getHelper('phpdocumentor_configuration');
        $target = $configurationHelper->getOption($input, 'target', 'parser/target');
        if (strpos($target, '/tmp/') === 0) {
            $target = str_replace('/tmp/', sys_get_temp_dir() . DIRECTORY_SEPARATOR, $target);
        }
        
        $fileSystem = new Filesystem();
        if (! $fileSystem->isAbsolutePath($target)) {
            $target = getcwd().DIRECTORY_SEPARATOR.$target;
        }
        if (!file_exists($target)) {
            mkdir($target, 0777, true);
        }
        if (!is_dir($target)) {
            throw new \Exception($this->__('PPCPP:EXC-BADTARGET'));
        }
        $this->getCache()->getOptions()->setCacheDir($target);

        $builder = $this->getBuilder();
        $builder->createProjectDescriptor();
        $projectDescriptor = $builder->getProjectDescriptor();

        $output->write($this->__('PPCPP:LOG-COLLECTING'));
        $files = $this->getFileCollection($input);

        /** @var Finder $exampleFinder */
        $exampleFinder = $this->getContainer()->offsetGet('parser.example.finder');
        $exampleFinder->setSourceDirectory($files->getProjectRoot());
        $exampleFinder->setExampleDirectories($configurationHelper->getConfigValueFromPath('files/examples'));
        $output->writeln($this->__('PPCPP:LOG-OK'));

        /** @var ProgressHelper $progress  */
        $progress = $this->getProgressBar($input);
        if (!$progress) {
            $this->getHelper('phpdocumentor_logger')->connectOutputToLogging($output, $this);
        }

        $output->write($this->__('PPCPP:LOG-INITIALIZING'));
        $this->populateParser($input, $files);

        if ($progress) {
            $progress->start($output, $files->count());
        }

        try {
            $output->writeln($this->__('PPCPP:LOG-OK'));
            $output->writeln($this->__('PPCPP:LOG-PARSING'));

            $mapper = new ProjectDescriptorMapper($this->getCache());
            $mapper->garbageCollect($files);
            $mapper->populate($projectDescriptor);

            $visibility = (array) $configurationHelper->getOption($input, 'visibility', 'parser/visibility');
            $visibilities = array();
            foreach ($visibility as $item) {
                $visibilities = $visibilities + explode(',', $item);
            }
            $visibility = null;
            foreach ($visibilities as $item) {
                switch ($item) {
                    case 'public':
                        $visibility |= ProjectDescriptor\Settings::VISIBILITY_PUBLIC;
                        break;
                    case 'protected':
                        $visibility |= ProjectDescriptor\Settings::VISIBILITY_PROTECTED;
                        break;
                    case 'private':
                        $visibility |= ProjectDescriptor\Settings::VISIBILITY_PRIVATE;
                        break;
                }
            }
            if ($visibility === null) {
                $visibility = ProjectDescriptor\Settings::VISIBILITY_DEFAULT;
            }
            if ($input->getOption('parseprivate')) {
                $visibility = $visibility | ProjectDescriptor\Settings::VISIBILITY_INTERNAL;
            }
            $projectDescriptor->getSettings()->setVisibility($visibility);

            $this->getParser()->parse($builder, $files);
        } catch (FilesNotFoundException $e) {
            throw new \Exception($this->__('PPCPP:EXC-NOFILES'));
        } catch (\Exception $e) {
            throw new \Exception($e->getMessage(), 0, $e);
        }

        if ($progress) {
            $progress->finish();
        }

        $projectDescriptor->setPartials($this->getService('partials'));

        $output->write($this->__('PPCPP:LOG-STORECACHE', (array) $this->getCache()->getOptions()->getCacheDir()));
        $projectDescriptor->getSettings()->clearModifiedFlag();
        $mapper->save($projectDescriptor);

        $output->writeln($this->__('PPCPP:LOG-OK'));

        return 0;
    }
521780
protected function execute(InputInterface $input, OutputInterface $output): void
    {
        $configFilesOption = $input->getOption('config');
        $outputOption = $input->getOption('output');
        $formatOption = $input->getOption('format');

        '@phan-var string $configFilesOption';
        '@phan-var string $outputOption';
        '@phan-var string $formatOption';

        $configFiles       = $this->getPossibleConfigFiles($configFilesOption);
        $configuration     = $this->linterConfigurationLocator->loadConfiguration($configFiles);
        $paths             = $input->getArgument('paths') ?: $configuration->getPaths();
        $outputTarget      = $input->getOption('output');
        $exitWithExitCode  = $input->getOption('exit-code') || $input->getOption('fail-on-warnings');

        '@phan-var string[] $paths';

        if (false == $outputTarget) {
            throw new BadOutputFileException('Bad output file.');
        }

        if ($outputOption === '-') {
            $reportOutput = $output;
        } else {
            $fileHandle = fopen($outputOption, 'w');
            if ($fileHandle === false) {
                throw new \Exception("could not open file '${outputOption}' for writing");
            }

            $reportOutput = new StreamOutput($fileHandle);
        }

        $logger = $this->loggerBuilder->createLogger($formatOption, $reportOutput, $output);

        $report   = new Report();
        $patterns = $configuration->getFilePatterns();

        $files = $this->finder->getFilenames($paths, $patterns, new CallbackFinderObserver(function ($name) use ($logger) {
            $logger->notifyFileNotFound($name);
        }));
        $logger->notifyFiles($files);

        foreach ($files as $filename) {
            $logger->notifyFileStart($filename);
            $fileReport = $this->linter->lintFile($filename, $report, $configuration, $logger);
            $logger->notifyFileComplete($filename, $fileReport);
        }

        $logger->notifyRunComplete($report);

        $exitCode = 0;
        if ($report->countIssuesBySeverity(Issue::SEVERITY_ERROR) > 0) {
            $exitCode = 2;
        } else if ($exitWithExitCode && $report->countIssues() > 0) {
            $exitCode = 2;
        }

        $this->eventDispatcher->addListener(
            ConsoleEvents::TERMINATE,
            function (ConsoleTerminateEvent $event) use ($exitCode) {
                $event->setExitCode($exitCode);
            }
        );
    }
393123
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->checkEnvironment($output);

        if (!$this->getContainer()->get('dizda.cloudbackup.manager.backup')->execute()) {
            $output->writeln('<error>Something went terribly wrong. We could not create a backup. Read your log files to see what caused this error.</error>');

            return 1; //error
        }

        $output->writeln('<info>Backup complete.</info>');
    }
942254
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->startCommand($output, false);
        $domains = $input->getOption('domain');
        $languages = $input->getOption('language');
        $project = $this->createProjectByInput($input);

        while (true) {
            $randomTranslation = $project->getRandomMissingTranslation(
                $domains,
                $languages
            );

            if (!($randomTranslation instanceof Translation)) {
                $this
                    ->printMessage(
                        $output,
                        'Trans Server',
                        'No more translations for you!'
                    );

                break;
            }

            $masterTranslation = $randomTranslation->getMasterTranslation();
            $translator = new TranslateClient(
                $masterTranslation->getLanguage(),
                $randomTranslation->getLanguage()
            );
            $translation = $translator->translate(
                $masterTranslation->getValue()
            );

            $this
                ->printMessage(
                    $output,
                    'Trans Server',
                    'Language : ' . $randomTranslation->getLanguage()
                );
            $this->printMessage(
                    $output,
                    'Trans Server',
                    'Key : ' . $randomTranslation->getKey()
                );
            $this->printMessage(
                    $output,
                    'Trans Server',
                    'Original : ' . $randomTranslation
                        ->getMasterTranslation()
                        ->getValue()
                );
            $this->printMessage(
                    $output,
                    'Trans Server',
                    'Translation : ' . $translation
                );

            $randomTranslation->setValue($translation);
            $masterStructure = $randomTranslation->getStructure();
            $this->overwriteLastValueFromStructure(
                $masterStructure,
                $translation
            );
            $randomTranslation->setStructure($masterStructure);

            $project
                ->addTranslation($randomTranslation)
                ->save();
            $output->writeln('');
        }

        $this->finishCommand($output);
    }
243611
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->input = $input;
        $this->output = $output;
        $configurationPath = $input->getOption('configurationPath');
        $deploymentName = $input->getArgument('deploymentName');
        $deployment = $this->factory->getDeployment($deploymentName, $configurationPath);
        $workflow = $deployment->getWorkflow();

        if (! $deployment instanceof FailedDeployment) {
            $output->writeln('<success>Deployment ' . $deployment->getName() . '</success>');
            $output->writeln('');
            $output->writeln('Workflow: <success>' . $workflow->getName() . '</success>');

            if ($workflow instanceof SimpleWorkflow) {
                $value = $workflow->isEnableRollback() ? 'true' : 'false';
                $output->writeln('    <comment>Rollback enabled:</comment> <info>' . $value . '</info>');
            }

            $output->writeln('');

            $this->printNodes($deployment->getNodes());

            $this->printApplications($deployment->getApplications(), $deployment->getWorkflow());
        }
    }
629749
public function sayWelcome(OutputInterface $output)
    {
        $breakline = '';
        $output = $this->createBlockTitle($output);
        $title = $this->formatAsTitle('RCHCapistranoBundle - Continuous Deployment');

        $welcome = array(
            $breakline,
            $title,
            $breakline,
            'This bundle provides continuous deployment for Symfony2+ using <comment>Capistrano</comment>',
            'Created by Robin Chalas - github.com/chalasr',
            $breakline,
        );

        $output->writeln($welcome);
    }
590370
function deploy($output = null) {
        if(is_null($this->source_dir)) {
            return false;
        }
        if($output) {
            $styled = '<comment>Package "' . $this->package . '"</comment> deployed in <error>"/packages/' . $this->package . '"</error>';
            $output->writeln($styled);
        }
        \File::copyDirectory(base_path('vendor/' . $this->package . '/' . $this->source_dir), public_path('packages/' . $this->package));
        
        return true;
    }
1365780
public void deploy(RemoteRepository target, String pluginName, Artifact ... artifacts) throws DeploymentException {
        deploy(target, pluginName, Arrays.asList(artifacts));
    }
896252
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->configFilePath = $input->getOption('config-path');

        if (!$this->verifyNotInstalled($output)) {
            return;
        }

        $output->writeln('');
        $output->writeln('<info>******************</info>');
        $output->writeln('<info> '.Lang::get('welcome_to_phpci').'</info>');
        $output->writeln('<info>******************</info>');
        $output->writeln('');

        $this->checkRequirements($output);

        $output->writeln(Lang::get('please_answer'));
        $output->writeln('-------------------------------------');
        $output->writeln('');

        // ----
        // Get MySQL connection information and verify that it works:
        // ----
        $connectionVerified = false;

        while (!$connectionVerified) {
            $db = $this->getDatabaseInformation($input, $output);

            $connectionVerified = $this->verifyDatabaseDetails($db, $output);
        }

        $output->writeln('');

        $conf = array();
        $conf['b8']['database'] = $db;

        // ----
        // Get basic installation details (URL, etc)
        // ----
        $conf['phpci'] = $this->getPhpciConfigInformation($input, $output);

        $this->writeConfigFile($conf);
        $this->setupDatabase($output);
        $admin = $this->getAdminInformation($input, $output);
        $this->createAdminUser($admin, $output);
    }
718541
public function writeOut(OutputInterface $output = null, $force = false)
    {
        $class = str_singular($this->getClass());

        $this->writeToFileFromTemplate($this->path . '/' . $class . '.php', 'model', $output, [
            'namespace'       => $this->namespace,
            'className'       => $class,
            'tableName'       => snake_case($this->table->getTableName()),
            'relationMethods' => $this->table->renderRelationMethods(),
        ], $force);
    }
1224456
protected function interact(InputInterface $input, OutputInterface $output)
    {
        $questionHelper = $this->getHelper('question');
        $formatter = $this->getHelper('formatter');
        $rootDir = $this->getRootDir();
        $fs = new Filesystem();
        $appPath = explode('/', $rootDir);
        $appName = $appPath[count($appPath) - 2];

        $this->initConfig($fs, $rootDir);
        $output->writeln([$formatter->formatSection('SETUP', 'Project settings'), '']);

        $deployData = $this->configureDeploy($input, $output, $questionHelper, $appName);
        $deploy = new DeployGenerator($deployData, $rootDir);
        $this->generate($deploy);

        $output->writeln(['', " > generating <comment>{$appName}/config/deploy.rb</comment>"]);
        $output->writeln(['<info>Successfully created.</info>', '']);
        $output->writeln([$formatter->formatSection('PRODUCTION', 'Remote server / SSH settings'), '']);

        $sshProps = $this->configureSSH($input, $output, $questionHelper, $deployData);
        $staging = new StagingGenerator($sshProps, $this->getCapistranoDeployDir());
        $yamlStaging = new YamlStagingGenerator($sshProps, $this->getStagingsConfigDir());

        $this->generateMany([$staging, $yamlStaging]);

        return $output->writeln('<comment>Remote server successfully configured</comment>');
    }
496387
protected function execute(InputInterface $input, OutputInterface $output)
    {


        $serverHelper = new DetermineServer();

        $from = $input->getArgument('from');
        $to = $input->getArgument('to');
        $options = $input->getArgument('options');

        $credentials = $GLOBALS['TYPO3_CONF_VARS']['DB']["Connections"]["Default"];

        $fromServer = $serverHelper->getServerForCommand($from);
        $fromPath = $serverHelper->getPathForCommand($from);
        $toServer = $serverHelper->getServerForCommand($to);
        $toPath = $serverHelper->getPathForCommand($to);
        $filename = "database";
        $output->writeln('<comment>Sync database from ' . $from . ' to ' . $to . '.</comment>');
        $output->writeln('<comment>Start to dump database.</comment>');


        if(!empty($options)) {
            if($options === "noCache"){
                $excludeService = new DatabaseExcludes();
                $excludes = $excludeService->createExcludes($options,$credentials['dbname']);

            }elseif($options === "minimal"){
                $includeService = new DatabaseExcludes();
                $includes = $includeService->createincludes($options,$credentials['dbname']);

            }else {
                $output->writeln('<error>Option not found...Exit!</error>');

            }
        }

        if (strpos($from, '@') === 0) {
            exec('ssh ' . $fromServer . ' "cd ' . $fromPath . ' ; ../vendor/bin/typo3 database:dumpthis"');
        } else {
            exec('cd ' . PATH_site . '; mysqldump  --verbose -u' . $credentials['user'] . ' -h' . $credentials['host'] . ' -p' . $credentials['password'] . ' ' . $credentials['dbname'] . ' '.$excludes.$includes.' -r ' . $filename . '.dump');
        }

        $output->writeln('<comment>Copy database from ' . $from . ' to ' . $to . '.</comment>');
        if (strpos($from, '@') === 0) {
            exec('ssh -A ' . $fromServer . ' rsync -chavzP --progress --stats --exclude=_processed_ --exclude=_temp_ --exclude=log --exclude=sys ' . $fromPath . 'database.dump ' . $toServer . ':' . $toPath . 'database.dump');
        }else {
            exec('rsync -chavzP --progress --stats --exclude=_processed_ --exclude=_temp_ --exclude=log --exclude=sys ' .$fromPath . 'database.dump ' . $toServer . ':' . $toPath . 'database.dump');
        }
        // if foreign, clean up!
        if (strpos($to, '@') === 0) {
            $output->writeln('<comment>Clean up on Server.</comment>');
            exec('ssh ' . $fromServer . ' "cd ' . $fromPath . ' ; rm database.dump"');
        }


        $output->writeln('<comment>Import database to ' . $to . '.</comment>');
        if (strpos($to, '@') === 0) {
            exec('ssh ' . $toServer . ' "cd ' . $toPath . ' ; ../vendor/bin/typo3 database:importthis"');
        } else {
            exec('mysql --verbose -u' . $credentials['user'] . ' -h' . $credentials['host'] . ' -p' . $credentials['password'] . ' ' . $credentials['dbname'] . ' < ' . $filename . '.dump');
        }

        return 0;

    }