mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-19 02:56:15 +00:00
adding array support for output methods in Shell
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5560 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
74d16fc110
commit
b0c21b9297
1 changed files with 14 additions and 0 deletions
|
@ -325,6 +325,13 @@ class Shell extends Object {
|
||||||
* @param boolean $newline If true, the outputs gets an added newline.
|
* @param boolean $newline If true, the outputs gets an added newline.
|
||||||
*/
|
*/
|
||||||
function out($string, $newline = true) {
|
function out($string, $newline = true) {
|
||||||
|
if(is_array($string)) {
|
||||||
|
$str = '';
|
||||||
|
foreach($string as $message) {
|
||||||
|
$str .= $message ."\n";
|
||||||
|
}
|
||||||
|
$string = $str;
|
||||||
|
}
|
||||||
return $this->Dispatch->stdout($string, $newline);
|
return $this->Dispatch->stdout($string, $newline);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
|
@ -333,6 +340,13 @@ class Shell extends Object {
|
||||||
* @param string $string Error text to output.
|
* @param string $string Error text to output.
|
||||||
*/
|
*/
|
||||||
function err($string) {
|
function err($string) {
|
||||||
|
if(is_array($string)) {
|
||||||
|
$str = '';
|
||||||
|
foreach($string as $message) {
|
||||||
|
$str .= $message ."\n";
|
||||||
|
}
|
||||||
|
$string = $str;
|
||||||
|
}
|
||||||
return $this->Dispatch->stderr($string."\n");
|
return $this->Dispatch->stderr($string."\n");
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Reference in a new issue