[执行命令]
@DateTime 2018-12-13
@param    InputInterface  $input  输入对象
@param    OutputInterface $output 输出对象
339055
protected function execute(InputInterface $input, OutputInterface $output)
    {
        try {
            $output->writeln([
                '<bg=yellow;>Push Script Starting...</>',
                '=====================',
            ]);
            $push = new PushService($this->config);
            $type = $input->getArgument('type');
            $push->run($type);
            $output->writeln([
                '=====================',
                '<bg=yellow;>Push Script End!</>'
            ]);
        } catch (Exception $e) {
            $output->writeln('<bg=red;>'.$e->getMessage().'</> <options=bold></>');
            $output->writeln('');
        }
    }
391571
protected function execute(InputInterface $input, OutputInterface $output)
    {
        parent::execute($input, $output);

        $info = $this
            ->getSession()
            ->getInspector()
            ->getSchemaRelations($this->fetchSchemaOid()
        );
        $this->formatOutput($output, $info);
    }
863939
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $persistence = $this->getPersistence();
        $output->writeln(sprintf(
            'Pulling translations in %s',
            $persistence->getDirectoryName()
        ));

        $gitOutput = $persistence->pullTranslations();
        $output->writeln($gitOutput);

        $output->writeln('Done.');
    }
1133146
public function run(InputInterface $input, OutputInterface $output)
    {
        return parent::run(
            $this->input = $input, $this->output = new OutputStyle($input, $output)
        );
    }
1301422
protected function execute(InputInterface $input, OutputInterface $output)
    {
        /** @var CronService $cronService */
        $cronService = $this->getContainer()->get(CronService::class);
        $crons = $cronService->listCronsStatus();
        $cronRows = [];

        foreach ($crons as $cron) {
            $cronStatus = '';
            if ($cron instanceof EdgarCron) {
                switch ($cron->getStatus()) {
                    case EdgarCronRepository::STATUS_INIT:
                        $cronStatus = $this->translator->trans('Init', [], 'edgarcron');
                        break;
                    case EdgarCronRepository::STATUS_OK:
                        $cronStatus = $this->translator->trans('OK', [], 'edgarcron');
                        break;
                    case EdgarCronRepository::STATUS_ERROR:
                        $cronStatus = $this->translator->trans('Error', [], 'edgarcron');
                        break;
                    default:
                        $cronStatus = '';
                        break;
                }
            }

            $cronRows[] = [
                $cron->getAlias(),
                $cron instanceof EdgarCron ? $cron->getQueued()->format('d-m-Y H:i') : false,
                $cron instanceof EdgarCron ? $cron->getStarted()->format('d-m-Y H:i') : false,
                $cron instanceof EdgarCron ? $cron->getEnded()->format('d-m-Y H:i') : false,
                $cronStatus,
            ];
        }

        $table = new Table($output);
        $table
            ->setHeaders(['Cron Alias', 'Queued', 'Started', 'Ended', 'Status'])
            ->setRows($cronRows);
        $table->render();
    }
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);
    }
1188387
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->input = $input;
        $this->output = $output;
        $io = new SymfonyStyle($input, $output);

        $config = $this->getConfigHelper()->load($input);
        $typeMap = TypeMap::fromMetadata(
            $config->getTypeNamespace(),
            $config->getEngine()->getMetadata()->getTypes()
        );

        $generator = new ClassMapGenerator(
            $config->getRuleSet(),
            $config->getClassMapName(),
            $config->getClassMapNamespace()
        );
        $path = $config->getClassMapDestination().DIRECTORY_SEPARATOR.$config->getClassMapName().'.php';
        $this->handleClassmap($generator, $typeMap, $path);

        $io->success('Generated classmap at ' . $path);
    }
1367468
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->output = $output;
        $aliasName = $input->getArgument('aliasName');
        $aliasClass = $input->getArgument('aliasClass');
        $this->alias($aliasName, $aliasClass);
    }
489985
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $finder     = new Finder();
        $filesystem = new Filesystem();
        $filesystem->remove($finder->directories()->in($this->getLanguageBasePath()));
    }
496129
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $created = $this->scaffold(
            'ajax',
            [
                'CLASSNAME' => $input->getArgument('name'),
            ],
            [
                'ACTION' => $input->getOption('action'),
            ]
        );

        if ($created === true) {
            $output->writeln("<info>{$input->getArgument('name')} was created successfully</info>");
        } else {
            $output->writeln("<error>{$input->getArgument('name')} could not be created</error>");
        }
    }
53704
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->before($input, $output);
        $this->runTransient($input, $output);
        $this->after($input, $output);
    }
343390
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $sitemaps = $this->builder->build();
        foreach ($sitemaps as $sitemap) {
            $output->writeln($sitemap);
        }
    }
323992
protected function execute(InputInterface $input, OutputInterface $output)
	{
		$this->setupEnvironment('site', $input, $output);

		$version = new \JVersion;

		if ($input->getOption('short'))
		{
			$result = $version->getShortVersion();
		}
		elseif ($input->getOption('release'))
		{
			$result = $version->RELEASE;
		}
		else
		{
			$result = $version->getLongVersion();
		}
		$output->writeln($result);
	}
925161
protected function execute(InputInterface $input, OutputInterface $output)
    {
        // 读取所有服务
        $servers = array_keys(Config::get('server', []));
        // 当前服务
        $server = $input->getArgument('server');

        if ($server !== null && ! isset($servers[$server])) {
            $this->error('启动失败, 未定义 [' . $server . '] 服务');
            return 0;
        } elseif ($server === null && $servers === []) {
            $this->error('启动失败, 未定义任何服务');
            return 0;
        }

        // {{
        $this->title('启动服务进程');
        // }}

        if ($server !== null) {
            $servers = (array) $server;
        }

        unset($server);

        $runner = new Runner($output);

        try {
            foreach ($servers as $server) {
                if ($runner->isRunning($server)) {
                    $this->fail('<label>' . $server . '</> 处于运行中');
                } else {
                    $ret = $runner->runCommand('start', $server);

                    $this->result(
                        '启动 <label>' . $server . '</> 服务进程',
                        $ret['code'] === 0
                    );
                }

                $this->wait();
            }
        } catch (\Exception $e) {
            $this->fail($e->getMessage());
        }

        $this->newLine();

        return 0;
    }
1365760
protected function execute(InputInterface $input, OutputInterface $output)
    {
        foreach ($this->getFacade()->migrate() as $line) {
            $output->write($line);
        }
    }
1225427
protected function execute(InputInterface $input, OutputInterface $output) : int
    {
        return !is_null($this->exitCode) ? $this->exitCode : 0;
    }
130126
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->startCommand($output);

        $days = $input->getArgument('days');
        $entries = $this
            ->metricLoader
            ->loadEntriesFromLastDays($days);

        $nbEntries = count($entries);
        $this->printMessage(
            $output,
            'Metric',
            'Added ' . $nbEntries . ' entries from last ' . $days . ' days'
        );

        $this->finishCommand($output);
    }