Adding success style.

Adding some additional formatting to the default welcome method.
This commit is contained in:
mark_story 2010-10-03 23:58:07 -04:00
parent b11f2bfb1f
commit 749e9c19d5
2 changed files with 6 additions and 4 deletions

View file

@ -116,7 +116,8 @@ class ConsoleOutput {
protected static $_styles = array(
'error' => array('text' => 'red'),
'warning' => array('text' => 'yellow'),
'info' => array('text' => 'cyan')
'info' => array('text' => 'cyan'),
'success' => array('text' => 'green')
);
/**

View file

@ -192,7 +192,7 @@ class Shell extends Object {
protected function _welcome() {
$this->Dispatch->clear();
$this->out();
$this->out('Welcome to CakePHP v' . Configure::version() . ' Console');
$this->out('<info>Welcome to CakePHP v' . Configure::version() . ' Console</info>');
$this->hr();
$this->out('App : '. $this->params['app']);
$this->out('Path: '. $this->params['working']);
@ -345,10 +345,11 @@ class Shell extends Object {
* Outputs a series of minus characters to the standard output, acts as a visual separator.
*
* @param integer $newlines Number of newlines to pre- and append
* @param integer $width Width of the line, defaults to 63
*/
public function hr($newlines = 0) {
public function hr($newlines = 0, $width = 63) {
$this->out(null, $newlines);
$this->out('---------------------------------------------------------------');
$this->out(str_repeat('-', $width));
$this->out(null, $newlines);
}