| @@ 325-337 (lines=13) @@ | ||
| 322 | } |
|
| 323 | ||
| 324 | // check the database collation if not specified in the configuration |
|
| 325 | if (!isset ($database_connection_charset) || empty ($database_connection_charset)) { |
|
| 326 | if (!$rs = mysqli_query($conn, "show session variables like 'collation_database'")) { |
|
| 327 | $rs = mysqli_query($conn, "show session variables like 'collation_server'"); |
|
| 328 | } |
|
| 329 | if ($rs && $collation = mysqli_fetch_row($rs)) { |
|
| 330 | $database_collation = $collation[1]; |
|
| 331 | } |
|
| 332 | if (empty ($database_collation)) { |
|
| 333 | $database_collation = 'utf8_unicode_ci'; |
|
| 334 | } |
|
| 335 | $database_charset = substr($database_collation, 0, strpos($database_collation, '_') - 1); |
|
| 336 | $database_connection_charset = $database_charset; |
|
| 337 | } |
|
| 338 | ||
| 339 | // determine the database connection method if not specified in the configuration |
|
| 340 | if (!isset($database_connection_method) || empty($database_connection_method)) { |
|
| @@ 36-50 (lines=15) @@ | ||
| 33 | } |
|
| 34 | ||
| 35 | // check the database collation if not specified in the configuration |
|
| 36 | if ($upgradeable && (! isset($database_connection_charset) || empty($database_connection_charset))) { |
|
| 37 | if (!$rs = mysqli_query($conn, "show session variables like 'collation_database'")) { |
|
| 38 | $rs = mysqli_query($conn, "show session variables like 'collation_server'"); |
|
| 39 | } |
|
| 40 | if ($rs && $collation = mysqli_fetch_row($rs)) { |
|
| 41 | $database_collation = $collation[1]; |
|
| 42 | } |
|
| 43 | if (empty($database_collation)) { |
|
| 44 | $database_collation = 'utf8_general_ci'; |
|
| 45 | } |
|
| 46 | $database_charset = substr($database_collation, 0, strpos($database_collation, '_')); |
|
| 47 | $database_connection_charset = $database_charset; |
|
| 48 | } else { |
|
| 49 | $database_collation = 'utf8_general_ci'; |
|
| 50 | } |
|
| 51 | ||
| 52 | // determine the database connection method if not specified in the configuration |
|
| 53 | 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)) { |
|