mirror of
https://github.com/vichan-devel/vichan.git
synced 2024-11-27 17:00:52 +01:00
make mysql_version actually useful for determining what to use
This commit is contained in:
parent
74c2aec338
commit
9dc3211079
@ -47,6 +47,17 @@ class PreparedQueryDebug {
|
||||
}
|
||||
}
|
||||
|
||||
// 5.6.10 becomes 50610
|
||||
function mysql_version() {
|
||||
global $pdo;
|
||||
|
||||
$version = $pdo->getAttribute(PDO::ATTR_SERVER_VERSION);
|
||||
$v = explode('.', $version);
|
||||
if (count($v) != 3)
|
||||
return false;
|
||||
return (int) sprintf("%02d%02d%02d", $v[0], $v[1], is_int($v[2]) ? (int)$v[2] : 0);
|
||||
}
|
||||
|
||||
function sql_open() {
|
||||
global $pdo, $config, $debug;
|
||||
if ($pdo)
|
||||
@ -95,17 +106,6 @@ function sql_open() {
|
||||
}
|
||||
}
|
||||
|
||||
// 5.6.10 becomes 50610
|
||||
function mysql_version() {
|
||||
global $pdo;
|
||||
|
||||
$version = $pdo->getAttribute(PDO::ATTR_SERVER_VERSION);
|
||||
$v = explode('.', $version);
|
||||
if (count($v) != 3)
|
||||
return false;
|
||||
return (int) sprintf("%02d%02d%02d", $v[0], $v[1], is_int($v[2]) ? (int)$v[2] : 0);
|
||||
}
|
||||
|
||||
function prepare($query) {
|
||||
global $pdo, $debug, $config;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user