[Console] Rename Command::setProcessName to Command::setProcessTitle
To be more consistant with the underlying system.
This commit is contained in:
parent
71dc07ce08
commit
6786f6db18
@ -7,7 +7,7 @@ CHANGELOG
|
|||||||
* deprecated TableHelper in favor of Table
|
* deprecated TableHelper in favor of Table
|
||||||
* deprecated ProgressHelper in favor of ProgressBar
|
* deprecated ProgressHelper in favor of ProgressBar
|
||||||
* added a way to set a default command instead of `ListCommand`
|
* added a way to set a default command instead of `ListCommand`
|
||||||
* added a way to set the process name of a command
|
* added a way to set the process title of a command
|
||||||
|
|
||||||
2.4.0
|
2.4.0
|
||||||
-----
|
-----
|
||||||
|
@ -33,7 +33,7 @@ class Command
|
|||||||
{
|
{
|
||||||
private $application;
|
private $application;
|
||||||
private $name;
|
private $name;
|
||||||
private $processName;
|
private $processTitle;
|
||||||
private $aliases = array();
|
private $aliases = array();
|
||||||
private $definition;
|
private $definition;
|
||||||
private $help;
|
private $help;
|
||||||
@ -213,11 +213,11 @@ class Command
|
|||||||
*/
|
*/
|
||||||
public function run(InputInterface $input, OutputInterface $output)
|
public function run(InputInterface $input, OutputInterface $output)
|
||||||
{
|
{
|
||||||
if (null !== $this->processName) {
|
if (null !== $this->processTitle) {
|
||||||
if (function_exists('cli_set_process_title')) {
|
if (function_exists('cli_set_process_title')) {
|
||||||
cli_set_process_title($this->processName);
|
cli_set_process_title($this->processTitle);
|
||||||
} elseif (function_exists('setproctitle')) {
|
} elseif (function_exists('setproctitle')) {
|
||||||
setproctitle($this->processName);
|
setproctitle($this->processTitle);
|
||||||
} elseif (OutputInterface::VERBOSITY_VERY_VERBOSE === $output->getVerbosity()) {
|
} elseif (OutputInterface::VERBOSITY_VERY_VERBOSE === $output->getVerbosity()) {
|
||||||
$output->writeln('<comment>Install the proctitle PECL to be able to change the process title.</comment>');
|
$output->writeln('<comment>Install the proctitle PECL to be able to change the process title.</comment>');
|
||||||
}
|
}
|
||||||
@ -423,20 +423,20 @@ class Command
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the process name of the command.
|
* Sets the process title of the command.
|
||||||
*
|
*
|
||||||
* This feature should be used only when creating a long process command,
|
* This feature should be used only when creating a long process command,
|
||||||
* like a daemon.
|
* like a daemon.
|
||||||
*
|
*
|
||||||
* PHP 5.5+ or the proctitle PECL library is required
|
* PHP 5.5+ or the proctitle PECL library is required
|
||||||
*
|
*
|
||||||
* @param string $name The process name
|
* @param string $title The process title
|
||||||
*
|
*
|
||||||
* @return Command The current instance
|
* @return Command The current instance
|
||||||
*/
|
*/
|
||||||
public function setProcessName($name)
|
public function setProcessTitle($title)
|
||||||
{
|
{
|
||||||
$this->processName = $name;
|
$this->processTitle = $title;
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user