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"

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@111868 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sean Harvey 2010-10-11 04:32:18 +00:00 committed by Sam Minnee
parent 80caa74d9d
commit 14d9011658

View File

@ -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);
}
/**