aboutsummaryrefslogtreecommitdiffstats
path: root/admin/include
diff options
context:
space:
mode:
Diffstat (limited to 'admin/include')
-rw-r--r--admin/include/functions_install.inc.php17
1 files changed, 17 insertions, 0 deletions
diff --git a/admin/include/functions_install.inc.php b/admin/include/functions_install.inc.php
index 8d00a4d36..d55f4e057 100644
--- a/admin/include/functions_install.inc.php
+++ b/admin/include/functions_install.inc.php
@@ -138,4 +138,21 @@ function activate_all_themes()
$themes->perform_action('activate', $theme_id);
}
}
+
+function try_db_connection(&$infos, &$errors)
+{
+ try
+ {
+ $pwg_db_link = pwg_db_connect($_POST['dbhost'], $_POST['dbuser'],
+ $_POST['dbpasswd'], $_POST['dbname']);
+
+ array_push( $infos, l10n('Parameters are correct') );
+ return true;
+ }
+ catch (Exception $e)
+ {
+ array_push( $errors, l10n($e->getMessage()));
+ }
+ return false;
+}
?> \ No newline at end of file