You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feature #20632 [FrameworkBundle] Make use of stderr for non reliable output (chalasr, ogizanagi)
This PR was merged into the 3.3-dev branch.
Discussion
----------
[FrameworkBundle] Make use of stderr for non reliable output
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | yes
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | n/a
| License | MIT
| Doc PR | n/a
Built-in commands should make use of the proper outputs.
As a feature on master, considering that people may actually rely on stdout and the fact commands have been changed a lot since 2.7, I think it's not worth doing this change on lower branches.
Please see also #20586 which adds a `SymfonyStyle::getErrorStyle()` shortcut for easily switching to stderr.
Commits
-------
7b262d8c29 [FrameworkBundle] Use getErrorStyle() when relevant
9a3a5686c8 Use stderr for some other commands
1ee48bfd60 [FrameworkBundle] Make use of stderr for non reliable output
if (null === $name = $input->getArgument('name')) {
67
-
$this->listBundles($io);
68
-
$io->comment('Provide the name of a bundle as the first argument of this command to dump its configuration. (e.g. <comment>debug:config FrameworkBundle</comment>)');
69
-
$io->comment('For dumping a specific option, add its path as the second argument of this command. (e.g. <comment>debug:config FrameworkBundle serializer</comment> to dump the <comment>framework.serializer</comment> configuration)');
68
+
$this->listBundles($errorIo);
69
+
$errorIo->comment('Provide the name of a bundle as the first argument of this command to dump its configuration. (e.g. <comment>debug:config FrameworkBundle</comment>)');
70
+
$errorIo->comment('For dumping a specific option, add its path as the second argument of this command. (e.g. <comment>debug:config FrameworkBundle serializer</comment> to dump the <comment>framework.serializer</comment> configuration)');
70
71
71
72
return;
72
73
}
@@ -98,7 +99,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
if (null === $name = $input->getArgument('name')) {
78
-
$this->listBundles($io);
79
-
$io->comment(array(
79
+
$this->listBundles($errorIo);
80
+
$errorIo->comment(array(
80
81
'Provide the name of a bundle as the first argument of this command to dump its default configuration. (e.g. <comment>config:dump-reference FrameworkBundle</comment>)',
81
82
'For dumping a specific option, add its path as the second argument of this command. (e.g. <comment>config:dump-reference FrameworkBundle profiler.matcher</comment> to dump the <comment>framework.profiler.matcher</comment> configuration)',
82
83
));
@@ -94,7 +95,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
94
95
$path = $input->getArgument('path');
95
96
96
97
if ($path !== null && 'yaml' !== $format) {
97
-
$io->error('The "path" option is only available for the "yaml" format.');
98
+
$errorIo->error('The "path" option is only available for the "yaml" format.');
if (!$input->getArgument('name') && !$input->getOption('tag') && !$input->getOption('parameter') && $input->isInteractive()) {
128
130
if ($input->getOption('tags')) {
129
-
$io->comment('To search for a specific tag, re-run this command with a search term. (e.g. <comment>debug:container --tag=form.type</comment>)');
131
+
$errorIo->comment('To search for a specific tag, re-run this command with a search term. (e.g. <comment>debug:container --tag=form.type</comment>)');
130
132
} elseif ($input->getOption('parameters')) {
131
-
$io->comment('To search for a specific parameter, re-run this command with a search term. (e.g. <comment>debug:container --parameter=kernel.debug</comment>)');
133
+
$errorIo->comment('To search for a specific parameter, re-run this command with a search term. (e.g. <comment>debug:container --parameter=kernel.debug</comment>)');
132
134
} else {
133
-
$io->comment('To search for a specific service, re-run this command with a search term. (e.g. <comment>debug:container log</comment>)');
135
+
$errorIo->comment('To search for a specific service, re-run this command with a search term. (e.g. <comment>debug:container log</comment>)');
0 commit comments