Set colors style definition for the formatter.

@param InputInterface  $input
@param OutputInterface $output
184221
public function setupConsole(InputInterface $input, OutputInterface $output)
    {
        // Initialize cache with CLI compatibility
        Grav::instance()['config']->set('system.cache.cli_compatibility', true);
        Grav::instance()['cache'];

        $this->argv = $_SERVER['argv'][0];
        $this->input  = $input;
        $this->output = $output;

        $this->output->getFormatter()->setStyle('normal', new OutputFormatterStyle('white'));
        $this->output->getFormatter()->setStyle('yellow', new OutputFormatterStyle('yellow', null, array('bold')));
        $this->output->getFormatter()->setStyle('red', new OutputFormatterStyle('red', null, array('bold')));
        $this->output->getFormatter()->setStyle('cyan', new OutputFormatterStyle('cyan', null, array('bold')));
        $this->output->getFormatter()->setStyle('green', new OutputFormatterStyle('green', null, array('bold')));
        $this->output->getFormatter()->setStyle('magenta', new OutputFormatterStyle('magenta', null, array('bold')));
        $this->output->getFormatter()->setStyle('white', new OutputFormatterStyle('white', null, array('bold')));
    }
930664
protected function execute(InputInterface $input, OutputInterface $output): void
    {
        $filename = $input->getArgument('filename');

        '@phan-var string $filename';

        $output->writeln("Parsing input file <comment>{$filename}</comment>.");

        $tokens = $this->tokenizer->tokenizeStream($filename);

        $output->write($this->tokenPrinter->printTokenStream($tokens));
    }
705578
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->startCommand($output);

        $configurationIdentifier = $input->getArgument('identifier');
        $this
            ->configurationManager
            ->delete(
                $configurationIdentifier
            );

        $this->printMessage(
            $output,
            'Configuration',
            'Deleted configuration "' . $configurationIdentifier . '"'
        );

        $this->finishCommand($output);
    }
1061360
protected function interact(InputInterface $input, OutputInterface $output)
    {
        $this->setInputAndOutput($input, $output);

        $welcomeText = $this->getWelcomeText();
        if (!empty($welcomeText)) {
            $this->assistant->writeSection($this->getWelcomeText());
        }

        $this->doInteract();
    }
677052
protected function setIO(InputInterface $input, OutputInterface $output)
    {
        $this->io = new ConsoleIO($input, $output, $this->getHelperSet());
    }
854520
public function setOutput(OutputInterface $output)
    {
        $this->output = $output;
        $this->stdErr = $output instanceof ConsoleOutputInterface
            ? $output->getErrorOutput()
            : $output;
    }
405874
protected function ping(InputInterface $input, OutputInterface $output)
    {
        $input;
        //====================================================================//
        // Perform Ping Test
        $result = Splash::Selftest();
        //====================================================================//
        // Output Result
        $output->writeln($result
                ? "<bg=green;fg=white;options=bold>=== SPLASH : PING TEST PASSED </>"
        : "<bg=green;fg=white;options=bold>=== SPLASH : PING TEST PASSED </>");
    }
493054
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $io = new SymfonyStyle($input, $output);

        $options = [];
        if ($event = $input->getArgument('event')) {
            if (!$this->dispatcher->hasListeners($event)) {
                $io->getErrorStyle()->warning(sprintf('The event "%s" does not have any registered listeners.', $event));

                return;
            }

            $options = ['event' => $event];
        }

        $helper = new DescriptorHelper();
        $options['format'] = $input->getOption('format');
        $options['raw_text'] = $input->getOption('raw');
        $options['output'] = $io;
        $helper->describe($io, $this->dispatcher, $options);
    }
1324908
protected static function configureFormatter(OutputInterface $output)
    {
        $formatter = $output->getFormatter();
        $formatter->setStyle('system', new OutputFormatterStyle('green'));
        $formatter->setStyle('line', new OutputFormatterStyle('yellow'));
        $formatter->setStyle('fail', new OutputFormatterStyle('red'));
        $formatter->setStyle('info', new OutputFormatterStyle('blue'));
        $formatter->setStyle('body', new OutputFormatterStyle('white'));
        $formatter->setStyle('strong', new OutputFormatterStyle(null, null, ['bold']));
    }
972897
protected function initialize(InputInterface $input, OutputInterface $output)
    {
        parent::initialize($input, $output);
        $this->permissionResolver->setCurrentUserReference(
            $this->userService->loadUserByLogin($input->getOption('user'))
        );
    }
