init without trunk
This commit is contained in:
parent
ed24ac4994
commit
bb809e7233
14652 changed files with 177862 additions and 94817 deletions
65
vendor/sensio/generator-bundle/Command/Helper/QuestionHelper.php
vendored
Normal file
65
vendor/sensio/generator-bundle/Command/Helper/QuestionHelper.php
vendored
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Sensio\Bundle\GeneratorBundle\Command\Helper;
|
||||
|
||||
use Symfony\Component\Console\Helper\QuestionHelper as BaseQuestionHelper;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
|
||||
/**
|
||||
* Generates bundles.
|
||||
*
|
||||
* @author Fabien Potencier <fabien@symfony.com>
|
||||
*/
|
||||
class QuestionHelper extends BaseQuestionHelper
|
||||
{
|
||||
public function writeGeneratorSummary(OutputInterface $output, $errors)
|
||||
{
|
||||
if (!$errors) {
|
||||
$this->writeSection($output, 'Everything is OK! Now get to work :).');
|
||||
} else {
|
||||
$this->writeSection($output, array(
|
||||
'The command was not able to configure everything automatically.',
|
||||
'You\'ll need to make the following changes manually.',
|
||||
), 'error');
|
||||
|
||||
$output->writeln($errors);
|
||||
}
|
||||
}
|
||||
|
||||
public function getRunner(OutputInterface $output, &$errors)
|
||||
{
|
||||
$runner = function ($err) use ($output, &$errors) {
|
||||
if ($err) {
|
||||
$output->writeln('<fg=red>FAILED</>');
|
||||
$errors = array_merge($errors, $err);
|
||||
} else {
|
||||
$output->writeln('<info>OK</info>');
|
||||
}
|
||||
};
|
||||
|
||||
return $runner;
|
||||
}
|
||||
|
||||
public function writeSection(OutputInterface $output, $text, $style = 'bg=blue;fg=white')
|
||||
{
|
||||
$output->writeln(array(
|
||||
'',
|
||||
$this->getHelperSet()->get('formatter')->formatBlock($text, $style, true),
|
||||
'',
|
||||
));
|
||||
}
|
||||
|
||||
public function getQuestion($question, $default, $sep = ':')
|
||||
{
|
||||
return $default ? sprintf('<info>%s</info> [<comment>%s</comment>]%s ', $question, $default, $sep) : sprintf('<info>%s</info>%s ', $question, $sep);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue