| @@ 31-45 (lines=15) @@ | ||
| 28 | } | |
| 29 | ||
| 30 | // check the database collation if not specified in the configuration | |
| 31 | if ($upgradeable && (!isset ($database_connection_charset) || empty($database_connection_charset))) { | |
| 32 |     if (!$rs = mysqli_query($conn, "show session variables like 'collation_database'")) { | |
| 33 | $rs = mysqli_query($conn, "show session variables like 'collation_server'"); | |
| 34 | } | |
| 35 |     if ($rs && $collation = mysqli_fetch_row($rs)) { | |
| 36 | $database_collation = $collation[1]; | |
| 37 | } | |
| 38 |     if (empty ($database_collation)) { | |
| 39 | $database_collation = 'utf8_general_ci'; | |
| 40 | } | |
| 41 | $database_charset = substr($database_collation, 0, strpos($database_collation, '_')); | |
| 42 | $database_connection_charset = $database_charset; | |
| 43 | } else { | |
| 44 | $database_collation = 'utf8_general_ci'; | |
| 45 | } | |
| 46 | ||
| 47 | // determine the database connection method if not specified in the configuration | |
| 48 | if ($upgradeable && (!isset($database_connection_method) || empty($database_connection_method))) { | |
| @@ 218-230 (lines=13) @@ | ||
| 215 | } | |
| 216 | ||
| 217 | // check the database collation if not specified in the configuration | |
| 218 | if (!isset ($database_connection_charset) || empty ($database_connection_charset)) { | |
| 219 |     if (!$rs = mysqli_query($conn, "show session variables like 'collation_database'")) { | |
| 220 | $rs = mysqli_query($conn, "show session variables like 'collation_server'"); | |
| 221 | } | |
| 222 |     if ($rs && $collation = mysqli_fetch_row($rs)) { | |
| 223 | $database_collation = $collation[1]; | |
| 224 | } | |
| 225 |     if (empty ($database_collation)) { | |
| 226 | $database_collation = 'utf8_unicode_ci'; | |
| 227 | } | |
| 228 | $database_charset = substr($database_collation, 0, strpos($database_collation, '_') - 1); | |
| 229 | $database_connection_charset = $database_charset; | |
| 230 | } | |
| 231 | ||
| 232 | // determine the database connection method if not specified in the configuration | |
| 233 | if (!isset($database_connection_method) || empty($database_connection_method)) { | |