Fix error when gettext is not yet loaded and we want to warn.

This happens when PHP is compiled without session support, which is
checked before gettext is loaded.
This commit is contained in:
Michal Čihař
2011-07-10 22:46:46 +02:00
parent 58d25ddcb8
commit ed88c4a7b6

View File

@@ -275,7 +275,13 @@ function PMA_getPHPDocLink($target) {
*/ */
function PMA_warnMissingExtension($extension, $fatal = false, $extra = '') function PMA_warnMissingExtension($extension, $fatal = false, $extra = '')
{ {
$message = sprintf(__('The %s extension is missing. Please check your PHP configuration.'), /* Gettext does not have to be loaded yet here */
if (function_exists('__')) {
$message = __('The %s extension is missing. Please check your PHP configuration.');
} else {
$message = 'The %s extension is missing. Please check your PHP configuration.';
}
$message = sprintf($message,
'[a@' . PMA_getPHPDocLink('book.' . $extension . '.php') . '@Documentation][em]' . $extension . '[/em][/a]'); '[a@' . PMA_getPHPDocLink('book.' . $extension . '.php') . '@Documentation][em]' . $extension . '[/em][/a]');
if ($extra != '') { if ($extra != '') {
$message .= ' ' . $extra; $message .= ' ' . $extra;