Merged from MOODLE_15_STABLE: merging check_db_compat function for backwards compatability (just in case)

This commit is contained in:
mjollnir_ 2005-09-01 00:28:45 +00:00
parent 9ea9d69744
commit 3ec22e352c

View File

@ -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:
?>