mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Converting more stderr() use into exceptions.
This commit is contained in:
parent
749e9c19d5
commit
b6602f1d0d
1 changed files with 7 additions and 10 deletions
|
@ -180,19 +180,16 @@ class ShellDispatcher {
|
||||||
$this->stderr = new ConsoleOutput('php://stderr');
|
$this->stderr = new ConsoleOutput('php://stderr');
|
||||||
|
|
||||||
if (!$this->__bootstrap()) {
|
if (!$this->__bootstrap()) {
|
||||||
$this->stderr("\nCakePHP Console: ");
|
$message = "Unable to load CakePHP core.\nMake sure " . DS . 'cake' . DS . 'libs exists in ' . CAKE_CORE_INCLUDE_PATH;
|
||||||
$this->stderr("\nUnable to load Cake core:");
|
throw new RuntimeException($message);
|
||||||
$this->stderr("\tMake sure " . DS . 'cake' . DS . 'libs exists in ' . CAKE_CORE_INCLUDE_PATH);
|
|
||||||
$this->_stop();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isset($this->args[0]) || !isset($this->params['working'])) {
|
if (!isset($this->args[0]) || !isset($this->params['working'])) {
|
||||||
$this->stderr("\nCakePHP Console: ");
|
$message = "This file has been loaded incorrectly and cannot continue.\n" .
|
||||||
$this->stderr('This file has been loaded incorrectly and cannot continue.');
|
"Please make sure that " . DIRECTORY_SEPARATOR . "cake" . DIRECTORY_SEPARATOR . "console is in your system path,\n" .
|
||||||
$this->stderr('Please make sure that ' . DIRECTORY_SEPARATOR . 'cake' . DIRECTORY_SEPARATOR . 'console is in your system path,');
|
"and check the cookbook for the correct usage of this command.\n" .
|
||||||
$this->stderr('and check the manual for the correct usage of this command.');
|
"(http://book.cakephp.org/)";
|
||||||
$this->stderr('(http://manual.cakephp.org/)');
|
throw new RuntimeException($message);
|
||||||
$this->_stop();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->shiftArgs();
|
$this->shiftArgs();
|
||||||
|
|
Loading…
Reference in a new issue