Execute the "show" command

@param  InputInterface $input Input object
@param  OutputInterface $output Output object
@throws \Exception
@return null
767927
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $path = $input->getOption('path');

        // if we're not given a path at all, try to figure it out
        if ($path === null) {
            $path = php_ini_loaded_file();
        }

        if (!is_file($path)) {
            throw new \Exception('Path is null or not accessible: "'.$path.'"');
        }
        $ini = parse_ini_file($path, true);

        $output->writeLn('Current PHP.ini settings from '.$path);
        $output->writeLn('##########');

        foreach ($ini as $section => $data) {
            $output->writeLn('<info>:: '.$section.'</info>');
            if (empty($data)) {
                $output->writeLn("\t<fg=yellow>No settings</fg=yellow>");
            } else {
                foreach ($data as $path => $value) {
                    $output->writeLn("\t".$path.' => '.var_export($value, true));
                }
            }
            $output->writeLn("-----------------\n");
        }

    }
370565
public function run(InputInterface $input = null, OutputInterface $output = null)
    {
        $input  = $input ?: new ArgvInput();
        $output = $output ?: new ConsoleOutput(OutputInterface::VERBOSITY_NORMAL, null, $this->formatter());

        return parent::run($input, $output);
    }
1264419
public function execute(InputInterface $input, OutputInterface $output)
    {
        $filesystem = new Filesystem();
        $discouraged = RootDirectories::getDiscouraged();
        $found = [];

        foreach ($discouraged as $directory => $comment) {
            if ($filesystem->exists($directory) && is_dir($directory)) {
                $found[] = [$directory, $comment];
            }
        }

        if (count($found) == 0) {
            $output->writeln('<fg=green>No issues found.</fg=green>');

            return 0;
        }

        $output->writeln('The following issues where found:');

        $table = new Table($output);

        $table->setHeaders(['Directory', 'Comment']);
        $table->setRows($found);
        $table->render();

        return 1;
    }
869287
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->startCommand($output);
        $plugins = $this
            ->pluginRepository
            ->findAll();

        /**
         * @var Plugin $plugin
         */
        foreach ($plugins as $plugin) {
            $this->printMessage(
                $output,
                'Plugin',
                $plugin->getNamespace() . ' - [Hash : ' . $plugin->getHash() . ']'
            );
        }

        $this->finishCommand($output);
    }
346671
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $path       = $input->getArgument(self::COMMAND_NAME);
        $realPath   = realpath($path);
        $configFile = $input->getOption('config');

        $finder = new FileParser($configFile);

        if (file_exists($configFile)) {
            $this->scanFiles($path, $finder);

            if (!empty($this->errors)) {
                $output->writeln("<info>To-do expressions were found:</info>\n");
                foreach ($this->errors as $file => $lines) {
                    foreach ($lines as $line) {
                        $output->writeln(
                            sprintf(
                                "<comment> - .%s:</comment> %s",
                                str_replace($realPath, '', $file),
                                $line
                            )
                        );
                    }
                }

                if (count($this->flatten($this->errors)) > $finder->getTotalAllowed()) {
                    throw new \Exception('To-do statements are piling up! Isn\'t it time to address this issue?');
                }
            }

            return $output->writeln("<info>\nCongratulations! To-do statements are under control.\n</info>");
        }

        throw new ConfigFileException($configFile);
    }
1305824
public function execute(InputInterface $input, OutputInterface $output)
    {
        chdir('public');

        /*
         * check for user supplied hostname option
         */
        if ($input->hasOption('hostname') && $input->getOption('hostname') != null) {
            $this->hostname = $input->getOption('hostname');
        }

        /*
         * check for user supplied port option
         */
        if ($input->hasOption('port') && $input->getOption('port') != null) {
            $this->port = $input->getOption('port');
        }

        /*
         * check for user supplied a path option
         */
        if ($input->hasOption('path') && $input->getOption('path') != null) {
            $this->phpexec = $input->getOption('path');
        }

        $output->writeln('<info>Legato development server started</info>');
        $output->writeln("<info>Open your browser and navigate to: </info> <http://{$this->hostname}:{$this->port}>");
        $output->writeln('<info>CTRL C to quit </info>');
        passthru($this->startPHP());
    }
1025320
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->startCommand($output);
        $plugins = $this
            ->pluginManager
            ->loadPlugins();

        foreach ($plugins as $plugin) {
            $this->printMessage(
                $output,
                'Plugin',
                'Plugin "' . $plugin->getNamespace() . '" installed'
            );
        }

        $this->finishCommand($output);
    }
462491
public function execute(InputInterface $input, OutputInterface $output)
    {
        $inOut     = $this->wrapIo($input, $output);
        $container = $this->createContainer($this->getComposer(), static::NAME);

        $argAction = static::ARG_ACTION;
        $action    = $inOut->getArgument($argAction);
        switch ($action) {
            case static::ACTION_CONNECT:
                $this->executeConnect($container, $inOut);
                break;
            case static::ACTION_CREATE:
                $this->executeCreate($container, $inOut);
                break;
            default:
                $inOut->writeError("Unknown value `$action` for argument `$argAction`." . PHP_EOL);
                break;
        }
    }
983759
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->setIo($input, $output);

        $repo = $this->prepareRepository();

        $this->rebuild();

        $this->deployWithGit($repo);
    }
1313109
protected function showProcesses(InputInterface $input, OutputInterface $output)
    {
        $table = new Table($output);
        $table->setHeaders(['Process', 'Pid', 'Status', 'Start At', 'Runtime']);
        $rows = [];
        foreach (config()->get('processes', []) as $name => $processor) {
            $rows[] = $this->getProcessInfo($name);
        }
        $table->setRows($rows);
        $table->render();

        return 0;
    }
