Generic function to warn about missing extension.
This commit is contained in:
@@ -274,6 +274,26 @@ function PMA_fatalError($error_message, $message_args = null)
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Warn or fail on missing extension.
|
||||
*
|
||||
* @param string $extension Extension name
|
||||
* @param bool $fatal Whether the error is fatal.
|
||||
/ @param string $extra Extra string to append to messsage.
|
||||
*/
|
||||
function PMA_warnMissingExtension($extension, $fatal = false, $extra = '')
|
||||
{
|
||||
$message = sprintf(__('Cannot load [a@http://php.net/%1$s@Documentation][em]%1$s[/em][/a] extension. Please check your PHP configuration.'), $extension);
|
||||
if ($extra != '') {
|
||||
$message .= ' ' . $extra;
|
||||
}
|
||||
if ($fatal) {
|
||||
PMA_fatalError($message);
|
||||
} else {
|
||||
trigger_error($message, E_USER_WARNING);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* returns count of tables in given db
|
||||
*
|
||||
|
Reference in New Issue
Block a user