1372950
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->configureOptions($input);

        $rows = $failed = array();
        foreach ($this->finder->findAll() as $release) {
            $this->locator->setParams(array('release' => $release));
            $scripts = $rollbacks = array();
            $status  = '<fg=green>OK</fg=green>';

            try {
                $scripts   = $this->locator->findScripts();
                $rollbacks = $this->locator->findRollbackScripts();
                $this->checker->check($scripts, $rollbacks);
            } catch (\Exception $e) {
                $status   = sprintf('<fg=red>%s</fg=red>', $e->getMessage());
                $failed[] = $release;
            }

            $rows[] = array($release, count($scripts), count($rollbacks), $status);
        }

        $this->display($output, $rows, $failed);
    }
131640
public function setOutput( OutputInterface $output ) {
		$this->output = $output;

		if ( $output->isDebug() ) {
			$this->verbosity = 3;
		} elseif ( $output->isVeryVerbose() ) {
			$this->verbosity = 2;
		} elseif ( $output->isVerbose() ) {
			$this->verbosity = 1;
		}
	}
292701
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $dic = $this->getContainer();
        $fs = $dic->get('filesystem');
        $folders = $this->getDirectorySetup($dic, $input);
        $io = new SymfonyStyle($input, $output);
        $this->filesystem = $fs;

        if ($input->getOption('relative')) {
            $expectedMethod = self::METHOD_RELATIVE_SYMLINK;
            $io->text('Trying to install theme assets as <info>relative symbolic links</info>.');
        } elseif ($input->getOption('symlink')) {
            $expectedMethod = self::METHOD_ABSOLUTE_SYMLINK;
            $io->text('Trying to install theme assets as <info>absolute symbolic links</info>.');
        } else {
            $expectedMethod = self::METHOD_COPY;
            $io->text('Installing theme assets as <info>hard copies</info>.');
        }

        $fs->mkdir($folders->public . '/theme');

        foreach (['bootstrap', 'dist', 'plugins', 'documentation', 'starter.html'] as $directory) {
            $io->text("installing <info>$directory</info>");

            $lnFrom = sprintf('%s/%s', $folders->theme, $directory);
            $lnTo = sprintf('%s/theme/%s', $folders->public, $directory);

            $this->establishLink($lnFrom, $lnTo, $expectedMethod);
        }
    }
922936
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $inputFile = $input->getArgument('input-file');
        $outputFile = $input->getArgument('output-file');

        if ($outputFile === null) {
            $outputFile = preg_replace('/\\.[^.]*$/', '.php', $inputFile);
        }

        $parserGenerator = new ParserGenerator(new PegFile());

        $output = "<?php\n\n" . $parserGenerator->createClass($inputFile);

        file_put_contents($outputFile, $output);
    }
1195764
protected function initialize(InputInterface $input, OutputInterface $output)
    {
        try
        {
            $this->input  = $input;
            $this->output = $output;
            $this->style  = new SymfonyStyle($input, $output);

            $file = new \SplFileInfo($this->getOption('env'));
            // Create an environment instance
            $this->env = new Dotenv(
                $file->getPathInfo()->getRealPath(),
                $file->getFilename()
            );

            $this->env->load();
            $this->env->required(['BASEPATH','APPPATH'])->notEmpty();
        }
        catch (Exception $e)
        {
            throw new \RuntimeException($e->getMessage());
        }

    }
120168
protected function initialize(InputInterface $input, OutputInterface $output)
    {
        $this->transifexconfig = $input->getOption('transifex-config');
        $this->setProject($input, $output);
        $this->setPrefix($input, $output);
        $this->setXliffDirectory($input, $output);
        $this->setContaoLanguageDirectory($input, $output);
        $this->baselanguage = $input->getOption('base-language');
        $this->skipFiles    = $input->getOption('skip-files') ? explode(',', $input->getOption('skip-files')) : null;

        if (!$this->skipFiles) {
            $this->skipFiles = $this->getTransifexConfigValue('/skip_files') ?: array();
        } else {
            // Make sure it is an array.
            $this->skipFiles = array();
        }

        $activeLanguages = array();
        if (($langs = $input->getArgument('languages')) != 'all') {
            $activeLanguages = explode(',', $langs);
        }

        $this->determineLanguages($output, $this->getLanguageBasePath(), $activeLanguages);
    }
1133146
public function run(InputInterface $input, OutputInterface $output)
    {
        return parent::run(
            $this->input = $input, $this->output = new OutputStyle($input, $output)
        );
    }