minor #10474 [Console] Rename Command::setProcessName to Command::setProcessTitle (lyrixx)

This PR was merged into the 2.5-dev branch.

Discussion
----------

[Console] Rename Command::setProcessName to Command::setProcessTitle

To be more consistant with the underlying system.

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no (because the 2.5 is not released yet)
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | none
| License       | MIT
| Doc PR        | none

Commits
-------

6786f6d [Console] Rename Command::setProcessName to Command::setProcessTitle
This commit is contained in:
Fabien Potencier 2014-03-18 10:32:32 +01:00
commit 6deb4ccb88
2 changed files with 9 additions and 9 deletions

View File

@ -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
----- -----

View File

@ -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;
} }