1
0
mirror of https://github.com/vichan-devel/vichan.git synced 2024-11-12 01:50:48 +01:00

make mysql_version actually useful for determining what to use

This commit is contained in:
Lorenzo Yario 2024-03-30 23:29:18 -07:00 committed by GitHub
parent 74c2aec338
commit 9dc3211079
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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() { function sql_open() {
global $pdo, $config, $debug; global $pdo, $config, $debug;
if ($pdo) 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) { function prepare($query) {
global $pdo, $debug, $config; global $pdo, $debug, $config;