diff options
| author | Meik Sievertsen <acydburn@phpbb.com> | 2006-10-14 14:56:46 +0000 |
|---|---|---|
| committer | Meik Sievertsen <acydburn@phpbb.com> | 2006-10-14 14:56:46 +0000 |
| commit | 4afaca12dc55b076293e9ef8ac28332d22730df0 (patch) | |
| tree | 944b15618d8a0bed05fafb942e27322a739b2d3d /phpBB/includes/acp/acp_database.php | |
| parent | 46922674ea1b5ecf96d14c0edfdbcf6af3743051 (diff) | |
| download | forums-4afaca12dc55b076293e9ef8ac28332d22730df0.tar forums-4afaca12dc55b076293e9ef8ac28332d22730df0.tar.gz forums-4afaca12dc55b076293e9ef8ac28332d22730df0.tar.bz2 forums-4afaca12dc55b076293e9ef8ac28332d22730df0.tar.xz forums-4afaca12dc55b076293e9ef8ac28332d22730df0.zip | |
- store sql_layer directly within the layer itself
- new method sql_multi_insert to circumvent db-specific hacks
(hopefully not introduced any parsing errors)
git-svn-id: file:///svn/phpbb/trunk@6497 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/acp/acp_database.php')
| -rw-r--r-- | phpBB/includes/acp/acp_database.php | 39 |
1 files changed, 12 insertions, 27 deletions
diff --git a/phpBB/includes/acp/acp_database.php b/phpBB/includes/acp/acp_database.php index d4d4cf89b1..ccb1460c8a 100644 --- a/phpBB/includes/acp/acp_database.php +++ b/phpBB/includes/acp/acp_database.php @@ -133,7 +133,7 @@ class acp_database $sql_data .= "# DATE : " . gmdate("d-m-Y H:i:s", $time) . " GMT\n"; $sql_data .= "#\n"; - switch (SQL_LAYER) + switch ($db->sql_layer) { case 'sqlite': $sql_data .= "BEGIN TRANSACTION;\n"; @@ -151,7 +151,7 @@ class acp_database break; } - if ($structure && SQL_LAYER == 'firebird') + if ($structure && $db->sql_layer == 'firebird') { $sql = 'SELECT RDB$FUNCTION_NAME, RDB$DESCRIPTION FROM RDB$FUNCTIONS @@ -181,7 +181,7 @@ class acp_database // Get the table structure if ($structure) { - switch (SQL_LAYER) + switch ($db->sql_layer) { case 'mysqli': case 'mysql4': @@ -224,27 +224,12 @@ class acp_database } $sql_data .= $this->get_table_structure($table_name); } - // We might wanna empty out all that junk :D else { - switch (SQL_LAYER) - { - case 'mysqli': - case 'mysql4': - case 'mysql': - case 'mssql': - case 'mssql_odbc': - case 'oracle': - case 'postgres': - case 'firebird': - $sql_data .= 'TRUNCATE TABLE ' . $table_name . ";\n"; - break; - - case 'sqlite': - $sql_data .= 'DELETE FROM ' . $table_name . ";\n"; - break; - } + // We might wanna empty out all that junk :D + $sql_data .= (($db->sql_layer == 'sqlite') ? 'DELETE FROM ' : 'TRUNCATE TABLE ') . $table_name . ";\n"; } + // Now write the data for the first time. :) if ($store == true) { @@ -270,7 +255,7 @@ class acp_database { $sql_data .= "\n"; - switch (SQL_LAYER) + switch ($db->sql_layer) { case 'mysqli': @@ -1016,7 +1001,7 @@ class acp_database } } - switch (SQL_LAYER) + switch ($db->sql_layer) { case 'sqlite': case 'postgres': @@ -1056,7 +1041,7 @@ class acp_database default: $tables = array(); - switch (SQL_LAYER) + switch ($db->sql_layer) { case 'sqlite': $sql = "SELECT name @@ -1247,13 +1232,13 @@ class acp_database remove_remarks($data); // SQLite gets improved performance when you shove all of these disk write queries at once :D - if (SQL_LAYER == 'sqlite') + if ($db->sql_layer == 'sqlite') { $db->sql_query($data); } else { - switch (SQL_LAYER) + switch ($db->sql_layer) { case 'firebird': $delim = ';;'; @@ -1351,7 +1336,7 @@ class acp_database $sql_data = ''; - switch (SQL_LAYER) + switch ($db->sql_layer) { case 'mysqli': case 'mysql4': |
