function upgrade_db_connect() { global $conf; try { pwg_db_connect($conf['db_host'], $conf['db_user'], $conf['db_password'], $conf['db_base']); pwg_db_check_version(); } catch (Exception $e) { my_error(l10n($e->getMessage()), true); } }
/** * Connect to database during installation. Uses $_POST. * * @param array &$infos - populated with infos * @param array &$errors - populated with errors */ function install_db_connect(&$infos, &$errors) { try { pwg_db_connect($_POST['dbhost'], $_POST['dbuser'], $_POST['dbpasswd'], $_POST['dbname']); pwg_db_check_version(); } catch (Exception $e) { $errors[] = l10n($e->getMessage()); } }