434638
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $content = (string) @file_get_contents($input->getOption('configuration'));
        $config = Config::create(Yaml::parse($content) ?? []);

        $filesCollection = (new FileManager($config->getFileExtensions(), $config->getFilesToIgnore()))
            ->getPhpFiles($this->getDirectoriesToScan($input, $config->getDirectoriesToScan()));

        $completedProcesses = $this->processManager->process(
            $filesCollection,
            new ProcessFactory($config->getCommitsSince()),
            $config->getParallelJobs()
        );

        $resultCollection = $this->resultsLogic->process(
            $completedProcesses,
            $config->getMinScoreToShow(),
            $config->getFilesToShow()
        );

        $renderer = $this->renderFactory->getRenderer($input->getOption('format'));
        $renderer->render($output, $resultCollection);
    }
50998
public function run(InputInterface $input, OutputInterface $output)
    {
        Template::addPath(dirname(dirname(__DIR__)) .'/Views');
        $data = [
            'command' => $this->_command,
            'controllerData' => $this->_controllerData,
            'path' => $this->_path
        ];
        $links = new GenerateQuickLinks($data);
        $links->run($input, $output);
        $panel = new GenerateHeaderPanel($data);
        $panel->run($input, $output);
        $this->generateAll($input, $output);
    }
330292
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $setting = $input->getOption('setting');
        $options = array();

        if ($setting === null) {
            throw new \Exception('No setting provided!');
        }

        $scan = new \Psecio\Iniscan\Scan();
        $ruleSet = $scan->getRules();

        // see if we can find info about the setting
        $found = array();
        foreach ($ruleSet as $section => $rules) {
            foreach ($rules as $rule) {
                if (isset($rule->test->key) && $rule->test->key === $setting) {
                    if (isset($rule->info)) {
                        $found[] = $rule;
                    }
                }
            }
        }

        if (!empty($found)) {
            $outputHandler = new \Psecio\Iniscan\Command\InfoCommand\Output\Console($output, $options);
            return $outputHandler->render($found);
        } else {
            $output->writeLn('No information found for setting '.$setting);
        }
    }
260941
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $errOutput = $output instanceof ConsoleOutputInterface ? $output->getErrorOutput() : $output;
        $output->setVerbosity(OutputInterface::VERBOSITY_QUIET);
        $errOutput->setVerbosity(OutputInterface::VERBOSITY_NORMAL);

        $batchSize = NumberUtils::bound($input->getOption('batch-size'), 1, 1000);
        $batchDelay = NumberUtils::bound($input->getOption('batch-delay'), 100, 600000);
        $since = $input->getOption('since');
        $until = $input->getOption('until');
        $context = json_decode($input->getOption('context') ?: '{}', true);
        $context['tenant_id'] = (string)$input->getOption('tenant-id');
        $streamId = $input->getArgument('stream-id') ? StreamId::fromString($input->getArgument('stream-id')) : null;

        if (!empty($since)) {
            $since = Microtime::fromString(str_pad($since, 16, '0'));
        }

        if (!empty($until)) {
            $until = Microtime::fromString(str_pad($until, 16, '0'));
        }

        $i = 0;
        $receiver = function (Event $event, StreamId $streamId) use ($errOutput, $batchSize, $batchDelay, &$i) {
            ++$i;

            try {
                echo json_encode($event) . PHP_EOL;
            } catch (\Throwable $e) {
                $errOutput->writeln($e->getMessage());
            }

            if (0 === $i % $batchSize) {
                if ($batchDelay > 0) {
                    usleep($batchDelay * 1000);
                }
            }
        };

        if ($streamId) {
            $this->getPbjx()->getEventStore()->pipeEvents($streamId, $receiver, $since, $until, $context);
        } else {
            $this->getPbjx()->getEventStore()->pipeAllEvents($receiver, $since, $until, $context);
        }
    }
347975
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->setInputAndOutput($input, $output);

        return $this->doExecute();
    }
49316
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $path = $input->getOption('path');
        $failOnly = $input->getOption('fail-only');
        $format = $input->getOption('format');
        $context = $input->getOption('context');
        $threshold = $input->getOption('threshold');
        $version = $input->getOption('php');
        $outputPath = $input->getOption('output');

        if ($format === 'html' && $outputPath === null) {
            throw new \InvalidArgumentException('Output path must be set for format "HTML"');
        }

        $context = ($context !== null)
            ? explode(', ', $context) : array();

        // If we're not given a version, assume the current version
        if ($version === null) {
            $version = PHP_VERSION;
        }

        // if we're not given a path at all, try to figure it out
        if ($path === null) {
            $path = php_ini_loaded_file();
        }

        if (!is_file($path)) {
            throw new \Exception('Path is null or not accessible: "'.$path.'"');
        }

        $scan = new \Psecio\Iniscan\Scan($path, $context, $threshold, $version);
        $results = $scan->execute();
        $deprecated = $scan->getMarked();

        $options = array(
            'path' => $path,
            'failOnly' => $failOnly,
            'deprecated' => $deprecated,
            'verbose' => $input->getOption('verbose'),
            'output' => $outputPath
        );

        $format = ($format === null) ? 'console' : $format;
        $formatClass = "\\Psecio\\Iniscan\\Command\\ScanCommand\\Output\\".ucwords(strtolower($format));
        if (!class_exists($formatClass)) {
            throw new \Psecio\Iniscan\Exceptions\FormatNotFoundException('Output format "'.$format.'" not found');
        }
        $outputHandler = new $formatClass($output, $options);
        return $outputHandler->render($results);
    }
53704
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->before($input, $output);
        $this->runTransient($input, $output);
        $this->after($input, $output);
    }