| @@ 37-67 (lines=31) @@ | ||
| 34 | global $smcFunc; |
|
| 35 | ||
| 36 | // Map some database specific functions, only do this once. |
|
| 37 | if (!isset($smcFunc['db_fetch_assoc'])) |
|
| 38 | $smcFunc += array( |
|
| 39 | 'db_query' => 'smf_db_query', |
|
| 40 | 'db_quote' => 'smf_db_quote', |
|
| 41 | 'db_insert' => 'smf_db_insert', |
|
| 42 | 'db_insert_id' => 'smf_db_insert_id', |
|
| 43 | 'db_fetch_assoc' => 'smf_db_fetch_assoc', |
|
| 44 | 'db_fetch_row' => 'smf_db_fetch_row', |
|
| 45 | 'db_free_result' => 'pg_free_result', |
|
| 46 | 'db_num_rows' => 'pg_num_rows', |
|
| 47 | 'db_data_seek' => 'smf_db_data_seek', |
|
| 48 | 'db_num_fields' => 'pg_num_fields', |
|
| 49 | 'db_escape_string' => 'pg_escape_string', |
|
| 50 | 'db_unescape_string' => 'smf_db_unescape_string', |
|
| 51 | 'db_server_info' => 'smf_db_version', |
|
| 52 | 'db_affected_rows' => 'smf_db_affected_rows', |
|
| 53 | 'db_transaction' => 'smf_db_transaction', |
|
| 54 | 'db_error' => 'pg_last_error', |
|
| 55 | 'db_select_db' => 'smf_db_select_db', |
|
| 56 | 'db_title' => 'PostgreSQL', |
|
| 57 | 'db_sybase' => true, |
|
| 58 | 'db_case_sensitive' => true, |
|
| 59 | 'db_escape_wildcard_string' => 'smf_db_escape_wildcard_string', |
|
| 60 | 'db_is_resource' => 'is_resource', |
|
| 61 | 'db_mb4' => true, |
|
| 62 | 'db_ping' => 'pg_ping', |
|
| 63 | 'db_fetch_all' => 'smf_db_fetch_all', |
|
| 64 | 'db_error_insert' => 'smf_db_error_insert', |
|
| 65 | 'db_custom_order' => 'smf_db_custom_order', |
|
| 66 | 'db_native_replace' => 'smf_db_native_replace', |
|
| 67 | ); |
|
| 68 | ||
| 69 | if (!empty($db_options['persist'])) |
|
| 70 | $connection = @pg_pconnect((empty($db_server) ? '' : 'host=' . $db_server . ' ') . 'dbname=' . $db_name . ' user=\'' . $db_user . '\' password=\'' . $db_passwd . '\'' . (empty($db_options['port']) ? '' : ' port=\'' . $db_options['port'] . '\'')); |
|
| @@ 36-66 (lines=31) @@ | ||
| 33 | global $smcFunc; |
|
| 34 | ||
| 35 | // Map some database specific functions, only do this once. |
|
| 36 | if (!isset($smcFunc['db_fetch_assoc'])) |
|
| 37 | $smcFunc += array( |
|
| 38 | 'db_query' => 'smf_db_query', |
|
| 39 | 'db_quote' => 'smf_db_quote', |
|
| 40 | 'db_fetch_assoc' => 'mysqli_fetch_assoc', |
|
| 41 | 'db_fetch_row' => 'mysqli_fetch_row', |
|
| 42 | 'db_free_result' => 'mysqli_free_result', |
|
| 43 | 'db_insert' => 'smf_db_insert', |
|
| 44 | 'db_insert_id' => 'smf_db_insert_id', |
|
| 45 | 'db_num_rows' => 'mysqli_num_rows', |
|
| 46 | 'db_data_seek' => 'mysqli_data_seek', |
|
| 47 | 'db_num_fields' => 'mysqli_num_fields', |
|
| 48 | 'db_escape_string' => 'addslashes', |
|
| 49 | 'db_unescape_string' => 'stripslashes', |
|
| 50 | 'db_server_info' => 'smf_db_get_server_info', |
|
| 51 | 'db_affected_rows' => 'smf_db_affected_rows', |
|
| 52 | 'db_transaction' => 'smf_db_transaction', |
|
| 53 | 'db_error' => 'mysqli_error', |
|
| 54 | 'db_select_db' => 'smf_db_select', |
|
| 55 | 'db_title' => 'MySQLi', |
|
| 56 | 'db_sybase' => false, |
|
| 57 | 'db_case_sensitive' => false, |
|
| 58 | 'db_escape_wildcard_string' => 'smf_db_escape_wildcard_string', |
|
| 59 | 'db_is_resource' => 'smf_is_resource', |
|
| 60 | 'db_mb4' => false, |
|
| 61 | 'db_ping' => 'mysqli_ping', |
|
| 62 | 'db_fetch_all' => 'smf_db_fetch_all', |
|
| 63 | 'db_error_insert' => 'smf_db_error_insert', |
|
| 64 | 'db_custom_order' => 'smf_db_custom_order', |
|
| 65 | 'db_native_replace' => 'smf_db_native_replace', |
|
| 66 | ); |
|
| 67 | ||
| 68 | if (!empty($db_options['persist'])) |
|
| 69 | $db_server = 'p:' . $db_server; |
|