Merge branch 'w16_MDL-45098_m26_mariaenv' of https://github.com/skodak/moodle into MOODLE_26_STABLE

This commit is contained in:
Damyon Wiese 2014-04-15 15:03:38 +08:00
commit 060c55b39a

View file

@ -74,6 +74,20 @@ class mariadb_native_moodle_database extends mysqli_native_moodle_database {
return 'mariadb'; return 'mariadb';
} }
/**
* Returns database server info array
* @return array Array containing 'description' and 'version' info
*/
public function get_server_info() {
$version = $this->mysqli->server_info;
$matches = null;
if (preg_match('/^5\.5\.5-(10\..+)-MariaDB/i', $version, $matches)) {
// Looks like MariaDB decided to use these weird version numbers for better BC with MySQL...
$version = $matches[1];
}
return array('description'=>$this->mysqli->server_info, 'version'=>$version);
}
/** /**
* It is time to require transactions everywhere. * It is time to require transactions everywhere.
* *