minor #10432 clean up framework bundle commands (cordoval)

This PR was merged into the 2.5-dev branch.

Discussion
----------

clean up framework bundle commands

|Q            |A  |
|---          |---|
|Bug Fix?     |no |
|New Feature? |no |
|BC Breaks?   |no |
|Deprecations?|no |
|Tests Pass?  |yes|
|Fixed Tickets|   |
|License      |MIT|
|Doc PR       |na |

Commits
-------

0984313 clean up commands from framework bundle
This commit is contained in:
Fabien Potencier 2014-03-13 06:03:27 +01:00
commit 1e0fea61e8
16 changed files with 27 additions and 17 deletions

View File

@ -55,7 +55,7 @@ class TemplateFinder implements TemplateFinderInterface
$templates = array(); $templates = array();
foreach ($this->kernel->getBundles() as $name => $bundle) { foreach ($this->kernel->getBundles() as $bundle) {
$templates = array_merge($templates, $this->findTemplatesInBundle($bundle)); $templates = array_merge($templates, $this->findTemplatesInBundle($bundle));
} }

View File

@ -16,7 +16,7 @@ use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\DependencyInjection\Extension\Extension; use Symfony\Component\DependencyInjection\Extension\Extension;
/** /**
* A console command for dumping available configuration reference * A console command for dumping available configuration reference.
* *
* @author Kevin Bond <kevinbond@gmail.com> * @author Kevin Bond <kevinbond@gmail.com>
* @author Wouter J <waldio.webdesign@gmail.com> * @author Wouter J <waldio.webdesign@gmail.com>

View File

@ -83,7 +83,7 @@ EOT
$bundlesDir = $targetArg.'/bundles/'; $bundlesDir = $targetArg.'/bundles/';
$filesystem->mkdir($bundlesDir, 0777); $filesystem->mkdir($bundlesDir, 0777);
$output->writeln(sprintf("Installing assets using the <comment>%s</comment> option", $input->getOption('symlink') ? 'symlink' : 'hard copy')); $output->writeln(sprintf('Installing assets %s the <comment>symlink</comment> option', $input->getOption('symlink') ? 'using' : 'without'));
foreach ($this->getContainer()->get('kernel')->getBundles() as $bundle) { foreach ($this->getContainer()->get('kernel')->getBundles() as $bundle) {
if (is_dir($originDir = $bundle->getPath().'/Resources/public')) { if (is_dir($originDir = $bundle->getPath().'/Resources/public')) {

View File

@ -43,6 +43,7 @@ and debug mode:
<info>php %command.full_name% --env=dev</info> <info>php %command.full_name% --env=dev</info>
<info>php %command.full_name% --env=prod --no-debug</info> <info>php %command.full_name% --env=prod --no-debug</info>
EOF EOF
) )
; ;
@ -107,9 +108,9 @@ EOF
} }
/** /**
* @param string $warmupDir * @param string $warmupDir
* @param string $realCacheDir * @param string $realCacheDir
* @param bool $enableOptionalWarmers * @param Boolean $enableOptionalWarmers
*/ */
protected function warmup($warmupDir, $realCacheDir, $enableOptionalWarmers = true) protected function warmup($warmupDir, $realCacheDir, $enableOptionalWarmers = true)
{ {

View File

@ -42,6 +42,7 @@ This command does not generate the classes cache (as when executing this
command, too many classes that should be part of the cache are already loaded command, too many classes that should be part of the cache are already loaded
in memory). Use <comment>curl</comment> or any other similar tool to warm up in memory). Use <comment>curl</comment> or any other similar tool to warm up
the classes cache if you want. the classes cache if you want.
EOF EOF
) )
; ;

View File

@ -15,11 +15,10 @@ use Symfony\Component\Config\Definition\Processor;
use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
use Symfony\Component\Yaml\Yaml; use Symfony\Component\Yaml\Yaml;
/** /**
* A console command for dumping available configuration reference * A console command for dumping available configuration reference.
* *
* @author Grégoire Pineau <lyrixx@lyrixx.info> * @author Grégoire Pineau <lyrixx@lyrixx.info>
*/ */

