mirror of
https://github.com/moodle/moodle.git
synced 2025-04-17 14:35:29 +02:00
Merged from MOODLE_15_STABLE: merging check_db_compat function for backwards compatability (just in case)
This commit is contained in:
parent
9ea9d69744
commit
3ec22e352c
@ -2987,5 +2987,27 @@ function sql_isnull($fieldname) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks for pg or mysql > 4
|
||||
*/
|
||||
|
||||
function check_db_compat() {
|
||||
global $CFG,$db;
|
||||
|
||||
if ($CFG->dbtype == 'postgres7') {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!$rs = $db->Execute("SELECT version();")) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (intval($rs->fields[0]) <= 3) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// vim:autoindent:expandtab:shiftwidth=4:tabstop=4:tw=140:
|
||||
?>
|
||||
|
Loading…
x
Reference in New Issue
Block a user