* install: better error message on database failed connect

* changed <p> tag to <div> in notification messages
This commit is contained in:
slawkens1
2018-01-13 21:18:21 +01:00
parent 9738c1896d
commit fc243466da
11 changed files with 98 additions and 53 deletions

View File

@@ -89,11 +89,18 @@ defined('MYAAC') or die('Direct access not allowed!');
'log' => $config['database_log']
)
);
$db = POT::getInstance()->getDBHandle();
}
catch(PDOException $error) {
if(isset($cache) && $cache->enabled()) {
$cache->delete('config_lua');
}
if(defined('MYAAC_INSTALL')) {
return; // installer will take care of this
}
die('ERROR: Cannot connect to MySQL database.<br/>' .
'Possible reasons:' .
'<ul>' .
@@ -102,5 +109,4 @@ defined('MYAAC') or die('Direct access not allowed!');
'</ul>' . $error);
}
$db = POT::getInstance()->getDBHandle();
?>

View File

@@ -12,9 +12,9 @@ defined('MYAAC') or die('Direct access not allowed!');
function message($message, $type, $return)
{
if($return)
return '<p class="' . $type . '">' . $message . '</p>';
return '<div class="' . $type . '">' . $message . '</div>';
echo '<p class="' . $type . '">' . $message . '</p>';
echo '<div class="' . $type . '">' . $message . '</div>';
return true;
}
function success($message, $return = false) {

View File

@@ -70,6 +70,10 @@ $locale['step_database_error_database_empty'] = 'Der Datenbanktyp kann nicht aus
$locale['step_database_error_only_mysql'] = 'Dieser AAC unterstützt nur MySQL. Aus Ihrer Konfigurationsdatei scheint Ihr OTS die Datenbank $DATABASE_TYPE$ zu verwenden. Bitte ändern Sie Ihre Datenbank in MySQL und folgen Sie dann der Installation erneut.';
$locale['step_database_error_table'] = 'Die Tabelle $TABLE$ existiert nicht. Bitte importieren Sie zuerst Ihr OTS-Datenbankschema.';
$locale['step_database_error_table_exist'] = 'Die Tabelle $TABLE$ existiert bereits. Scheint, dass AAC bereits installiert ist. Das Importieren des MySQL-Schemas wird übersprungen..';
$locale['step_database_error_mysql_connect'] = 'Verbindung zur MySQL-Datenbank nicht möglich.';
$locale['step_database_error_mysql_connect_2'] = 'Mögliche Gründe:';
$locale['step_database_error_mysql_connect_3'] = 'MySQL ist nicht richtig konfiguriert in <i>config.lua</i>.';
$locale['step_database_error_mysql_connect_4'] = 'MySQL-Server läuft nicht.';
$locale['step_database_error_schema'] = 'Fehler beim Importieren des Schemas:';
$locale['step_database_success_schema'] = '$PREFIX$ Tabellen wurden erfolgreich installiert.';
$locale['step_database_error_file'] = '$FILE$ konnte nicht geöffnet werden. Bitte kopieren Sie diesen Inhalt und fügen Sie ihn dort ein:';

View File

@@ -70,6 +70,10 @@ $locale['step_database_error_database_empty'] = 'Cannot determine database type
$locale['step_database_error_only_mysql'] = 'This AAC supports only MySQL. From your config file it seems that your OTS is using: $DATABASE_TYPE$ database. Please change your database to MySQL and then follow the installation again.';
$locale['step_database_error_table'] = 'Table $TABLE$ doesn\'t exist. Please import your OTS database schema first.';
$locale['step_database_error_table_exist'] = 'Table $TABLE$ already exist. Seems AAC is already installed. Skipping importing MySQL schema..';
$locale['step_database_error_mysql_connect'] = 'Cannot connect to the MySQL database.';
$locale['step_database_error_mysql_connect_2'] = 'Possible reasons:';
$locale['step_database_error_mysql_connect_3'] = 'MySQL is not configured propertly in <i>config.lua</i>.';
$locale['step_database_error_mysql_connect_4'] = 'MySQL server is not running.';
$locale['step_database_error_schema'] = 'Error while importing schema:';
$locale['step_database_success_schema'] = 'Successfully installed $PREFIX$ tables.';
$locale['step_database_error_file'] = '$FILE$ couldn\'t be opened. Please copy this content and paste there:';

View File

@@ -65,6 +65,10 @@ $locale['step_database_error_database_empty'] = 'Nie można wykryć typu bazy da
$locale['step_database_error_only_mysql'] = 'Ten AAC wspiera tylko bazy danych MySQL. Z Twojego pliku config wynika, że Twój serwera używa bazy: $DATABASE_TYPE$. Proszę zmienić typ bazy na MySQL i ponownie przystąpić do instalacji.';
$locale['step_database_error_table'] = 'Tabela $TABLE$ nie istnieje. Proszę najpierw zaimportować schemat bazy danych serwera OTS.';
$locale['step_database_error_table_exist'] = 'Tabela $TABLE$ już istnieje. Wygląda na to, że AAC został już zainstalowany. Schemat MySQL nie zostanie zaimportowany..';
$locale['step_database_error_mysql_connect'] = 'Nie udało się połączyć z bazą danych MySQL.';
$locale['step_database_error_mysql_connect_2'] = 'Możliwe przyczyny:';
$locale['step_database_error_mysql_connect_3'] = 'MySQL nie jest poprawnie skonfigurowane w <i>config.lua</i>.';
$locale['step_database_error_mysql_connect_4'] = 'Serwer MySQL nie jest uruchomiony.';
$locale['step_database_error_schema'] = 'Błąd podczas importowania struktury bazy danych:';
$locale['step_database_success_schema'] = 'Pomyślnie zainstalowano tabele $PREFIX$.';
$locale['step_database_error_file'] = '$FILE$ nie mógł zostać otwarty. Proszę skopiować zawartość pola tekstowego i wkleić do tego pliku:';