View File

@ -19,7 +19,7 @@ use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Output\OutputInterface;
/** /**
* A console command for dumping available configuration reference * A console command for dumping available configuration reference.
* *
* @author Kevin Bond <kevinbond@gmail.com> * @author Kevin Bond <kevinbond@gmail.com>
* @author Wouter J <waldio.webdesign@gmail.com> * @author Wouter J <waldio.webdesign@gmail.com>
@ -53,6 +53,7 @@ this is either <comment>yaml</comment> or <comment>xml</comment>.
When the option is not provided, <comment>yaml</comment> is used. When the option is not provided, <comment>yaml</comment> is used.
<info>php %command.full_name% FrameworkBundle --format=xml</info> <info>php %command.full_name% FrameworkBundle --format=xml</info>
EOF EOF
) )
; ;

View File

@ -21,7 +21,7 @@ use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\Config\FileLocator; use Symfony\Component\Config\FileLocator;
/** /**
* A console command for retrieving information about services * A console command for retrieving information about services.
* *
* @author Ryan Weaver <ryan@thatsquality.com> * @author Ryan Weaver <ryan@thatsquality.com>
*/ */
@ -41,8 +41,8 @@ class ContainerDebugCommand extends ContainerAwareCommand
->setName('container:debug') ->setName('container:debug')
->setDefinition(array( ->setDefinition(array(
new InputArgument('name', InputArgument::OPTIONAL, 'A service name (foo)'), new InputArgument('name', InputArgument::OPTIONAL, 'A service name (foo)'),
new InputOption('show-private', null, InputOption::VALUE_NONE, 'Use to show public *and* private services'), new InputOption('show-private', null, InputOption::VALUE_NONE, 'Used to show public *and* private services'),
new InputOption('tag', null, InputOption::VALUE_REQUIRED, 'Show all services with a specific tag'), new InputOption('tag', null, InputOption::VALUE_REQUIRED, 'Shows all services with a specific tag'),
new InputOption('tags', null, InputOption::VALUE_NONE, 'Displays tagged services for an application'), new InputOption('tags', null, InputOption::VALUE_NONE, 'Displays tagged services for an application'),
new InputOption('parameter', null, InputOption::VALUE_REQUIRED, 'Displays a specific parameter for an application'), new InputOption('parameter', null, InputOption::VALUE_REQUIRED, 'Displays a specific parameter for an application'),
new InputOption('parameters', null, InputOption::VALUE_NONE, 'Displays parameters for an application'), new InputOption('parameters', null, InputOption::VALUE_NONE, 'Displays parameters for an application'),
@ -79,6 +79,7 @@ Use the --parameters option to display all parameters:
Display a specific parameter by specifying his name with the --parameter option: Display a specific parameter by specifying his name with the --parameter option:
<info>php %command.full_name% --parameter=kernel.debug</info> <info>php %command.full_name% --parameter=kernel.debug</info>
EOF EOF
) )
; ;

View File

@ -63,6 +63,7 @@ These can then be used with the ApacheUrlMatcher to use Apache for route
matching. matching.
<info>php %command.full_name%</info> <info>php %command.full_name%</info>
EOF EOF
) )
; ;

View File

