@param InputInterface  $input
@param OutputInterface $output
@param string          $content

@return $this
505569
protected function write(InputInterface $input, OutputInterface $output, $content)
    {
        foreach ($this->getPrinters() as $printer) {
            $printer->write($content);
        }

        return $this;
    }
1128702
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $plugin = $input->getArgument('plugin');

        $pluginExp = explode('/', $plugin);

        $packageDir = config_path().'/'.$pluginExp[0];
        $configFile = $pluginExp[1].'.php';

        if (!file_exists($packageDir)) {
            $publish = true;
        } else {
            $helper = $this->getHelper('question');
            $question = new ConfirmationQuestion(
                "$plugin already has a config script in place, are you sure you want to overwrite it? ",
                false,
                '/^yes|y/i'
            );

            $publish = $helper->ask($input, $output, $question);
        }

        if ($publish) {
            mkdir($packageDir);
            $pluginConfig = app_path().'/../vendor/'.$plugin.'/config.php';
            $publishConfig = $packageDir.'/'.$configFile;

            $file = fopen($pluginConfig, 'r');
            $content = fread($file, filesize($pluginConfig));
            fclose($file);

            $file = fopen($publishConfig, 'w');
            fwrite($file, $content);
            fclose($file);

            $output->writeln("<info>Configuration for $plugin published</info>");
        }
    }
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);
    }
584800
protected function execute(InputInterface $input, OutputInterface $output)
  {
    $results = Cache::flush();

    if ($results) return $output->writeln('<info>Cleared cache!</info>');

    return $output->writeln('Nothing to clear');
  }
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);
    }
342961
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->cacheService->system()->clear();
        $this->cacheService->user()->clear();
        $output->writeln('Done!');
        return null;
    }
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);
    }
460715
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $inputFile = $input->getArgument('input-file');
        $exampleFile = $input->getArgument('example-file');
        $number = $input->getOption('number');

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

        $parser = $parserGenerator->createParser($inputFile);
        $contents = file_get_contents($exampleFile);
        $start = microtime(true);
        $memoryUsage = $memoryBase = memory_get_usage();

        for ($i = 0; $i < $number; $i++) {
            $parser->parse($contents);

            if ($i === 0) {
                $memoryUsage = memory_get_usage() - $memoryBase;
            }
        }

        $memory = $this->humanReadable($memoryUsage);
        $time = microtime(true) - $start;
        $ms = round($time * 1000);
        $avg = round($time * 1000 / $number);
        $rps = round($number / $time);

        $output->writeln("Memory usage: {$memory}");
        $output->writeln("Number of runs: {$number}");
        $output->writeln("Total time: {$ms}ms");
        $output->writeln("Average time: {$avg}ms");
        $output->writeln("Runs per second: {$rps}");
    }
249740
public function execute(InputInterface $input, OutputInterface $output)
    {
        $app = $this->getSilexApplication();
        $module = $input->getArgument('modulo');
        $author = $input->getOption('author');
        
        if (!$author) {
            if (isset($app['author.name'])) {
                $author = $app['author.name'];
            } else {
                $author = 'Author';
            }
        }

        $email = $input->getOption('email');

        if (!$email) {
            if (isset($app['author.email'])) {
                $email = $app['author.email'];
            } else {
                $email = 'author@email.com';
            }
        }

        $dir = $input->getOption('dir');

        if (!$dir) {
            $dir = '';
        }

        try {
            $moduleDir = $app['singular.service.module']->create($module, $dir, $author, $email);
//            $app['singular.service.module_service']->create($module, $moduleDir, $author, $email);
            $output->writeln(sprintf('<info>Módulo "%s" criado com sucesso!</info>',$module));
        } catch (\Exception $e) {
            $output->writeln(sprintf('<error>%s</error>', $e->getMessage()));
        }

    }
289977
protected function execute(InputInterface $input, OutputInterface $output)
    {
        if (null === $this->configurationChain) {
            $this->configurationChain = $this->getContainer()->get('kunstmaan_search.search_configuration_chain');
        }
        /**
         * @var string
         * @var SearchConfigurationInterface $searchConfiguration
         */
        foreach ($this->configurationChain->getConfigurations() as $alias => $searchConfiguration) {
            $searchConfiguration->deleteIndex();
            $output->writeln('Index deleted : ' . $alias);
        }
    }
306872
protected function execute(InputInterface $input, OutputInterface $output)
    {
        //  validate the content types unless validation is ignored

        if ($input->getArgument('id') && !$input->getOption('ignore')) {
            $code = $this->executeValidation($input, $output);

            if ($code) {
                return $code;
            }
        }

        if ($input->getOption('delete')) {
            return $this->executeDelete($input, $output);
        }

        if (!$input->getArgument('id') && !$input->getOption('full')) {
            throw new InvalidArgumentException(
                'You need to give one or more content types or choose the --full or --delete option'
            );
        }

        return $this->executeIndex($input, $output);
    }
1072702
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->modx->cacheManager->refresh();
        $output->writeln('### Cache has been refreshed(cleared) ###');
    }
952594
protected function initialize(InputInterface $input, OutputInterface $output)
  {
    foreach($input->getArguments() + $input->getOptions() as $arg => $value)
    {
      if(property_exists($this, $arg))
      {
        $this->$arg = $value;
      }
    }
  }
534714
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->getHelper('phpdocumentor_logger')->connectOutputToLogging($output, $this);

        $converter = $this->getConverter($input);
        $converter->setOption('title', $input->getOption('title'));

        $output->writeln('Collect all documents');
        $files = $this->buildCollection(
            $input->getArgument('source'),
            $converter->getDefinition()->getInputFormat()->getExtensions()
        );

        $output->writeln('Converting documents');
        $files = $converter->convert($files, $this->getTemplate($input));

        $output->writeln('Writing converted documents to disk');
        $this->writeToDisk($files, $input->getOption('target'));

        $output->writeln('Writing assets to disk');
        $converter->getAssets()->copyTo($input->getOption('target'));
    }
1216961
public function setConsole(SymfonyApplication $console, OutputInterface $output = null, InputInterface $input = null)
    {
        $this->traitConsole = $console;
        if ($output) {
            $this->setOutput($output);
        }
        if ($input) {
            $this->setInput($input);
        }

        return $this;
    }
391571
protected function execute(InputInterface $input, OutputInterface $output)
    {
        parent::execute($input, $output);

        $info = $this
            ->getSession()
            ->getInspector()
            ->getSchemaRelations($this->fetchSchemaOid()
        );
        $this->formatOutput($output, $info);
    }
254575
public function setContent($content)
    {
        if (is_null($this->mbRequest)) {
            return $this;
        }

        $this->prepare($this->mbRequest);

        if ($this->mbRequest->isMethod("GET") || $this->mbRequest->isMethod("DELETE")) {
            $this->statusCode = BaseResponse::HTTP_OK;
        } elseif ($this->mbRequest->isMethod("POST") || $this->mbRequest->isMethod("PUT")) {
            $this->statusCode = BaseResponse::HTTP_CREATED;
        } else {
            $this->statusCode = BaseResponse::HTTP_RESET_CONTENT;
        }

        if ($content instanceof \Exception) {
            $this->statusCode = $content->getCode();
            $this->statusCode = $this->isSuccessful() ? $this->statusCode : BaseResponse::HTTP_BAD_REQUEST;
        }

        if($this->isBuffer()){
            $this->original = $content;
        } elseif ($this->mbRequest->isAjax()) {
            $this->ajaxContent($content);
        } else {
            $this->htmlContent($content);
        }

        return $this;
    }