Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions libraries/Cli.php
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,27 @@ public function prompt()

return $input;
}

/**
* Outputs an array with possible multiple foreground/background colors
*
* @param array $text a single line array to output, with text, fg
* and bg in the array
*/
public function multi_write($text = array())
{
$str = '';
foreach($text AS $opts)
{
if ($opts["fg"] || $opts["bg"])
{
$str .= $this->color($opts["text"], $opts["fg"], $opts["bg"]);
} else {
$str .= $opts["text"];
}
}
$this->write($str);
}

/**
* Outputs a string to the cli. If you send an array it will implode them
Expand Down