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:
Tony Murray
2021-05-13 07:18:54 -05:00
committed by GitHub
parent 500b0ac6fa
commit df5096e449
15 changed files with 77 additions and 69 deletions
+3 -12
View File
@@ -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);