Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 44997d3

Browse filesBrowse files
lyrixxfabpot
authored andcommitted
[Command] Set the process title as late as possible
To be able to customize to process title in the `initialize` method of the current command with some arguments or option
1 parent c48ae25 commit 44997d3
Copy full SHA for 44997d3

File tree

Expand file treeCollapse file tree

1 file changed

+10
-10
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+10
-10
lines changed

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

Copy file name to clipboardExpand all lines: src/Symfony/Component/Console/Command/Command.php
+10-10Lines 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)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.