8000 bug #12032 [Command] Set the process title as late as possible (lyrixx) · symfony/symfony@f94ba9a · GitHub
[go: up one dir, main page]

Skip to content

Commit f94ba9a

Browse files
committed
bug #12032 [Command] Set the process title as late as possible (lyrixx)
This PR was submitted for the master branch but it was merged into the 2.5 branch instead (closes #12032). Discussion ---------- [Command] Set the process title as late as possible | Q | A | ------------- | --- | Bug fix? | yes (so it could be merged into 2.5) | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - To be able to customize to process title in the `initialize` method of the current command with some arguments or options Commits ------- 44997d3 [Command] Set the process title as late as possible
2 parents c48ae25 + 44997d3 commit f94ba9a

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/Symfony/Component/Console/Command/Command.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -213,16 +213,6 @@ protected function initialize(InputInterface $input, OutputInterface $output)
213213
*/
214214
public function run(InputInterface $input, OutputInterface $output)
215215
{
216-
if (null !== $this->processTitle) {
217-
if (function_exists('cli_set_process_title')) {
218-
cli_set_process_title($this->processTitle);
219-
} elseif (function_exists('setproctitle')) {
220-
setproctitle($this->processTitle);
221-
} elseif (OutputInterface::VERBOSITY_VERY_VERBOSE === $output->getVerbosity()) {
222-
$output->writeln('<comment>Install the proctitle PECL to be able to change the process title.</comment>');
223-
}
224-
}
225-
226216
// force the creation of the synopsis before the merge with the app definition
227217
$this->getSynopsis();
228218

@@ -240,6 +230,16 @@ public function run(InputInterface $input, OutputInterface $output)
240230

241231
$this->initialize($input, $output);
242232

233+
if (null !== $this->processTitle) {
234+
if (function_exists('cli_set_process_title')) {
235+
cli_set_process_title($this->processTitle);
236+
} elseif (function_exists('setproctitle')) {
237+
setproctitle($this->processTitle);
238+
} elseif (OutputInterface::VERBOSITY_VERY_VERBOSE === $output->getVerbosity()) {
239+
$output->writeln('<comment>Install the proctitle PECL to be able to change the process title.</comment>');
240+
}
241+
}
242+
243243
if ($input->isInteractive()) {
244244
$this->interact($input, $output);
245245
}

0 commit comments

Comments
 (0)
0