| @@ 326-338 (lines=13) @@ | ||
| 323 | } |
|
| 324 | ||
| 325 | // check the database collation if not specified in the configuration |
|
| 326 | if (!isset ($database_connection_charset) || empty ($database_connection_charset)) { |
|
| 327 | if (!$rs = mysqli_query($conn, "show session variables like 'collation_database'")) { |
|
| 328 | $rs = mysqli_query($conn, "show session variables like 'collation_server'"); |
|
| 329 | } |
|
| 330 | if ($rs && $collation = mysqli_fetch_row($rs)) { |
|
| 331 | $database_collation = $collation[1]; |
|
| 332 | } |
|
| 333 | if (empty ($database_collation)) { |
|
| 334 | $database_collation = 'utf8_unicode_ci'; |
|
| 335 | } |
|
| 336 | $database_charset = substr($database_collation, 0, strpos($database_collation, '_') - 1); |
|
| 337 | $database_connection_charset = $database_charset; |
|
| 338 | } |
|
| 339 | ||
| 340 | // determine the database connection method if not specified in the configuration |
|
| 341 | if (!isset($database_connection_method) || empty($database_connection_method)) { |
|
| @@ 37-51 (lines=15) @@ | ||
| 34 | } |
|
| 35 | ||
| 36 | // check the database collation if not specified in the configuration |
|
| 37 | if ($upgradeable && (! isset($database_connection_charset) || empty($database_connection_charset))) { |
|
| 38 | if (!$rs = mysqli_query($conn, "show session variables like 'collation_database'")) { |
|
| 39 | $rs = mysqli_query($conn, "show session variables like 'collation_server'"); |
|
| 40 | } |
|
| 41 | if ($rs && $collation = mysqli_fetch_row($rs)) { |
|
| 42 | $database_collation = $collation[1]; |
|
| 43 | } |
|
| 44 | if (empty($database_collation)) { |
|
| 45 | $database_collation = 'utf8mb4_general_ci'; |
|
| 46 | } |
|
| 47 | $database_charset = substr($database_collation, 0, strpos($database_collation, '_')); |
|
| 48 | $database_connection_charset = $database_charset; |
|
| 49 | } else { |
|
| 50 | $database_collation = 'utf8mb4_general_ci'; |
|
| 51 | } |
|
| 52 | ||
| 53 | // determine the database connection method if not specified in the configuration |
|
| 54 | if ($upgradeable && (!isset($database_connection_method) || empty($database_connection_method))) { |
|
| @@ 219-231 (lines=13) @@ | ||
| 216 | } |
|
| 217 | ||
| 218 | // check the database collation if not specified in the configuration |
|
| 219 | if (!isset ($database_connection_charset) || empty ($database_connection_charset)) { |
|
| 220 | if (!$rs = mysqli_query($conn, "show session variables like 'collation_database'")) { |
|
| 221 | $rs = mysqli_query($conn, "show session variables like 'collation_server'"); |
|
| 222 | } |
|
| 223 | if ($rs && $collation = mysqli_fetch_row($rs)) { |
|
| 224 | $database_collation = $collation[1]; |
|
| 225 | } |
|
| 226 | if (empty ($database_collation)) { |
|
| 227 | $database_collation = 'utf8_unicode_ci'; |
|
| 228 | } |
|
| 229 | $database_charset = substr($database_collation, 0, strpos($database_collation, '_') - 1); |
|
| 230 | $database_connection_charset = $database_charset; |
|
| 231 | } |
|
| 232 | ||
| 233 | // determine the database connection method if not specified in the configuration |
|
| 234 | if (!isset($database_connection_method) || empty($database_connection_method)) { |
|