mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Install: Validate database before migrating (#12867)
* Validate database during install Needed to remove usages of legacy functions in the validation * Fix output, restore real versions
This commit is contained in:
+3
-12
@@ -144,18 +144,9 @@ function shorthost($hostname, $len = 12)
|
||||
return $shorthost;
|
||||
}
|
||||
|
||||
function isCli()
|
||||
{
|
||||
if (php_sapi_name() == 'cli' && empty($_SERVER['REMOTE_ADDR'])) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function print_error($text)
|
||||
{
|
||||
if (isCli()) {
|
||||
if (App::runningInConsole()) {
|
||||
c_echo('%r' . $text . "%n\n");
|
||||
} else {
|
||||
echo '<div class="alert alert-danger"><i class="fa fa-fw fa-exclamation-circle" aria-hidden="true"></i> ' . $text . '</div>';
|
||||
@@ -164,7 +155,7 @@ function print_error($text)
|
||||
|
||||
function print_message($text)
|
||||
{
|
||||
if (isCli()) {
|
||||
if (App::runningInConsole()) {
|
||||
c_echo('%g' . $text . "%n\n");
|
||||
} else {
|
||||
echo '<div class="alert alert-success"><i class="fa fa-fw fa-check-circle" aria-hidden="true"></i> ' . $text . '</div>';
|
||||
@@ -438,7 +429,7 @@ function c_echo($string, $enabled = true)
|
||||
return;
|
||||
}
|
||||
|
||||
if (isCli()) {
|
||||
if (App::runningInConsole()) {
|
||||
global $console_color;
|
||||
if ($console_color) {
|
||||
echo $console_color->convert($string);
|
||||
|
||||
Reference in New Issue
Block a user