mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
ENHANCEMENT MySQLDatabase::getVersion() now uses mysql_get_server_info() which has been supported since PHP 4. This gives us a better version than say "5.1", instead we now get something like "5.1.51" (from r111868)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@112933 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
429434811f
commit
e2cb7001ce
@ -88,21 +88,12 @@ class MySQLDatabase extends SS_Database {
|
||||
return $this->getVersion() >= 4.1;
|
||||
}
|
||||
|
||||
/**
|
||||
* The version of MySQL.
|
||||
* @var float
|
||||
*/
|
||||
private $mysqlVersion;
|
||||
|
||||
/**
|
||||
* Get the version of MySQL.
|
||||
* @return float
|
||||
* @return string
|
||||
*/
|
||||
public function getVersion() {
|
||||
if(!$this->mysqlVersion) {
|
||||
$this->mysqlVersion = (float)substr(trim(ereg_replace("([A-Za-z-])", "", $this->query("SELECT VERSION()")->value())), 0, 3);
|
||||
}
|
||||
return $this->mysqlVersion;
|
||||
return mysql_get_server_info($this->dbConn);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user