diff options
| author | David M <davidmj@users.sourceforge.net> | 2008-01-06 02:21:44 +0000 |
|---|---|---|
| committer | David M <davidmj@users.sourceforge.net> | 2008-01-06 02:21:44 +0000 |
| commit | 57645ad5bc2469e166cb3e5d54628d87ffa74c42 (patch) | |
| tree | 2b7e47b0a2d4d07b8b1c3acbab5115d7b60ce606 /phpBB/includes/acp | |
| parent | f0dea060972a48460ce64d3cdf885d82383763c6 (diff) | |
| download | forums-57645ad5bc2469e166cb3e5d54628d87ffa74c42.tar forums-57645ad5bc2469e166cb3e5d54628d87ffa74c42.tar.gz forums-57645ad5bc2469e166cb3e5d54628d87ffa74c42.tar.bz2 forums-57645ad5bc2469e166cb3e5d54628d87ffa74c42.tar.xz forums-57645ad5bc2469e166cb3e5d54628d87ffa74c42.zip | |
the end of an era...
- MySQL < 4.1.3 support is removed
- renamed mysql4 to mysql, no need to cause confusion
- changed the cfg cacher, reduces file system lookups and include count by two on every page load
git-svn-id: file:///svn/phpbb/trunk@8307 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/acp')
| -rw-r--r-- | phpBB/includes/acp/acp_database.php | 137 | ||||
| -rw-r--r-- | phpBB/includes/acp/acp_forums.php | 2 | ||||
| -rw-r--r-- | phpBB/includes/acp/acp_profile.php | 1 | ||||
| -rw-r--r-- | phpBB/includes/acp/acp_styles.php | 3 | ||||
| -rw-r--r-- | phpBB/includes/acp/acp_users.php | 1 |
5 files changed, 10 insertions, 134 deletions
diff --git a/phpBB/includes/acp/acp_database.php b/phpBB/includes/acp/acp_database.php index a54230039d..d7ce8db8b3 100644 --- a/phpBB/includes/acp/acp_database.php +++ b/phpBB/includes/acp/acp_database.php @@ -89,7 +89,6 @@ class acp_database switch ($db->sql_layer) { case 'mysqli': - case 'mysql4': case 'mysql': $extractor = new mysql_extractor($download, $store, $format, $filename, $time); break; @@ -317,7 +316,6 @@ class acp_database switch ($db->sql_layer) { case 'mysql': - case 'mysql4': case 'mysqli': case 'sqlite': while (($sql = $fgetd($fp, ";\n", $read, $seek, $eof)) !== false) @@ -592,28 +590,16 @@ class mysql_extractor extends base_extractor function write_table($table_name) { global $db; - static $new_extract; - if ($new_extract === null) - { - if ($db->sql_layer === 'mysqli' || version_compare($db->mysql_version, '3.23.20', '>=')) - { - $new_extract = true; - } - else - { - $new_extract = false; - } - } + $sql = 'SHOW CREATE TABLE ' . $table_name; + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); - if ($new_extract) - { - $this->new_write_table($table_name); - } - else - { - $this->old_write_table($table_name); - } + $sql_data = '# Table: ' . $table_name . "\n"; + $sql_data .= "DROP TABLE IF EXISTS $table_name;\n"; + $this->flush($sql_data . $row['Create Table'] . ";\n\n"); + + $db->sql_freeresult($result); } function write_data($table_name) @@ -791,113 +777,6 @@ class mysql_extractor extends base_extractor } } } - - function new_write_table($table_name) - { - global $db; - - $sql = 'SHOW CREATE TABLE ' . $table_name; - $result = $db->sql_query($sql); - $row = $db->sql_fetchrow($result); - - $sql_data = '# Table: ' . $table_name . "\n"; - $sql_data .= "DROP TABLE IF EXISTS $table_name;\n"; - $this->flush($sql_data . $row['Create Table'] . ";\n\n"); - - $db->sql_freeresult($result); - } - - function old_write_table($table_name) - { - global $db; - - $sql_data = '# Table: ' . $table_name . "\n"; - $sql_data .= "DROP TABLE IF EXISTS $table_name;\n"; - $sql_data .= "CREATE TABLE $table_name(\n"; - $rows = array(); - - $sql = "SHOW FIELDS - FROM $table_name"; - $result = $db->sql_query($sql); - - while ($row = $db->sql_fetchrow($result)) - { - $line = ' ' . $row['Field'] . ' ' . $row['Type']; - - if (!is_null($row['Default'])) - { - $line .= " DEFAULT '{$row['Default']}'"; - } - - if ($row['Null'] != 'YES') - { - $line .= ' NOT NULL'; - } - - if ($row['Extra'] != '') - { - $line .= ' ' . $row['Extra']; - } - - $rows[] = $line; - } - $db->sql_freeresult($result); - - $sql = "SHOW KEYS - FROM $table_name"; - - $result = $db->sql_query($sql); - - $index = array(); - while ($row = $db->sql_fetchrow($result)) - { - $kname = $row['Key_name']; - - if ($kname != 'PRIMARY') - { - if ($row['Non_unique'] == 0) - { - $kname = "UNIQUE|$kname"; - } - } - - if ($row['Sub_part']) - { - $row['Column_name'] .= '(' . $row['Sub_part'] . ')'; - } - $index[$kname][] = $row['Column_name']; - } - $db->sql_freeresult($result); - - foreach ($index as $key => $columns) - { - $line = ' '; - - if ($key == 'PRIMARY') - { - $line .= 'PRIMARY KEY (' . implode(', ', $columns) . ')'; - } - else if (strpos($key, 'UNIQUE') === 0) - { - $line .= 'UNIQUE ' . substr($key, 7) . ' (' . implode(', ', $columns) . ')'; - } - else if (strpos($key, 'FULLTEXT') === 0) - { - $line .= 'FULLTEXT ' . substr($key, 9) . ' (' . implode(', ', $columns) . ')'; - } - else - { - $line .= "KEY $key (" . implode(', ', $columns) . ')'; - } - - $rows[] = $line; - } - - $sql_data .= implode(",\n", $rows); - $sql_data .= "\n);\n\n"; - - $this->flush($sql_data); - } } /** diff --git a/phpBB/includes/acp/acp_forums.php b/phpBB/includes/acp/acp_forums.php index bb8f437b80..faf3b7b296 100644 --- a/phpBB/includes/acp/acp_forums.php +++ b/phpBB/includes/acp/acp_forums.php @@ -1649,7 +1649,7 @@ class acp_forums switch ($db->sql_layer) { - case 'mysql4': + case 'mysql': case 'mysqli': // Delete everything else and thank MySQL for offering multi-table deletion diff --git a/phpBB/includes/acp/acp_profile.php b/phpBB/includes/acp/acp_profile.php index 25689a972c..2a9c0e8c19 100644 --- a/phpBB/includes/acp/acp_profile.php +++ b/phpBB/includes/acp/acp_profile.php @@ -1351,7 +1351,6 @@ class acp_profile switch ($db->sql_layer) { case 'mysql': - case 'mysql4': case 'mysqli': // We are defining the biggest common value, because of the possibility to edit the min/max values of each field. diff --git a/phpBB/includes/acp/acp_styles.php b/phpBB/includes/acp/acp_styles.php index 3fec4fc2ff..74812efd84 100644 --- a/phpBB/includes/acp/acp_styles.php +++ b/phpBB/includes/acp/acp_styles.php @@ -1782,8 +1782,7 @@ parse_css_file = {PARSE_CSS_FILE} $theme_cfg = str_replace(array('{MODE}', '{NAME}', '{COPYRIGHT}', '{VERSION}'), array($mode, $style_row['theme_name'], $style_row['theme_copyright'], $config['version']), $this->theme_cfg); // Read old cfg file - $items = cache::obtain_cfg_items($style_row); - $items = $items['theme']; + $items = cache::obtain_cfg_item($style_row, 'theme'); if (!isset($items['parse_css_file'])) { diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php index 252fb743cd..f87e175301 100644 --- a/phpBB/includes/acp/acp_users.php +++ b/phpBB/includes/acp/acp_users.php @@ -1141,7 +1141,6 @@ class acp_users break; case 'mysql': - case 'mysql4': case 'mysqli': $right_delim = $left_delim = '`'; break; |
