| @@ 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)) { |
|
| @@ 278-290 (lines=13) @@ | ||
| 275 | } |
|
| 276 | ||
| 277 | // check the database collation if not specified in the configuration |
|
| 278 | if (!isset ($database_connection_charset) || empty ($database_connection_charset)) { |
|
| 279 | if (!$rs = mysqli_query($conn, "show session variables like 'collation_database'")) { |
|
| 280 | $rs = mysqli_query($conn, "show session variables like 'collation_server'"); |
|
| 281 | } |
|
| 282 | if ($rs && $collation = mysqli_fetch_row($rs)) { |
|
| 283 | $database_collation = $collation[1]; |
|
| 284 | } |
|
| 285 | if (empty ($database_collation)) { |
|
| 286 | $database_collation = 'utf8_unicode_ci'; |
|
| 287 | } |
|
| 288 | $database_charset = substr($database_collation, 0, strpos($database_collation, '_') - 1); |
|
| 289 | $database_connection_charset = $database_charset; |
|
| 290 | } |
|
| 291 | ||
| 292 | // determine the database connection method if not specified in the configuration |
|
| 293 | if (!isset($database_connection_method) || empty($database_connection_method)) { |
|