@ -20,7 +20,7 @@ use Symfony\Component\Routing\RouterInterface;
use Symfony\Component\Routing\Route; use Symfony\Component\Routing\Route;
/** /**
* A console command for retrieving information about routes * A console command for retrieving information about routes.
* *
* @author Fabien Potencier <fabien@symfony.com> * @author Fabien Potencier <fabien@symfony.com>
* @author Tobias Schultze <http://tobion.de> * @author Tobias Schultze <http://tobion.de>
@ -61,6 +61,7 @@ class RouterDebugCommand extends ContainerAwareCommand
The <info>%command.name%</info> displays the configured routes: The <info>%command.name%</info> displays the configured routes:
<info>php %command.full_name%</info> <info>php %command.full_name%</info>
EOF EOF
) )
; ;

View File

@ -56,6 +56,7 @@ class RouterMatchCommand extends ContainerAwareCommand
The <info>%command.name%</info> simulates a path info match: The <info>%command.name%</info> simulates a path info match:
<info>php %command.full_name% /foo</info> <info>php %command.full_name% /foo</info>
EOF EOF
) )
; ;
@ -72,7 +73,7 @@ EOF
$traces = $matcher->getTraces($input->getArgument('path_info')); $traces = $matcher->getTraces($input->getArgument('path_info'));
$matches = false; $matches = false;
foreach ($traces as $i => $trace) { foreach ($traces as $trace) {
if (TraceableUrlMatcher::ROUTE_ALMOST_MATCHES == $trace['level']) { if (TraceableUrlMatcher::ROUTE_ALMOST_MATCHES == $trace['level']) {
$output->writeln(sprintf('<fg=yellow>Route "%s" almost matches but %s</>', $trace['name'], lcfirst($trace['log']))); $output->writeln(sprintf('<fg=yellow>Route "%s" almost matches but %s</>', $trace['name'], lcfirst($trace['log'])));
} elseif (TraceableUrlMatcher::ROUTE_MATCHES == $trace['level']) { } elseif (TraceableUrlMatcher::ROUTE_MATCHES == $trace['level']) {

View File

@ -18,7 +18,7 @@ use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Process\ProcessBuilder; use Symfony\Component\Process\ProcessBuilder;
/** /**
* Runs Symfony2 application using PHP built-in web server * Runs Symfony2 application using PHP built-in web server.
* *
* @author Michał Pipa <michal.pipa.xsolve@gmail.com> * @author Michał Pipa <michal.pipa.xsolve@gmail.com>
*/ */
@ -68,6 +68,7 @@ router script using <info>--router</info> option:
<info>%command.full_name% --router=app/config/router.php</info> <info>%command.full_name% --router=app/config/router.php</info>
See also: http://www.php.net/manual/en/features.commandline.webserver.php See also: http://www.php.net/manual/en/features.commandline.webserver.php
EOF EOF
) )
; ;

View File

@ -67,6 +67,7 @@ You can only display missing messages:
You can only display unused messages: You can only display unused messages:
<info>php %command.full_name% --only-unused en AcmeDemoBundle</info> <info>php %command.full_name% --only-unused en AcmeDemoBundle</info>
EOF EOF
) )
; ;

View File

@ -66,6 +66,7 @@ message.
<info>php %command.full_name% --dump-messages en AcmeBundle</info> <info>php %command.full_name% --dump-messages en AcmeBundle</info>
<info>php %command.full_name% --force --prefix="new_" fr AcmeBundle</info> <info>php %command.full_name% --force --prefix="new_" fr AcmeBundle</info>
EOF EOF
) )
; ;

View File

@ -24,7 +24,7 @@ use Symfony\Component\Yaml\Exception\ParseException;
use Symfony\Component\Yaml\Parser; use Symfony\Component\Yaml\Parser;
/** /**
* Validates YAML files syntax and output encountered errors. * Validates YAML files syntax and outputs encountered errors.
* *
* @author Grégoire Pineau <lyrixx@lyrixx.info> * @author Grégoire Pineau <lyrixx@lyrixx.info>
*/ */
@ -57,6 +57,7 @@ Or all YAML files in a bundle:
You can also pass the YAML contents from STDIN: You can also pass the YAML contents from STDIN:
<info>cat filename | php %command.full_name%</info> <info>cat filename | php %command.full_name%</info>
EOF EOF
) )
; ;

View File

@ -19,7 +19,7 @@ use Symfony\Bundle\FrameworkBundle\Controller\RedirectController;
use Symfony\Bundle\FrameworkBundle\Tests\TestCase; use Symfony\Bundle\FrameworkBundle\Tests\TestCase;
/** /**
* @author Marcin Sikon<marcin.sikon@gmail.com> * @author Marcin Sikon <marcin.sikon@gmail.com>
*/ */
class RedirectControllerTest extends TestCase class RedirectControllerTest extends TestCase
{ {