mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-02-07 12:36:25 +00:00
Backport CODE_ERROR constant and return as per expectation.
This commit is contained in:
parent
b4960c7965
commit
c06bde34d6
1 changed files with 13 additions and 3 deletions
|
@ -30,6 +30,13 @@ App::uses('File', 'Utility');
|
||||||
*/
|
*/
|
||||||
class Shell extends Object {
|
class Shell extends Object {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Default error code
|
||||||
|
*
|
||||||
|
* @var int
|
||||||
|
*/
|
||||||
|
const CODE_ERROR = 1;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Output constant making verbose shells.
|
* Output constant making verbose shells.
|
||||||
*
|
*
|
||||||
|
@ -573,7 +580,8 @@ class Shell extends Object {
|
||||||
$result = $this->stdin->read();
|
$result = $this->stdin->read();
|
||||||
|
|
||||||
if ($result === false) {
|
if ($result === false) {
|
||||||
return $this->_stop(1);
|
$this->_stop(self::CODE_ERROR);
|
||||||
|
return self::CODE_ERROR;
|
||||||
}
|
}
|
||||||
$result = trim($result);
|
$result = trim($result);
|
||||||
|
|
||||||
|
@ -720,7 +728,8 @@ class Shell extends Object {
|
||||||
if (!empty($message)) {
|
if (!empty($message)) {
|
||||||
$this->err($message);
|
$this->err($message);
|
||||||
}
|
}
|
||||||
return $this->_stop(1);
|
$this->_stop(self::CODE_ERROR);
|
||||||
|
return self::CODE_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -758,7 +767,8 @@ class Shell extends Object {
|
||||||
|
|
||||||
if (strtolower($key) === 'q') {
|
if (strtolower($key) === 'q') {
|
||||||
$this->out(__d('cake_console', '<error>Quitting</error>.'), 2);
|
$this->out(__d('cake_console', '<error>Quitting</error>.'), 2);
|
||||||
return $this->_stop();
|
$this->_stop();
|
||||||
|
return true;
|
||||||
} elseif (strtolower($key) !== 'y') {
|
} elseif (strtolower($key) !== 'y') {
|
||||||
$this->out(__d('cake_console', 'Skip `%s`', $path), 2);
|
$this->out(__d('cake_console', 'Skip `%s`', $path), 2);
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Add table
Reference in a new issue