[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
This commit is contained in:
parent
c48ae250ac
commit
44997d35af
@ -213,16 +213,6 @@ class Command
|
|||||||
*/
|
*/
|
||||||
public function run(InputInterface $input, OutputInterface $output)
|
public function run(InputInterface $input, OutputInterface $output)
|
||||||
{
|
{
|
||||||
if (null !== $this->processTitle) {
|
|
||||||
if (function_exists('cli_set_process_title')) {
|
|
||||||
cli_set_process_title($this->processTitle);
|
|
||||||
} elseif (function_exists('setproctitle')) {
|
|
||||||
setproctitle($this->processTitle);
|
|
||||||
} elseif (OutputInterface::VERBOSITY_VERY_VERBOSE === $output->getVerbosity()) {
|
|
||||||
$output->writeln('<comment>Install the proctitle PECL to be able to change the process title.</comment>');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// force the creation of the synopsis before the merge with the app definition
|
// force the creation of the synopsis before the merge with the app definition
|
||||||
$this->getSynopsis();
|
$this->getSynopsis();
|
||||||
|
|
||||||
@ -240,6 +230,16 @@ class Command
|
|||||||
|
|
||||||
$this->initialize($input, $output);
|
$this->initialize($input, $output);
|
||||||
|
|
||||||
|
if (null !== $this->processTitle) {
|
||||||
|
if (function_exists('cli_set_process_title')) {
|
||||||
|
cli_set_process_title($this->processTitle);
|
||||||
|
} elseif (function_exists('setproctitle')) {
|
||||||
|
setproctitle($this->processTitle);
|
||||||
|
} elseif (OutputInterface::VERBOSITY_VERY_VERBOSE === $output->getVerbosity()) {
|
||||||
|
$output->writeln('<comment>Install the proctitle PECL to be able to change the process title.</comment>');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ($input->isInteractive()) {
|
if ($input->isInteractive()) {
|
||||||
$this->interact($input, $output);
|
$this->interact($input, $output);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user