Skip to content

Commit

Permalink
Don't use deprecated methods anymore ourselves.
Browse files Browse the repository at this point in the history
  • Loading branch information
yunosh committed Apr 19, 2017
1 parent 2d40f76 commit 8e0cb83
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions framework/Cli/lib/Horde/Cli.php
Expand Up @@ -288,27 +288,27 @@ public function message($message, $type = 'cli.message')

switch ($type) {
case 'cli.error':
$type_message = $this->red(
$type_message = $this->_color->red(
'[' . $this->_space . 'ERROR!' . $this->_space . '] '
);
break;

case 'cli.warning':
$type_message = $this->yellow(
$type_message = $this->_color->yellow(
'[' . $this->_space . $this->_space . 'WARN'
. $this->_space . $this->_space . '] '
);
break;

case 'cli.success':
$type_message = $this->green(
$type_message = $this->_color->green(
'[' . $this->_space . $this->_space . $this->_space . 'OK'
. $this->_space . $this->_space . $this->_space . '] '
);
break;

case 'cli.message':
$type_message = $this->blue(
$type_message = $this->_color->blue(
'[' . $this->_space . $this->_space . 'INFO' . $this->_space
. $this->_space . '] '
);
Expand Down Expand Up @@ -363,19 +363,19 @@ public function fatal($error)
$error = $error->getMessage();
}
$this->writeln();
$this->writeln($this->red('===================='));
$this->writeln($this->_color->red('===================='));
$this->writeln();
$this->writeln($this->red(Horde_Cli_Translation::t("Fatal Error:")));
$this->writeln($this->red($error));
$this->writeln($this->_color->red(Horde_Cli_Translation::t("Fatal Error:")));
$this->writeln($this->_color->red($error));
if ($details) {
$this->writeln($this->red(print_r($details, true)));
$this->writeln($this->_color->red(print_r($details, true)));
}
if ($location) {
$this->writeln($this->red($location));
$this->writeln($this->_color->red($location));
}
$this->writeln();
$this->writeln((string)$backtrace);
$this->writeln($this->red('===================='));
$this->writeln($this->_color->red('===================='));
exit(1);
}

Expand Down Expand Up @@ -421,7 +421,7 @@ public function prompt($prompt, $choices = null, $default = null)
$this->writeln($prompt . ' ', !is_array($choices));
foreach ($choices as $key => $choice) {
$this->writeln(
$this->indent('(' . $this->bold($key) . ') ' . $choice)
$this->indent('(' . $this->_color->bold($key) . ') ' . $choice)
);
}
$question = Horde_Cli_Translation::t("Type your choice");
Expand All @@ -439,7 +439,7 @@ public function prompt($prompt, $choices = null, $default = null)
if (isset($choices[$response])) {
return $response;
} else {
$this->writeln($this->red(sprintf(
$this->writeln($this->_color->red(sprintf(
Horde_Cli_Translation::t(
"\"%s\" is not a valid choice."
),
Expand Down

0 comments on commit 8e0cb83

Please sign in to comment.