From 12a9e001837da139a9ea07b8dd52019ee071d9bd Mon Sep 17 00:00:00 2001
From: Meik Sievertsen
Date: Sun, 6 Jan 2008 17:00:09 +0000
Subject: - Do not split topic list for topics being promoted to announcements
after been moved to another forum (Bug #18635) - Allow editing usernames
within database_update on username cleanup (Bug #18415) - Fixing wrong sync()
calls if moving all posts by a member in ACP (Bug #18385) - Check entered
imagemagick path for trailing slash (Bug #18205) - Use proper title on index
for new/unread posts (Bug #13101) - patch provided by Pyramide - Allow calls
to $user->set_cookie() define no cookie time for setting session cookies (Bug
#18025)
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8310 89ea8834-ac86-4346-8a33-228a782c2dd0
---
phpBB/install/database_update.php | 3 +++
1 file changed, 3 insertions(+)
(limited to 'phpBB/install/database_update.php')
diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php
index fc9ce65dac..990591e8a4 100644
--- a/phpBB/install/database_update.php
+++ b/phpBB/install/database_update.php
@@ -616,6 +616,9 @@ if (version_compare($current_version, '3.0.RC8', '<='))
$modify_users = request_var('modify_users', array(0 => ''));
$new_usernames = request_var('new_usernames', array(0 => ''), true);
+ // We need this file if someone wants to edit usernames.
+ include($phpbb_root_path . 'includes/utf/utf_normalizer.' . $phpEx);
+
if (!class_exists('utf_new_normalizer'))
{
if (!file_exists($phpbb_root_path . 'install/data/new_normalizer.' . $phpEx))
--
cgit v1.2.1
From cc24876726854e2e799651b1d7e40e54a2c0375b Mon Sep 17 00:00:00 2001
From: Nils Adermann
Date: Sun, 3 Feb 2008 22:55:10 +0000
Subject: merging r8373 into 3.0 branch: adding a new option to hide the entire
list of subforums on listforums
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8374 89ea8834-ac86-4346-8a33-228a782c2dd0
---
phpBB/install/database_update.php | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
(limited to 'phpBB/install/database_update.php')
diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php
index 990591e8a4..a4d6c46695 100644
--- a/phpBB/install/database_update.php
+++ b/phpBB/install/database_update.php
@@ -10,7 +10,7 @@
$updates_to_version = '3.0.0';
-// Return if we "just include it" to find out for which version the database update is responsuble for
+// Return if we "just include it" to find out for which version the database update is responsible for
if (defined('IN_PHPBB') && defined('IN_INSTALL'))
{
return;
@@ -473,6 +473,15 @@ $database_update_info = array(
),
),
),
+ // Changes from 3.0.0 to the next version
+ '3.0.0' => array(
+ // Add the following columns
+ 'add_columns' => array(
+ FORUMS_TABLE => array(
+ 'display_subforum_list' => array('BOOL', 1),
+ ),
+ ),
+ ),
);
// Determine mapping database type
--
cgit v1.2.1
From d7c5f502b4e0ef87a1d4a8d9a4fc16c79b3a5dc1 Mon Sep 17 00:00:00 2001
From: Henry Sudhof
Date: Wed, 13 Feb 2008 16:28:37 +0000
Subject: Fixing converter bugs. #21215 #18575 #18435 #16565
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8379 89ea8834-ac86-4346-8a33-228a782c2dd0
---
phpBB/install/database_update.php | 10 ++++++++++
1 file changed, 10 insertions(+)
(limited to 'phpBB/install/database_update.php')
diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php
index a4d6c46695..899384fb41 100644
--- a/phpBB/install/database_update.php
+++ b/phpBB/install/database_update.php
@@ -1559,6 +1559,16 @@ if (version_compare($current_version, '3.0.RC5', '<='))
$no_updates = false;
}
+
+if (version_compare($current_version, '3.0.0', '<='))
+{
+ $sql = 'UPDATE ' . TOPICS_TABLE . "
+ SET topic_last_view_time = topic_last_post_time
+ WHERE topic_last_view_time = 0";
+ _sql($sql, $errored, $error_ary);
+
+ // TODO: remove all form token min times
+}
_write_result($no_updates, $errored, $error_ary);
$error_ary = array();
--
cgit v1.2.1
From 9e55e1738874a0ab352f91a15012b33fe1c3e9f9 Mon Sep 17 00:00:00 2001
From: Meik Sievertsen
Date: Fri, 15 Feb 2008 19:10:02 +0000
Subject: revamp how we query permissions. This is half-experimental actually,
needs a bit of testing. Should fix the bug with low max_join_size values, but
may give problems for those on very low memory settings.
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8384 89ea8834-ac86-4346-8a33-228a782c2dd0
---
phpBB/install/database_update.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'phpBB/install/database_update.php')
diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php
index 899384fb41..7eeca7dbb8 100644
--- a/phpBB/install/database_update.php
+++ b/phpBB/install/database_update.php
@@ -8,7 +8,7 @@
*
*/
-$updates_to_version = '3.0.0';
+$updates_to_version = '3.0.1-dev';
// Return if we "just include it" to find out for which version the database update is responsible for
if (defined('IN_PHPBB') && defined('IN_INSTALL'))
--
cgit v1.2.1
From a7ad9b5ae2e145a88d2acb0917162a3973337530 Mon Sep 17 00:00:00 2001
From: Vic D'Elfant
Date: Sun, 24 Feb 2008 14:38:35 +0000
Subject: #22035
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8395 89ea8834-ac86-4346-8a33-228a782c2dd0
---
phpBB/install/database_update.php | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
(limited to 'phpBB/install/database_update.php')
diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php
index 7eeca7dbb8..73e4ad548c 100644
--- a/phpBB/install/database_update.php
+++ b/phpBB/install/database_update.php
@@ -1567,7 +1567,25 @@ if (version_compare($current_version, '3.0.0', '<='))
WHERE topic_last_view_time = 0";
_sql($sql, $errored, $error_ary);
+ // Update smiley sizes
+ $smileys = array('icon_e_surprised.gif','icon_cool.gif', 'icon_lol.gif', 'icon_mad.gif', 'icon_razz.gif', 'icon_redface.gif', 'icon_cry.gif', 'icon_evil.gif', 'icon_twisted.gif', 'icon_rolleyes.gif', 'icon_exclaim.gif', 'icon_question.gif', 'icon_idea.gif', 'icon_arrow.gif', 'icon_neutral.gif', 'icon_mrgreen.gif', 'icon_e_ugeek.gif');
+ foreach ($smileys as $smiley)
+ {
+ if (file_exists($phpbb_root_path . 'images/smilies/' . $smiley))
+ {
+ list($width, $height) = getimagesize($phpbb_root_path . 'images/smilies/' . $smiley);
+
+ $sql = 'UPDATE ' . SMILIES_TABLE . '
+ SET smiley_width = ' . $width . ', smiley_height = ' . $height . "
+ WHERE smiley_url = '" . $db->sql_escape($smiley) . "'";
+
+ _sql($sql, $errored, $error_ary);
+ }
+ }
+
// TODO: remove all form token min times
+
+ $no_updates = false;
}
_write_result($no_updates, $errored, $error_ary);
--
cgit v1.2.1
From dfa5cd59eba5def37cba02437da08fea162a9bcc Mon Sep 17 00:00:00 2001
From: Vic D'Elfant
Date: Thu, 28 Feb 2008 07:42:06 +0000
Subject: #22285
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8417 89ea8834-ac86-4346-8a33-228a782c2dd0
---
phpBB/install/database_update.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'phpBB/install/database_update.php')
diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php
index 73e4ad548c..85627b9327 100644
--- a/phpBB/install/database_update.php
+++ b/phpBB/install/database_update.php
@@ -1568,7 +1568,7 @@ if (version_compare($current_version, '3.0.0', '<='))
_sql($sql, $errored, $error_ary);
// Update smiley sizes
- $smileys = array('icon_e_surprised.gif','icon_cool.gif', 'icon_lol.gif', 'icon_mad.gif', 'icon_razz.gif', 'icon_redface.gif', 'icon_cry.gif', 'icon_evil.gif', 'icon_twisted.gif', 'icon_rolleyes.gif', 'icon_exclaim.gif', 'icon_question.gif', 'icon_idea.gif', 'icon_arrow.gif', 'icon_neutral.gif', 'icon_mrgreen.gif', 'icon_e_ugeek.gif');
+ $smileys = array('icon_e_surprised.gif', 'icon_eek.gif', 'icon_cool.gif', 'icon_lol.gif', 'icon_mad.gif', 'icon_razz.gif', 'icon_redface.gif', 'icon_cry.gif', 'icon_evil.gif', 'icon_twisted.gif', 'icon_rolleyes.gif', 'icon_exclaim.gif', 'icon_question.gif', 'icon_idea.gif', 'icon_arrow.gif', 'icon_neutral.gif', 'icon_mrgreen.gif', 'icon_e_ugeek.gif');
foreach ($smileys as $smiley)
{
if (file_exists($phpbb_root_path . 'images/smilies/' . $smiley))
--
cgit v1.2.1
From b7ef95ed091580df66da23fc1bca403758645fc3 Mon Sep 17 00:00:00 2001
From: Henry Sudhof
Date: Mon, 17 Mar 2008 16:25:07 +0000
Subject: This should get rid of the filesorts and temp tables on index (with
topic read tracking as exception). Updater still needs testing. Not yet
merged to 3.1 #22715 - thanks HoL
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8436 89ea8834-ac86-4346-8a33-228a782c2dd0
---
phpBB/install/database_update.php | 14 ++++++++++++++
1 file changed, 14 insertions(+)
(limited to 'phpBB/install/database_update.php')
diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php
index 85627b9327..39e0d8131e 100644
--- a/phpBB/install/database_update.php
+++ b/phpBB/install/database_update.php
@@ -480,6 +480,20 @@ $database_update_info = array(
FORUMS_TABLE => array(
'display_subforum_list' => array('BOOL', 1),
),
+ SESSIONS_TABLE => array(
+ 'session_forum_id' => array('UINT', 0),
+ ),
+ ),
+ 'add_index' => array(
+ SESSIONS_TABLE => array(
+ 'session_forum_id' => 'session_forum_id',
+ ),
+ GROUP_TABLE => array(
+ 'group_legend_name' => array('group_legend', 'group_name'),
+ ),
+ ),
+ 'drop_keys' => array(
+ GROUP_TABLE => array('group_legend'),
),
),
);
--
cgit v1.2.1
From 221001a6dc86c7cd9246b6614adb24c1d88c0067 Mon Sep 17 00:00:00 2001
From: Meik Sievertsen
Date: Tue, 18 Mar 2008 10:14:37 +0000
Subject: - some changes to the recent session change - display errors on
inserting sessions - fix database updater
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8438 89ea8834-ac86-4346-8a33-228a782c2dd0
---
phpBB/install/database_update.php | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
(limited to 'phpBB/install/database_update.php')
diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php
index 39e0d8131e..856640b58b 100644
--- a/phpBB/install/database_update.php
+++ b/phpBB/install/database_update.php
@@ -486,14 +486,14 @@ $database_update_info = array(
),
'add_index' => array(
SESSIONS_TABLE => array(
- 'session_forum_id' => 'session_forum_id',
+ 'session_forum_id' => array('session_forum_id'),
),
- GROUP_TABLE => array(
+ GROUPS_TABLE => array(
'group_legend_name' => array('group_legend', 'group_name'),
),
),
'drop_keys' => array(
- GROUP_TABLE => array('group_legend'),
+ GROUPS_TABLE => array('group_legend'),
),
),
);
--
cgit v1.2.1
From 45673658a10cb8493801b96ceecab3acccda3e5d Mon Sep 17 00:00:00 2001
From: Meik Sievertsen
Date: Sun, 23 Mar 2008 18:40:06 +0000
Subject: up the version number - RC1 is most likely due tomorrow
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8461 89ea8834-ac86-4346-8a33-228a782c2dd0
---
phpBB/install/database_update.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'phpBB/install/database_update.php')
diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php
index 856640b58b..d87b0fa459 100644
--- a/phpBB/install/database_update.php
+++ b/phpBB/install/database_update.php
@@ -8,7 +8,7 @@
*
*/
-$updates_to_version = '3.0.1-dev';
+$updates_to_version = '3.0.1-RC1';
// Return if we "just include it" to find out for which version the database update is responsible for
if (defined('IN_PHPBB') && defined('IN_INSTALL'))
--
cgit v1.2.1
From b2521b83b1a5c35c4c5df9c90515eb3d90cdab4d Mon Sep 17 00:00:00 2001
From: Meik Sievertsen
Date: Thu, 27 Mar 2008 16:17:54 +0000
Subject: some corrections to let the update work flawlessly.
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8475 89ea8834-ac86-4346-8a33-228a782c2dd0
---
phpBB/install/database_update.php | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
(limited to 'phpBB/install/database_update.php')
diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php
index d87b0fa459..8a38122130 100644
--- a/phpBB/install/database_update.php
+++ b/phpBB/install/database_update.php
@@ -1625,7 +1625,8 @@ _sql($sql, $errored, $error_ary);
// Reset permissions
$sql = 'UPDATE ' . USERS_TABLE . "
- SET user_permissions = ''";
+ SET user_permissions = '',
+ user_perm_from = 0";
_sql($sql, $errored, $error_ary);
/* Optimize/vacuum analyze the tables where appropriate
@@ -1659,6 +1660,8 @@ _write_result($no_updates, $errored, $error_ary);
if (!$inline_update)
{
+ // Purge the cache...
+ $cache->purge();
?>
--
cgit v1.2.1
From daa2afbe3681c5413daa6e6c9c069f90efd0baf9 Mon Sep 17 00:00:00 2001
From: Meik Sievertsen
Date: Mon, 31 Mar 2008 14:48:54 +0000
Subject: allow correct updates from *-dev versions something i have seen
there, there is an open TODO for the form token (min time)
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8483 89ea8834-ac86-4346-8a33-228a782c2dd0
---
phpBB/install/database_update.php | 815 ++++++++++++++++++++------------------
1 file changed, 422 insertions(+), 393 deletions(-)
(limited to 'phpBB/install/database_update.php')
diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php
index 8a38122130..605470dca4 100644
--- a/phpBB/install/database_update.php
+++ b/phpBB/install/database_update.php
@@ -1082,16 +1082,23 @@ if ($exit)
flush();
// We go through the schema changes from the lowest to the highest version
-// We skip those versions older than the current version
+// We try to also include versions 'in-between'...
$no_updates = true;
-foreach ($database_update_info as $version => $schema_changes)
+$versions = array_keys($database_update_info);
+for ($i = 0; $i < sizeof($versions); $i++)
{
- if (version_compare($version, $current_version, '<'))
+ $version = $versions[$i];
+ $schema_changes = $database_update_info[$version];
+
+ $next_version = (isset($versions[$i + 1])) ? $versions[$i + 1] : $updates_to_version;
+
+ if (!sizeof($schema_changes))
{
continue;
}
- if (!sizeof($schema_changes))
+ // If the installed version to be updated to is < than the current version, and if the current version is >= as the version to be updated to next, we will skip the process
+ if (version_compare($version, $current_version, '<') && version_compare($current_version, $next_version, '>='))
{
continue;
}
@@ -1203,404 +1210,26 @@ flush();
$no_updates = true;
-// some code magic
-if (version_compare($current_version, '3.0.RC2', '<='))
-{
- $smileys = array();
- $sql = 'SELECT smiley_id, code
- FROM ' . SMILIES_TABLE;
-
- $result = $db->sql_query($sql);
-
- while ($row = $db->sql_fetchrow($result))
- {
- $smileys[$row['smiley_id']] = $row['code'];
- }
- $db->sql_freeresult($result);
-
- foreach ($smileys as $id => $code)
- {
- // 2.0 only entitized lt and gt; We need to do something about double quotes.
- if (strchr($code, '"') === false)
- {
- continue;
- }
-
- $new_code = str_replace('&', '&', $code);
- $new_code = str_replace('<', '<', $new_code);
- $new_code = str_replace('>', '>', $new_code);
- $new_code = utf8_htmlspecialchars($new_code);
-
- $sql = 'UPDATE ' . SMILIES_TABLE . '
- SET code = \'' . $db->sql_escape($new_code) . '\'
- WHERE smiley_id = ' . (int) $id;
- $db->sql_query($sql);
- }
-
- $index_list = sql_list_index($map_dbms, ACL_ROLES_DATA_TABLE);
-
- if (in_array('ath_opt_id', $index_list))
- {
- sql_index_drop($map_dbms, 'ath_opt_id', ACL_ROLES_DATA_TABLE);
- sql_create_index($map_dbms, 'ath_op_id', ACL_ROLES_DATA_TABLE, array('auth_option_id'));
- }
-
- $no_updates = false;
-}
-
-if (version_compare($current_version, '3.0.RC3', '<='))
-{
- if ($map_dbms === 'postgres')
- {
- $sql = "SELECT SETVAL('" . FORUMS_TABLE . "_seq',(select case when max(forum_id)>0 then max(forum_id)+1 else 1 end from " . FORUMS_TABLE . '));';
- _sql($sql, $errored, $error_ary);
- }
-
- // we check for:
- // ath_opt_id
- // ath_op_id
- // ACL_ROLES_DATA_TABLE_ath_opt_id
- // we want ACL_ROLES_DATA_TABLE_ath_op_id
-
- $table_index_fix = array(
- ACL_ROLES_DATA_TABLE => array(
- 'ath_opt_id' => 'ath_op_id',
- 'ath_op_id' => 'ath_op_id',
- ACL_ROLES_DATA_TABLE . '_ath_opt_id' => 'ath_op_id'
- ),
- STYLES_IMAGESET_DATA_TABLE => array(
- 'i_id' => 'i_d',
- 'i_d' => 'i_d',
- STYLES_IMAGESET_DATA_TABLE . '_i_id' => 'i_d'
- )
- );
-
- // we need to create some indicies...
- $needed_creation = array();
-
- foreach ($table_index_fix as $table_name => $index_info)
- {
- $index_list = sql_list_fake($map_dbms, $table_name);
- foreach ($index_info as $bad_index => $good_index)
- {
- if (in_array($bad_index, $index_list))
- {
- // mysql is actually OK, it won't get a hand in this crud
- switch ($map_dbms)
- {
- // last version, mssql had issues with index removal
- case 'mssql':
- $sql = 'DROP INDEX ' . $table_name . '.' . $bad_index;
- _sql($sql, $errored, $error_ary);
- break;
-
- // last version, firebird, oracle, postgresql and sqlite all got bad index names
- // we got kinda lucky, tho: they all support the same syntax
- case 'firebird':
- case 'oracle':
- case 'postgres':
- case 'sqlite':
- $sql = 'DROP INDEX ' . $bad_index;
- _sql($sql, $errored, $error_ary);
- break;
- }
-
- // If the good index already exist we do not need to create it again...
- if (($map_dbms == 'mysql_40' || $map_dbms == 'mysql_41') && $bad_index == $good_index)
- {
- }
- else
- {
- $needed_creation[$table_name][$good_index] = 1;
- }
- }
- }
- }
-
- $new_index_defs = array('ath_op_id' => array('auth_option_id'), 'i_d' => array('imageset_id'));
-
- foreach ($needed_creation as $bad_table => $index_repair_list)
- {
- foreach ($index_repair_list as $new_index => $garbage)
- {
- sql_create_index($map_dbms, $new_index, $bad_table, $new_index_defs[$new_index]);
- $no_updates = false;
- }
- }
-
- // Make sure empty smiley codes do not exist
- $sql = 'DELETE FROM ' . SMILIES_TABLE . "
- WHERE code = ''";
- _sql($sql, $errored, $error_ary);
-
- set_config('allow_birthdays', '1');
- set_config('cron_lock', '0', true);
-
- $no_updates = false;
-}
+$versions = array(
+ '3.0.RC2', '3.0.RC3', '3.0.RC4', '3.0.RC5', '3.0.0'
+);
-if (version_compare($current_version, '3.0.RC4', '<='))
+// some code magic
+for ($i = 0; $i < sizeof($versions); $i++)
{
- $update_auto_increment = array(
- STYLES_TABLE => 'style_id',
- STYLES_TEMPLATE_TABLE => 'template_id',
- STYLES_THEME_TABLE => 'theme_id',
- STYLES_IMAGESET_TABLE => 'imageset_id'
- );
-
- $sql = 'SELECT *
- FROM ' . STYLES_TABLE . '
- WHERE style_id = 0';
- $result = _sql($sql, $errored, $error_ary);
- $bad_style_row = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
+ $version = $versions[$i];
+ $next_version = (isset($versions[$i + 1])) ? $versions[$i + 1] : $updates_to_version;
- if ($bad_style_row)
+ // If the installed version to be updated to is < than the current version, and if the current version is >= as the version to be updated to next, we will skip the process
+ if (version_compare($version, $current_version, '<') && version_compare($current_version, $next_version, '>='))
{
- $sql = 'SELECT MAX(style_id) as max_id
- FROM ' . STYLES_TABLE;
- $result = _sql($sql, $errored, $error_ary);
- $row = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
-
- $proper_id = $row['max_id'] + 1;
-
- _sql('UPDATE ' . STYLES_TABLE . " SET style_id = $proper_id WHERE style_id = 0", $errored, $error_ary);
- _sql('UPDATE ' . FORUMS_TABLE . " SET forum_style = $proper_id WHERE forum_style = 0", $errored, $error_ary);
- _sql('UPDATE ' . USERS_TABLE . " SET user_style = $proper_id WHERE user_style = 0", $errored, $error_ary);
-
- $sql = 'SELECT config_value
- FROM ' . CONFIG_TABLE . "
- WHERE config_name = 'default_style'";
- $result = _sql($sql, $errored, $error_ary);
- $style_config = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
-
- if ($style_config['config_value'] === '0')
- {
- set_config('default_style', (string) $proper_id);
- }
- }
-
- $sql = 'SELECT *
- FROM ' . STYLES_TEMPLATE_TABLE . '
- WHERE template_id = 0';
- $result = _sql($sql, $errored, $error_ary);
- $bad_style_row = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
-
- if ($bad_style_row)
- {
- $sql = 'SELECT MAX(template_id) as max_id
- FROM ' . STYLES_TEMPLATE_TABLE;
- $result = _sql($sql, $errored, $error_ary);
- $row = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
-
- $proper_id = $row['max_id'] + 1;
-
- _sql('UPDATE ' . STYLES_TABLE . " SET template_id = $proper_id WHERE template_id = 0", $errored, $error_ary);
- }
-
- $sql = 'SELECT *
- FROM ' . STYLES_THEME_TABLE . '
- WHERE theme_id = 0';
- $result = _sql($sql, $errored, $error_ary);
- $bad_style_row = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
-
- if ($bad_style_row)
- {
- $sql = 'SELECT MAX(theme_id) as max_id
- FROM ' . STYLES_THEME_TABLE;
- $result = _sql($sql, $errored, $error_ary);
- $row = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
-
- $proper_id = $row['max_id'] + 1;
-
- _sql('UPDATE ' . STYLES_TABLE . " SET theme_id = $proper_id WHERE theme_id = 0", $errored, $error_ary);
- }
-
- $sql = 'SELECT *
- FROM ' . STYLES_IMAGESET_TABLE . '
- WHERE imageset_id = 0';
- $result = _sql($sql, $errored, $error_ary);
- $bad_style_row = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
-
- if ($bad_style_row)
- {
- $sql = 'SELECT MAX(imageset_id) as max_id
- FROM ' . STYLES_IMAGESET_TABLE;
- $result = _sql($sql, $errored, $error_ary);
- $row = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
-
- $proper_id = $row['max_id'] + 1;
-
- _sql('UPDATE ' . STYLES_TABLE . " SET imageset_id = $proper_id WHERE imageset_id = 0", $errored, $error_ary);
- _sql('UPDATE ' . STYLES_IMAGESET_DATA_TABLE . " SET imageset_id = $proper_id WHERE imageset_id = 0", $errored, $error_ary);
- }
-
- if ($map_dbms == 'mysql_40' || $map_dbms == 'mysql_41')
- {
- foreach ($update_auto_increment as $auto_table_name => $auto_column_name)
- {
- $sql = "SELECT MAX({$auto_column_name}) as max_id
- FROM {$auto_table_name}";
- $result = _sql($sql, $errored, $error_ary);
- $row = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
-
- $max_id = ((int) $row['max_id']) + 1;
- _sql("ALTER TABLE {$auto_table_name} AUTO_INCREMENT = {$max_id}", $errored, $error_ary);
- }
-
- $no_updates = false;
- }
- else if ($map_dbms == 'postgres')
- {
- foreach ($update_auto_increment as $auto_table_name => $auto_column_name)
- {
- $sql = "SELECT SETVAL('" . $auto_table_name . "_seq',(select case when max({$auto_column_name})>0 then max({$auto_column_name})+1 else 1 end from " . $auto_table_name . '));';
- _sql($sql, $errored, $error_ary);
- }
-
- $sql = 'DROP SEQUENCE ' . STYLES_TEMPLATE_DATA_TABLE . '_seq';
- _sql($sql, $errored, $error_ary);
- }
- else if ($map_dbms == 'firebird')
- {
- $sql = 'DROP TRIGGER t_' . STYLES_TEMPLATE_DATA_TABLE;
- _sql($sql, $errored, $error_ary);
-
- $sql = 'DROP GENERATOR ' . STYLES_TEMPLATE_DATA_TABLE . '_gen';
- _sql($sql, $errored, $error_ary);
- }
- else if ($map_dbms == 'oracle')
- {
- $sql = 'DROP TRIGGER t_' . STYLES_TEMPLATE_DATA_TABLE;
- _sql($sql, $errored, $error_ary);
-
- $sql = 'DROP SEQUENCE ' . STYLES_TEMPLATE_DATA_TABLE . '_seq';
- _sql($sql, $errored, $error_ary);
- }
- else if ($map_dbms == 'mssql')
- {
- // we use transactions because we need to have a working DB at the end of all of this
- $db->sql_transaction('begin');
-
- $sql = 'SELECT *
- FROM ' . STYLES_TEMPLATE_DATA_TABLE;
- $result = _sql($sql, $errored, $error_ary);
- $old_style_rows = array();
- while ($row = $db->sql_fetchrow($result))
- {
- $old_style_rows[] = $row;
- }
- $db->sql_freeresult($result);
-
- // death to the table, it is evil!
- $sql = 'DROP TABLE ' . STYLES_TEMPLATE_DATA_TABLE;
- _sql($sql, $errored, $error_ary);
-
- // the table of awesomeness, praise be to it (or something)
- $sql = 'CREATE TABLE [' . STYLES_TEMPLATE_DATA_TABLE . "] (
- [template_id] [int] DEFAULT (0) NOT NULL ,
- [template_filename] [varchar] (100) DEFAULT ('') NOT NULL ,
- [template_included] [varchar] (8000) DEFAULT ('') NOT NULL ,
- [template_mtime] [int] DEFAULT (0) NOT NULL ,
- [template_data] [text] DEFAULT ('') NOT NULL
- ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]";
- _sql($sql, $errored, $error_ary);
-
- // index? index
- $sql = 'CREATE INDEX [tid] ON [' . STYLES_TEMPLATE_DATA_TABLE . ']([template_id]) ON [PRIMARY]';
- _sql($sql, $errored, $error_ary);
-
- // yet another index
- $sql = 'CREATE INDEX [tfn] ON [' . STYLES_TEMPLATE_DATA_TABLE . ']([template_filename]) ON [PRIMARY]';
- _sql($sql, $errored, $error_ary);
-
- foreach ($old_style_rows as $return_row)
- {
- _sql('INSERT INTO ' . STYLES_TEMPLATE_DATA_TABLE . ' ' . $db->sql_build_array('INSERT', $return_row), $errored, $error_ary);
- }
-
- $db->sql_transaction('commit');
+ continue;
}
- // Setting this here again because new installations may not have it...
- set_config('cron_lock', '0', true);
- set_config('ldap_port', '');
- set_config('ldap_user_filter', '');
-
$no_updates = false;
+ change_database_data($version);
}
-if (version_compare($current_version, '3.0.RC5', '<='))
-{
- // In case the user is having the bot mediapartner google "as is", adjust it.
- $sql = 'UPDATE ' . BOTS_TABLE . "
- SET bot_agent = '" . $db->sql_escape('Mediapartners-Google') . "'
- WHERE bot_agent = '" . $db->sql_escape('Mediapartners-Google/') . "'";
- _sql($sql, $errored, $error_ary);
-
- set_config('form_token_lifetime', '7200');
- set_config('form_token_mintime', '0');
- set_config('min_time_reg', '5');
- set_config('min_time_terms', '2');
- set_config('form_token_sid_guests', '1');
-
- $db->sql_transaction('begin');
-
- $sql = 'SELECT forum_id, forum_password
- FROM ' . FORUMS_TABLE;
- $result = _sql($sql, $errored, $error_ary);
-
- while ($row = $db->sql_fetchrow($result))
- {
- if (!empty($row['forum_password']))
- {
- _sql('UPDATE ' . FORUMS_TABLE . " SET forum_password = '" . md5($row['forum_password']) . "' WHERE forum_id = {$row['forum_id']}", $errored, $error_ary);
- }
- }
- $db->sql_freeresult($result);
-
- $db->sql_transaction('commit');
-
- $no_updates = false;
-}
-
-
-if (version_compare($current_version, '3.0.0', '<='))
-{
- $sql = 'UPDATE ' . TOPICS_TABLE . "
- SET topic_last_view_time = topic_last_post_time
- WHERE topic_last_view_time = 0";
- _sql($sql, $errored, $error_ary);
-
- // Update smiley sizes
- $smileys = array('icon_e_surprised.gif', 'icon_eek.gif', 'icon_cool.gif', 'icon_lol.gif', 'icon_mad.gif', 'icon_razz.gif', 'icon_redface.gif', 'icon_cry.gif', 'icon_evil.gif', 'icon_twisted.gif', 'icon_rolleyes.gif', 'icon_exclaim.gif', 'icon_question.gif', 'icon_idea.gif', 'icon_arrow.gif', 'icon_neutral.gif', 'icon_mrgreen.gif', 'icon_e_ugeek.gif');
- foreach ($smileys as $smiley)
- {
- if (file_exists($phpbb_root_path . 'images/smilies/' . $smiley))
- {
- list($width, $height) = getimagesize($phpbb_root_path . 'images/smilies/' . $smiley);
-
- $sql = 'UPDATE ' . SMILIES_TABLE . '
- SET smiley_width = ' . $width . ', smiley_height = ' . $height . "
- WHERE smiley_url = '" . $db->sql_escape($smiley) . "'";
-
- _sql($sql, $errored, $error_ary);
- }
- }
-
- // TODO: remove all form token min times
-
- $no_updates = false;
-}
_write_result($no_updates, $errored, $error_ary);
$error_ary = array();
@@ -1713,6 +1342,406 @@ if (function_exists('exit_handler'))
exit_handler();
}
+/**
+* Function where all data changes are executed
+*/
+function change_database_data($version)
+{
+ global $db, $map_dbms, $errored, $error_ary, $config, $phpbb_root_path;
+
+ switch ($version)
+ {
+ case '3.0.RC2':
+
+ $smileys = array();
+
+ $sql = 'SELECT smiley_id, code
+ FROM ' . SMILIES_TABLE;
+ $result = $db->sql_query($sql);
+
+ while ($row = $db->sql_fetchrow($result))
+ {
+ $smileys[$row['smiley_id']] = $row['code'];
+ }
+ $db->sql_freeresult($result);
+
+ foreach ($smileys as $id => $code)
+ {
+ // 2.0 only entitized lt and gt; We need to do something about double quotes.
+ if (strchr($code, '"') === false)
+ {
+ continue;
+ }
+
+ $new_code = str_replace('&', '&', $code);
+ $new_code = str_replace('<', '<', $new_code);
+ $new_code = str_replace('>', '>', $new_code);
+ $new_code = utf8_htmlspecialchars($new_code);
+
+ $sql = 'UPDATE ' . SMILIES_TABLE . '
+ SET code = \'' . $db->sql_escape($new_code) . '\'
+ WHERE smiley_id = ' . (int) $id;
+ $db->sql_query($sql);
+ }
+
+ $index_list = sql_list_index($map_dbms, ACL_ROLES_DATA_TABLE);
+
+ if (in_array('ath_opt_id', $index_list))
+ {
+ sql_index_drop($map_dbms, 'ath_opt_id', ACL_ROLES_DATA_TABLE);
+ sql_create_index($map_dbms, 'ath_op_id', ACL_ROLES_DATA_TABLE, array('auth_option_id'));
+ }
+
+ break;
+
+ case '3.0.RC3':
+
+ if ($map_dbms === 'postgres')
+ {
+ $sql = "SELECT SETVAL('" . FORUMS_TABLE . "_seq',(select case when max(forum_id)>0 then max(forum_id)+1 else 1 end from " . FORUMS_TABLE . '));';
+ _sql($sql, $errored, $error_ary);
+ }
+
+ // we check for:
+ // ath_opt_id
+ // ath_op_id
+ // ACL_ROLES_DATA_TABLE_ath_opt_id
+ // we want ACL_ROLES_DATA_TABLE_ath_op_id
+
+ $table_index_fix = array(
+ ACL_ROLES_DATA_TABLE => array(
+ 'ath_opt_id' => 'ath_op_id',
+ 'ath_op_id' => 'ath_op_id',
+ ACL_ROLES_DATA_TABLE . '_ath_opt_id' => 'ath_op_id'
+ ),
+ STYLES_IMAGESET_DATA_TABLE => array(
+ 'i_id' => 'i_d',
+ 'i_d' => 'i_d',
+ STYLES_IMAGESET_DATA_TABLE . '_i_id' => 'i_d'
+ )
+ );
+
+ // we need to create some indicies...
+ $needed_creation = array();
+
+ foreach ($table_index_fix as $table_name => $index_info)
+ {
+ $index_list = sql_list_fake($map_dbms, $table_name);
+ foreach ($index_info as $bad_index => $good_index)
+ {
+ if (in_array($bad_index, $index_list))
+ {
+ // mysql is actually OK, it won't get a hand in this crud
+ switch ($map_dbms)
+ {
+ // last version, mssql had issues with index removal
+ case 'mssql':
+ $sql = 'DROP INDEX ' . $table_name . '.' . $bad_index;
+ _sql($sql, $errored, $error_ary);
+ break;
+
+ // last version, firebird, oracle, postgresql and sqlite all got bad index names
+ // we got kinda lucky, tho: they all support the same syntax
+ case 'firebird':
+ case 'oracle':
+ case 'postgres':
+ case 'sqlite':
+ $sql = 'DROP INDEX ' . $bad_index;
+ _sql($sql, $errored, $error_ary);
+ break;
+ }
+
+ // If the good index already exist we do not need to create it again...
+ if (($map_dbms == 'mysql_40' || $map_dbms == 'mysql_41') && $bad_index == $good_index)
+ {
+ }
+ else
+ {
+ $needed_creation[$table_name][$good_index] = 1;
+ }
+ }
+ }
+ }
+
+ $new_index_defs = array('ath_op_id' => array('auth_option_id'), 'i_d' => array('imageset_id'));
+
+ foreach ($needed_creation as $bad_table => $index_repair_list)
+ {
+ foreach ($index_repair_list as $new_index => $garbage)
+ {
+ sql_create_index($map_dbms, $new_index, $bad_table, $new_index_defs[$new_index]);
+ }
+ }
+
+ // Make sure empty smiley codes do not exist
+ $sql = 'DELETE FROM ' . SMILIES_TABLE . "
+ WHERE code = ''";
+ _sql($sql, $errored, $error_ary);
+
+ set_config('allow_birthdays', '1');
+ set_config('cron_lock', '0', true);
+
+ break;
+
+ case '3.0.RC4':
+
+ $update_auto_increment = array(
+ STYLES_TABLE => 'style_id',
+ STYLES_TEMPLATE_TABLE => 'template_id',
+ STYLES_THEME_TABLE => 'theme_id',
+ STYLES_IMAGESET_TABLE => 'imageset_id'
+ );
+
+ $sql = 'SELECT *
+ FROM ' . STYLES_TABLE . '
+ WHERE style_id = 0';
+ $result = _sql($sql, $errored, $error_ary);
+ $bad_style_row = $db->sql_fetchrow($result);
+ $db->sql_freeresult($result);
+
+ if ($bad_style_row)
+ {
+ $sql = 'SELECT MAX(style_id) as max_id
+ FROM ' . STYLES_TABLE;
+ $result = _sql($sql, $errored, $error_ary);
+ $row = $db->sql_fetchrow($result);
+ $db->sql_freeresult($result);
+
+ $proper_id = $row['max_id'] + 1;
+
+ _sql('UPDATE ' . STYLES_TABLE . " SET style_id = $proper_id WHERE style_id = 0", $errored, $error_ary);
+ _sql('UPDATE ' . FORUMS_TABLE . " SET forum_style = $proper_id WHERE forum_style = 0", $errored, $error_ary);
+ _sql('UPDATE ' . USERS_TABLE . " SET user_style = $proper_id WHERE user_style = 0", $errored, $error_ary);
+
+ $sql = 'SELECT config_value
+ FROM ' . CONFIG_TABLE . "
+ WHERE config_name = 'default_style'";
+ $result = _sql($sql, $errored, $error_ary);
+ $style_config = $db->sql_fetchrow($result);
+ $db->sql_freeresult($result);
+
+ if ($style_config['config_value'] === '0')
+ {
+ set_config('default_style', (string) $proper_id);
+ }
+ }
+
+ $sql = 'SELECT *
+ FROM ' . STYLES_TEMPLATE_TABLE . '
+ WHERE template_id = 0';
+ $result = _sql($sql, $errored, $error_ary);
+ $bad_style_row = $db->sql_fetchrow($result);
+ $db->sql_freeresult($result);
+
+ if ($bad_style_row)
+ {
+ $sql = 'SELECT MAX(template_id) as max_id
+ FROM ' . STYLES_TEMPLATE_TABLE;
+ $result = _sql($sql, $errored, $error_ary);
+ $row = $db->sql_fetchrow($result);
+ $db->sql_freeresult($result);
+
+ $proper_id = $row['max_id'] + 1;
+
+ _sql('UPDATE ' . STYLES_TABLE . " SET template_id = $proper_id WHERE template_id = 0", $errored, $error_ary);
+ }
+
+ $sql = 'SELECT *
+ FROM ' . STYLES_THEME_TABLE . '
+ WHERE theme_id = 0';
+ $result = _sql($sql, $errored, $error_ary);
+ $bad_style_row = $db->sql_fetchrow($result);
+ $db->sql_freeresult($result);
+
+ if ($bad_style_row)
+ {
+ $sql = 'SELECT MAX(theme_id) as max_id
+ FROM ' . STYLES_THEME_TABLE;
+ $result = _sql($sql, $errored, $error_ary);
+ $row = $db->sql_fetchrow($result);
+ $db->sql_freeresult($result);
+
+ $proper_id = $row['max_id'] + 1;
+
+ _sql('UPDATE ' . STYLES_TABLE . " SET theme_id = $proper_id WHERE theme_id = 0", $errored, $error_ary);
+ }
+
+ $sql = 'SELECT *
+ FROM ' . STYLES_IMAGESET_TABLE . '
+ WHERE imageset_id = 0';
+ $result = _sql($sql, $errored, $error_ary);
+ $bad_style_row = $db->sql_fetchrow($result);
+ $db->sql_freeresult($result);
+
+ if ($bad_style_row)
+ {
+ $sql = 'SELECT MAX(imageset_id) as max_id
+ FROM ' . STYLES_IMAGESET_TABLE;
+ $result = _sql($sql, $errored, $error_ary);
+ $row = $db->sql_fetchrow($result);
+ $db->sql_freeresult($result);
+
+ $proper_id = $row['max_id'] + 1;
+
+ _sql('UPDATE ' . STYLES_TABLE . " SET imageset_id = $proper_id WHERE imageset_id = 0", $errored, $error_ary);
+ _sql('UPDATE ' . STYLES_IMAGESET_DATA_TABLE . " SET imageset_id = $proper_id WHERE imageset_id = 0", $errored, $error_ary);
+ }
+
+ if ($map_dbms == 'mysql_40' || $map_dbms == 'mysql_41')
+ {
+ foreach ($update_auto_increment as $auto_table_name => $auto_column_name)
+ {
+ $sql = "SELECT MAX({$auto_column_name}) as max_id
+ FROM {$auto_table_name}";
+ $result = _sql($sql, $errored, $error_ary);
+ $row = $db->sql_fetchrow($result);
+ $db->sql_freeresult($result);
+
+ $max_id = ((int) $row['max_id']) + 1;
+ _sql("ALTER TABLE {$auto_table_name} AUTO_INCREMENT = {$max_id}", $errored, $error_ary);
+ }
+ }
+ else if ($map_dbms == 'postgres')
+ {
+ foreach ($update_auto_increment as $auto_table_name => $auto_column_name)
+ {
+ $sql = "SELECT SETVAL('" . $auto_table_name . "_seq',(select case when max({$auto_column_name})>0 then max({$auto_column_name})+1 else 1 end from " . $auto_table_name . '));';
+ _sql($sql, $errored, $error_ary);
+ }
+
+ $sql = 'DROP SEQUENCE ' . STYLES_TEMPLATE_DATA_TABLE . '_seq';
+ _sql($sql, $errored, $error_ary);
+ }
+ else if ($map_dbms == 'firebird')
+ {
+ $sql = 'DROP TRIGGER t_' . STYLES_TEMPLATE_DATA_TABLE;
+ _sql($sql, $errored, $error_ary);
+
+ $sql = 'DROP GENERATOR ' . STYLES_TEMPLATE_DATA_TABLE . '_gen';
+ _sql($sql, $errored, $error_ary);
+ }
+ else if ($map_dbms == 'oracle')
+ {
+ $sql = 'DROP TRIGGER t_' . STYLES_TEMPLATE_DATA_TABLE;
+ _sql($sql, $errored, $error_ary);
+
+ $sql = 'DROP SEQUENCE ' . STYLES_TEMPLATE_DATA_TABLE . '_seq';
+ _sql($sql, $errored, $error_ary);
+ }
+ else if ($map_dbms == 'mssql')
+ {
+ // we use transactions because we need to have a working DB at the end of all of this
+ $db->sql_transaction('begin');
+
+ $sql = 'SELECT *
+ FROM ' . STYLES_TEMPLATE_DATA_TABLE;
+ $result = _sql($sql, $errored, $error_ary);
+ $old_style_rows = array();
+ while ($row = $db->sql_fetchrow($result))
+ {
+ $old_style_rows[] = $row;
+ }
+ $db->sql_freeresult($result);
+
+ // death to the table, it is evil!
+ $sql = 'DROP TABLE ' . STYLES_TEMPLATE_DATA_TABLE;
+ _sql($sql, $errored, $error_ary);
+
+ // the table of awesomeness, praise be to it (or something)
+ $sql = 'CREATE TABLE [' . STYLES_TEMPLATE_DATA_TABLE . "] (
+ [template_id] [int] DEFAULT (0) NOT NULL ,
+ [template_filename] [varchar] (100) DEFAULT ('') NOT NULL ,
+ [template_included] [varchar] (8000) DEFAULT ('') NOT NULL ,
+ [template_mtime] [int] DEFAULT (0) NOT NULL ,
+ [template_data] [text] DEFAULT ('') NOT NULL
+ ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]";
+ _sql($sql, $errored, $error_ary);
+
+ // index? index
+ $sql = 'CREATE INDEX [tid] ON [' . STYLES_TEMPLATE_DATA_TABLE . ']([template_id]) ON [PRIMARY]';
+ _sql($sql, $errored, $error_ary);
+
+ // yet another index
+ $sql = 'CREATE INDEX [tfn] ON [' . STYLES_TEMPLATE_DATA_TABLE . ']([template_filename]) ON [PRIMARY]';
+ _sql($sql, $errored, $error_ary);
+
+ foreach ($old_style_rows as $return_row)
+ {
+ _sql('INSERT INTO ' . STYLES_TEMPLATE_DATA_TABLE . ' ' . $db->sql_build_array('INSERT', $return_row), $errored, $error_ary);
+ }
+
+ $db->sql_transaction('commit');
+ }
+
+ // Setting this here again because new installations may not have it...
+ set_config('cron_lock', '0', true);
+ set_config('ldap_port', '');
+ set_config('ldap_user_filter', '');
+
+ break;
+
+ case '3.0.RC5':
+
+ // In case the user is having the bot mediapartner google "as is", adjust it.
+ $sql = 'UPDATE ' . BOTS_TABLE . "
+ SET bot_agent = '" . $db->sql_escape('Mediapartners-Google') . "'
+ WHERE bot_agent = '" . $db->sql_escape('Mediapartners-Google/') . "'";
+ _sql($sql, $errored, $error_ary);
+
+ set_config('form_token_lifetime', '7200');
+ set_config('form_token_mintime', '0');
+ set_config('min_time_reg', '5');
+ set_config('min_time_terms', '2');
+ set_config('form_token_sid_guests', '1');
+
+ $db->sql_transaction('begin');
+
+ $sql = 'SELECT forum_id, forum_password
+ FROM ' . FORUMS_TABLE;
+ $result = _sql($sql, $errored, $error_ary);
+
+ while ($row = $db->sql_fetchrow($result))
+ {
+ if (!empty($row['forum_password']))
+ {
+ _sql('UPDATE ' . FORUMS_TABLE . " SET forum_password = '" . md5($row['forum_password']) . "' WHERE forum_id = {$row['forum_id']}", $errored, $error_ary);
+ }
+ }
+ $db->sql_freeresult($result);
+
+ $db->sql_transaction('commit');
+
+ break;
+
+ case '3.0.0':
+
+ $sql = 'UPDATE ' . TOPICS_TABLE . "
+ SET topic_last_view_time = topic_last_post_time
+ WHERE topic_last_view_time = 0";
+ _sql($sql, $errored, $error_ary);
+
+ // Update smiley sizes
+ $smileys = array('icon_e_surprised.gif', 'icon_eek.gif', 'icon_cool.gif', 'icon_lol.gif', 'icon_mad.gif', 'icon_razz.gif', 'icon_redface.gif', 'icon_cry.gif', 'icon_evil.gif', 'icon_twisted.gif', 'icon_rolleyes.gif', 'icon_exclaim.gif', 'icon_question.gif', 'icon_idea.gif', 'icon_arrow.gif', 'icon_neutral.gif', 'icon_mrgreen.gif', 'icon_e_ugeek.gif');
+
+ foreach ($smileys as $smiley)
+ {
+ if (file_exists($phpbb_root_path . 'images/smilies/' . $smiley))
+ {
+ list($width, $height) = getimagesize($phpbb_root_path . 'images/smilies/' . $smiley);
+
+ $sql = 'UPDATE ' . SMILIES_TABLE . '
+ SET smiley_width = ' . $width . ', smiley_height = ' . $height . "
+ WHERE smiley_url = '" . $db->sql_escape($smiley) . "'";
+
+ _sql($sql, $errored, $error_ary);
+ }
+ }
+
+ // TODO: remove all form token min times
+
+ break;
+ }
+}
/**
* Function for triggering an sql statement
--
cgit v1.2.1
From c508c3e44e139a24af8e4b0dbc291fa467bfd757 Mon Sep 17 00:00:00 2001
From: Meik Sievertsen
Date: Mon, 7 Apr 2008 13:08:42 +0000
Subject: version update
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8492 89ea8834-ac86-4346-8a33-228a782c2dd0
---
phpBB/install/database_update.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'phpBB/install/database_update.php')
diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php
index 605470dca4..211bbec8d1 100644
--- a/phpBB/install/database_update.php
+++ b/phpBB/install/database_update.php
@@ -8,7 +8,7 @@
*
*/
-$updates_to_version = '3.0.1-RC1';
+$updates_to_version = '3.0.1';
// Return if we "just include it" to find out for which version the database update is responsible for
if (defined('IN_PHPBB') && defined('IN_INSTALL'))
--
cgit v1.2.1
From 9413af5e1a59a9bfc01fb5d3896a2fb5d34055f4 Mon Sep 17 00:00:00 2001
From: Henry Sudhof
Date: Thu, 15 May 2008 13:29:14 +0000
Subject: So, tighten things up a little further. QA Team, please check this.
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8554 89ea8834-ac86-4346-8a33-228a782c2dd0
---
phpBB/install/database_update.php | 4 ++++
1 file changed, 4 insertions(+)
(limited to 'phpBB/install/database_update.php')
diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php
index 211bbec8d1..bead1cad93 100644
--- a/phpBB/install/database_update.php
+++ b/phpBB/install/database_update.php
@@ -1740,6 +1740,10 @@ function change_database_data($version)
// TODO: remove all form token min times
break;
+
+ case '3.0.1':
+
+ set_config('referer_validation', '1');
}
}
--
cgit v1.2.1
From fc12c0021961f369090a3ea9fdcd62ef4d51505e Mon Sep 17 00:00:00 2001
From: Henry Sudhof
Date: Thu, 15 May 2008 14:10:11 +0000
Subject: And more new features for reasonable paranoia.
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8555 89ea8834-ac86-4346-8a33-228a782c2dd0
---
phpBB/install/database_update.php | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
(limited to 'phpBB/install/database_update.php')
diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php
index bead1cad93..94ccf75ecd 100644
--- a/phpBB/install/database_update.php
+++ b/phpBB/install/database_update.php
@@ -1736,14 +1736,15 @@ function change_database_data($version)
_sql($sql, $errored, $error_ary);
}
}
-
- // TODO: remove all form token min times
break;
-
- case '3.0.1':
+ case '3.0.1':
+
set_config('referer_validation', '1');
+ set_config('check_attachment_content', '1');
+ set_config('mime_triggers', 'body|head|html|img|plaintext|a href|pre|script|table|title');
+
}
}
--
cgit v1.2.1
From 459db0eb1bb72dbe258a56edec851d8664886d7f Mon Sep 17 00:00:00 2001
From: Meik Sievertsen
Date: Tue, 3 Jun 2008 14:50:41 +0000
Subject: some changes to database_update to circumvent doubled updates for
RC's
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8582 89ea8834-ac86-4346-8a33-228a782c2dd0
---
phpBB/install/database_update.php | 32 +++++++++++++++++++-------------
1 file changed, 19 insertions(+), 13 deletions(-)
(limited to 'phpBB/install/database_update.php')
diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php
index 94ccf75ecd..e79a69d173 100644
--- a/phpBB/install/database_update.php
+++ b/phpBB/install/database_update.php
@@ -8,7 +8,7 @@
*
*/
-$updates_to_version = '3.0.1';
+$updates_to_version = '3.0.1'; //'3.0.2-RC1';
// Return if we "just include it" to find out for which version the database update is responsible for
if (defined('IN_PHPBB') && defined('IN_INSTALL'))
@@ -33,7 +33,7 @@ error_reporting(E_ALL);
// Include essential scripts
include($phpbb_root_path . 'config.' . $phpEx);
-if (!isset($dbms))
+if (!defined('PHPBB_INSTALLED') || empty($dbms) || empty($acm_type))
{
die("Please read: INSTALL.html before attempting to update.");
}
@@ -496,6 +496,10 @@ $database_update_info = array(
GROUPS_TABLE => array('group_legend'),
),
),
+ // No changes from 3.0.0 to 3.0.1-RC1
+ '3.0.1-RC1' => array(),
+ // No changes from 3.0.1-RC1 to 3.0.1
+ '3.0.1' => array(),
);
// Determine mapping database type
@@ -932,7 +936,7 @@ if (version_compare($current_version, '3.0.RC8', '<='))
foreach ($user_ids as $i => $user_id)
{
$row = $users[$user_id];
-
+
$rank_title = $rank_img = '';
get_user_rank($row['user_rank'], $row['user_posts'], $rank_title, $rank_img, $rank_img_src);
@@ -1211,7 +1215,7 @@ flush();
$no_updates = true;
$versions = array(
- '3.0.RC2', '3.0.RC3', '3.0.RC4', '3.0.RC5', '3.0.0'
+ '3.0.RC2', '3.0.RC3', '3.0.RC4', '3.0.RC5', '3.0.0', '3.0.1-RC1'
);
// some code magic
@@ -1324,7 +1328,7 @@ $cache->purge();
-
+
@@ -1364,7 +1368,7 @@ function change_database_data($version)
$smileys[$row['smiley_id']] = $row['code'];
}
$db->sql_freeresult($result);
-
+
foreach ($smileys as $id => $code)
{
// 2.0 only entitized lt and gt; We need to do something about double quotes.
@@ -1699,7 +1703,7 @@ function change_database_data($version)
$sql = 'SELECT forum_id, forum_password
FROM ' . FORUMS_TABLE;
$result = _sql($sql, $errored, $error_ary);
-
+
while ($row = $db->sql_fetchrow($result))
{
if (!empty($row['forum_password']))
@@ -1708,7 +1712,7 @@ function change_database_data($version)
}
}
$db->sql_freeresult($result);
-
+
$db->sql_transaction('commit');
break;
@@ -1719,7 +1723,7 @@ function change_database_data($version)
SET topic_last_view_time = topic_last_post_time
WHERE topic_last_view_time = 0";
_sql($sql, $errored, $error_ary);
-
+
// Update smiley sizes
$smileys = array('icon_e_surprised.gif', 'icon_eek.gif', 'icon_cool.gif', 'icon_lol.gif', 'icon_mad.gif', 'icon_razz.gif', 'icon_redface.gif', 'icon_cry.gif', 'icon_evil.gif', 'icon_twisted.gif', 'icon_rolleyes.gif', 'icon_exclaim.gif', 'icon_question.gif', 'icon_idea.gif', 'icon_arrow.gif', 'icon_neutral.gif', 'icon_mrgreen.gif', 'icon_e_ugeek.gif');
@@ -1728,23 +1732,25 @@ function change_database_data($version)
if (file_exists($phpbb_root_path . 'images/smilies/' . $smiley))
{
list($width, $height) = getimagesize($phpbb_root_path . 'images/smilies/' . $smiley);
-
+
$sql = 'UPDATE ' . SMILIES_TABLE . '
SET smiley_width = ' . $width . ', smiley_height = ' . $height . "
WHERE smiley_url = '" . $db->sql_escape($smiley) . "'";
-
+
_sql($sql, $errored, $error_ary);
}
}
break;
- case '3.0.1':
-
+ case '3.0.1-RC1':
+
set_config('referer_validation', '1');
set_config('check_attachment_content', '1');
set_config('mime_triggers', 'body|head|html|img|plaintext|a href|pre|script|table|title');
+ break;
+
}
}
--
cgit v1.2.1
From d48af67b0e48b8450ad1c78f0f63e74f6023faf8 Mon Sep 17 00:00:00 2001
From: Meik Sievertsen
Date: Wed, 11 Jun 2008 16:52:11 +0000
Subject: - some version changes - apply database updates sequentially
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8648 89ea8834-ac86-4346-8a33-228a782c2dd0
---
phpBB/install/database_update.php | 56 +++++++++++++++++++++++++++++----------
1 file changed, 42 insertions(+), 14 deletions(-)
(limited to 'phpBB/install/database_update.php')
diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php
index e79a69d173..43d8c06a27 100644
--- a/phpBB/install/database_update.php
+++ b/phpBB/install/database_update.php
@@ -8,7 +8,7 @@
*
*/
-$updates_to_version = '3.0.1'; //'3.0.2-RC1';
+$updates_to_version = '3.0.2-RC1';
// Return if we "just include it" to find out for which version the database update is responsible for
if (defined('IN_PHPBB') && defined('IN_INSTALL'))
@@ -496,10 +496,12 @@ $database_update_info = array(
GROUPS_TABLE => array('group_legend'),
),
),
- // No changes from 3.0.0 to 3.0.1-RC1
- '3.0.1-RC1' => array(),
// No changes from 3.0.1-RC1 to 3.0.1
+ '3.0.1-RC1' => array(),
+ // No changes from 3.0.1 to 3.0.2-RC1
'3.0.1' => array(),
+// uncomment once RC1 out - no changes from 3.0.2-RC1 to 3.0.2
+// '3.0.2-RC1' => array(),
);
// Determine mapping database type
@@ -585,6 +587,11 @@ while ($row = $db->sql_fetchrow($result))
}
$db->sql_freeresult($result);
+/*if ($debug_from_version !== false)
+{
+ $config['version'] = $debug_from_version;
+}*/
+
echo $lang['PREVIOUS_VERSION'] . ' :: ' . $config['version'] . '
';
echo $lang['UPDATED_VERSION'] . ' :: ' . $updates_to_version . '
';
@@ -608,7 +615,7 @@ else
// Checks/Operations that have to be completed prior to starting the update itself
$exit = false;
-if (version_compare($current_version, '3.0.RC8', '<='))
+if (version_compare($current_version, '3.0.RC8', '<=')) /* && $debug_from_version === false) */
{
// Define missing language entries...
if (!isset($lang['CLEANING_USERNAMES']))
@@ -1096,13 +1103,20 @@ for ($i = 0; $i < sizeof($versions); $i++)
$next_version = (isset($versions[$i + 1])) ? $versions[$i + 1] : $updates_to_version;
- if (!sizeof($schema_changes))
+ // If the installed version to be updated to is < than the current version, and if the current version is >= as the version to be updated to next, we will skip the process
+ if (version_compare($version, $current_version, '<') && version_compare($current_version, $next_version, '>='))
{
continue;
}
- // If the installed version to be updated to is < than the current version, and if the current version is >= as the version to be updated to next, we will skip the process
- if (version_compare($version, $current_version, '<') && version_compare($current_version, $next_version, '>='))
+/* if ($debug_from_version !== false)
+ {
+ // Applying update schema for version array with key '$version'
+ // for version '$version' to '$next_version'
+ continue;
+ }*/
+
+ if (!sizeof($schema_changes))
{
continue;
}
@@ -1213,10 +1227,7 @@ $errored = $no_updates = false;
flush();
$no_updates = true;
-
-$versions = array(
- '3.0.RC2', '3.0.RC3', '3.0.RC4', '3.0.RC5', '3.0.0', '3.0.1-RC1'
-);
+$versions = array_keys($database_update_info);
// some code magic
for ($i = 0; $i < sizeof($versions); $i++)
@@ -1230,8 +1241,14 @@ for ($i = 0; $i < sizeof($versions); $i++)
continue;
}
- $no_updates = false;
- change_database_data($version);
+/* if ($debug_from_version !== false)
+ {
+ // Applying update schema for version array with key '$version'
+ // for version '$version' to '$next_version'
+ continue;
+ }*/
+
+ change_database_data($no_updates, $version);
}
_write_result($no_updates, $errored, $error_ary);
@@ -1250,6 +1267,9 @@ $errored = $no_updates = false;
flush();
+//if ($debug_from_version === false)
+// {
+
// update the version
$sql = "UPDATE " . CONFIG_TABLE . "
SET config_value = '$updates_to_version'
@@ -1262,6 +1282,8 @@ $sql = 'UPDATE ' . USERS_TABLE . "
user_perm_from = 0";
_sql($sql, $errored, $error_ary);
+// }
+
/* Optimize/vacuum analyze the tables where appropriate
// this should be done for each version in future along with
// the version number update
@@ -1349,7 +1371,7 @@ if (function_exists('exit_handler'))
/**
* Function where all data changes are executed
*/
-function change_database_data($version)
+function change_database_data(&$no_updates, $version)
{
global $db, $map_dbms, $errored, $error_ary, $config, $phpbb_root_path;
@@ -1396,6 +1418,7 @@ function change_database_data($version)
sql_create_index($map_dbms, 'ath_op_id', ACL_ROLES_DATA_TABLE, array('auth_option_id'));
}
+ $no_updates = false;
break;
case '3.0.RC3':
@@ -1485,6 +1508,7 @@ function change_database_data($version)
set_config('allow_birthdays', '1');
set_config('cron_lock', '0', true);
+ $no_updates = false;
break;
case '3.0.RC4':
@@ -1682,6 +1706,7 @@ function change_database_data($version)
set_config('ldap_port', '');
set_config('ldap_user_filter', '');
+ $no_updates = false;
break;
case '3.0.RC5':
@@ -1715,6 +1740,7 @@ function change_database_data($version)
$db->sql_transaction('commit');
+ $no_updates = false;
break;
case '3.0.0':
@@ -1741,6 +1767,7 @@ function change_database_data($version)
}
}
+ $no_updates = false;
break;
case '3.0.1-RC1':
@@ -1749,6 +1776,7 @@ function change_database_data($version)
set_config('check_attachment_content', '1');
set_config('mime_triggers', 'body|head|html|img|plaintext|a href|pre|script|table|title');
+ $no_updates = false;
break;
}
--
cgit v1.2.1
From 008cccbefc574108d0d550ba10b740c188a86f4f Mon Sep 17 00:00:00 2001
From: Meik Sievertsen
Date: Sat, 21 Jun 2008 14:30:56 +0000
Subject: fix 3.0.1 to 3.0.2-RC1
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8662 89ea8834-ac86-4346-8a33-228a782c2dd0
---
phpBB/install/database_update.php | 8 ++++++++
1 file changed, 8 insertions(+)
(limited to 'phpBB/install/database_update.php')
diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php
index 43d8c06a27..184331976b 100644
--- a/phpBB/install/database_update.php
+++ b/phpBB/install/database_update.php
@@ -1770,7 +1770,12 @@ function change_database_data(&$no_updates, $version)
$no_updates = false;
break;
+ // No changes from 3.0.1-RC1 to 3.0.1
case '3.0.1-RC1':
+ break;
+
+ // changes from 3.0.1 to 3.0.2-RC1
+ case '3.0.1':
set_config('referer_validation', '1');
set_config('check_attachment_content', '1');
@@ -1779,6 +1784,9 @@ function change_database_data(&$no_updates, $version)
$no_updates = false;
break;
+ // uncomment once RC1 out - no changes from 3.0.2-RC1 to 3.0.2
+// case '3.0.2-RC1':
+// break;
}
}
--
cgit v1.2.1
From b8647dc952b8992e3a09d31f27a5f3834fb4e8b5 Mon Sep 17 00:00:00 2001
From: Meik Sievertsen
Date: Sat, 21 Jun 2008 16:04:13 +0000
Subject: change subject/title column length
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8666 89ea8834-ac86-4346-8a33-228a782c2dd0
---
phpBB/install/database_update.php | 43 ++++++++++++++++++++++++++++++++++-----
1 file changed, 38 insertions(+), 5 deletions(-)
(limited to 'phpBB/install/database_update.php')
diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php
index 184331976b..0805a2b273 100644
--- a/phpBB/install/database_update.php
+++ b/phpBB/install/database_update.php
@@ -8,7 +8,7 @@
*
*/
-$updates_to_version = '3.0.2-RC1';
+$updates_to_version = '3.0.2-RC2';
// Return if we "just include it" to find out for which version the database update is responsible for
if (defined('IN_PHPBB') && defined('IN_INSTALL'))
@@ -500,8 +500,37 @@ $database_update_info = array(
'3.0.1-RC1' => array(),
// No changes from 3.0.1 to 3.0.2-RC1
'3.0.1' => array(),
-// uncomment once RC1 out - no changes from 3.0.2-RC1 to 3.0.2
-// '3.0.2-RC1' => array(),
+ // Changes from 3.0.2-RC1 to 3.0.2-RC2
+ '3.0.2-RC1' => array(
+ 'change_columns' => array(
+ DRAFTS_TABLE => array(
+ 'draft_subject' => array('STEXT_UNI', ''),
+ ),
+ FORUMS_TABLE => array(
+ 'forum_last_post_subject' => array('STEXT_UNI', ''),
+ ),
+ POSTS_TABLE => array(
+ 'post_subject' => array('STEXT_UNI', '', 'true_sort'),
+ ),
+ PRIVMSGS_TABLE => array(
+ 'message_subject' => array('STEXT_UNI', ''),
+ ),
+ TOPICS_TABLE => array(
+ 'topic_title' => array('STEXT_UNI', '', 'true_sort'),
+ 'topic_last_post_subject' => array('STEXT_UNI', ''),
+ ),
+ ),
+ 'drop_keys' => array(
+ SESSIONS_TABLE => array('session_forum_id'),
+ ),
+ 'add_index' => array(
+ SESSIONS_TABLE => array(
+ 'session_fid' => array('session_forum_id'),
+ ),
+ ),
+ ),
+ // uncomment once RC2 out - no changes from 3.0.2-RC2 to 3.0.2
+// '3.0.2-RC2' => array(),
);
// Determine mapping database type
@@ -1784,8 +1813,12 @@ function change_database_data(&$no_updates, $version)
$no_updates = false;
break;
- // uncomment once RC1 out - no changes from 3.0.2-RC1 to 3.0.2
-// case '3.0.2-RC1':
+ // No changes from 3.0.2-RC1 to 3.0.2-RC2
+ case '3.0.2-RC1':
+ break;
+
+ // uncomment once RC2 out - no changes from 3.0.2-RC2 to 3.0.2
+// case '3.0.2-RC2':
// break;
}
}
--
cgit v1.2.1
From 04814560c89eac2a0aaf83277b8fd4511e7adcf7 Mon Sep 17 00:00:00 2001
From: Meik Sievertsen
Date: Sun, 6 Jul 2008 16:35:41 +0000
Subject: up the version number
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8678 89ea8834-ac86-4346-8a33-228a782c2dd0
---
phpBB/install/database_update.php | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
(limited to 'phpBB/install/database_update.php')
diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php
index 0805a2b273..fb287299e5 100644
--- a/phpBB/install/database_update.php
+++ b/phpBB/install/database_update.php
@@ -8,7 +8,7 @@
*
*/
-$updates_to_version = '3.0.2-RC2';
+$updates_to_version = '3.0.2';
// Return if we "just include it" to find out for which version the database update is responsible for
if (defined('IN_PHPBB') && defined('IN_INSTALL'))
@@ -529,8 +529,8 @@ $database_update_info = array(
),
),
),
- // uncomment once RC2 out - no changes from 3.0.2-RC2 to 3.0.2
-// '3.0.2-RC2' => array(),
+ // No changes from 3.0.2-RC2 to 3.0.2
+ '3.0.2-RC2' => array(),
);
// Determine mapping database type
@@ -1817,9 +1817,9 @@ function change_database_data(&$no_updates, $version)
case '3.0.2-RC1':
break;
- // uncomment once RC2 out - no changes from 3.0.2-RC2 to 3.0.2
-// case '3.0.2-RC2':
-// break;
+ // No changes from 3.0.2-RC2 to 3.0.2
+ case '3.0.2-RC2':
+ break;
}
}
--
cgit v1.2.1
From eda1d40861fb5a2b74e7e5ade618cc9fa83cafd1 Mon Sep 17 00:00:00 2001
From: Henry Sudhof
Date: Mon, 28 Jul 2008 14:24:37 +0000
Subject: Okay. Frozen, we never said anything about it being permafrost. Also,
this is not 100% tested, expect troubel with store_db (I'm waiting for the
bug reports)
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8697 89ea8834-ac86-4346-8a33-228a782c2dd0
---
phpBB/install/database_update.php | 11 +++++++++++
1 file changed, 11 insertions(+)
(limited to 'phpBB/install/database_update.php')
diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php
index fb287299e5..296731c5f9 100644
--- a/phpBB/install/database_update.php
+++ b/phpBB/install/database_update.php
@@ -531,6 +531,17 @@ $database_update_info = array(
),
// No changes from 3.0.2-RC2 to 3.0.2
'3.0.2-RC2' => array(),
+
+ // Changes from 3.0.2 to the next version
+ '3.0.2' => array(
+ // Add the following columns
+ 'add_columns' => array(
+ STYLES_TEMPLATE_TABLE => array(
+ 'template_inherits_id' => array('UINT:4', 0),
+ 'template_inherit_path' => array('VCHAR', NULL),
+ ),
+ ),
+ ),
);
// Determine mapping database type
--
cgit v1.2.1
From b3cff3489012d0ac17348c70986e0dd8d96d80c9 Mon Sep 17 00:00:00 2001
From: Henry Sudhof
Date: Tue, 29 Jul 2008 23:10:07 +0000
Subject: weird - schemas later
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8731 89ea8834-ac86-4346-8a33-228a782c2dd0
---
phpBB/install/database_update.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'phpBB/install/database_update.php')
diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php
index 296731c5f9..af631d09fc 100644
--- a/phpBB/install/database_update.php
+++ b/phpBB/install/database_update.php
@@ -538,7 +538,7 @@ $database_update_info = array(
'add_columns' => array(
STYLES_TEMPLATE_TABLE => array(
'template_inherits_id' => array('UINT:4', 0),
- 'template_inherit_path' => array('VCHAR', NULL),
+ 'template_inherit_path' => array('VCHAR', ''),
),
),
),
--
cgit v1.2.1
From 7f813a9ef65fbf3dd24565e3e199ab67b38df70c Mon Sep 17 00:00:00 2001
From: Meik Sievertsen
Date: Tue, 2 Sep 2008 06:34:27 +0000
Subject: settings and data for the new queued posts feature ;)
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8804 89ea8834-ac86-4346-8a33-228a782c2dd0
---
phpBB/install/database_update.php | 24 +++++++++++++++++++++++-
1 file changed, 23 insertions(+), 1 deletion(-)
(limited to 'phpBB/install/database_update.php')
diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php
index af631d09fc..88ad142013 100644
--- a/phpBB/install/database_update.php
+++ b/phpBB/install/database_update.php
@@ -532,7 +532,7 @@ $database_update_info = array(
// No changes from 3.0.2-RC2 to 3.0.2
'3.0.2-RC2' => array(),
- // Changes from 3.0.2 to the next version
+ // Changes from 3.0.2 to 3.0.3-RC1
'3.0.2' => array(
// Add the following columns
'add_columns' => array(
@@ -1831,6 +1831,28 @@ function change_database_data(&$no_updates, $version)
// No changes from 3.0.2-RC2 to 3.0.2
case '3.0.2-RC2':
break;
+
+ // Changes from 3.0.2 to 3.0.3-RC1
+ case '3.0.3':
+ set_config('enable_queue_trigger', '0');
+ set_config('queue_trigger_posts', '3');
+
+ // Resync post counts
+ $sql = 'SELECT COUNT(p.post_id) AS num_posts, u.user_id
+ FROM ' . USERS_TABLE . ' u
+ LEFT JOIN ' . POSTS_TABLE . ' p ON (u.user_id = p.poster_id AND p.post_postcount = 1 AND p.post_approved = 1)
+ GROUP BY u.user_id';
+ $result = _sql($sql, $errored, $error_ary);
+
+ while ($row = $db->sql_fetchrow($result))
+ {
+ $sql = 'UPDATE ' . USERS_TABLE . " SET user_posts = {$row['num_posts']} WHERE user_id = {$row['user_id']}";
+ _sql($sql, $errored, $error_ary);
+ }
+ $db->sql_freeresult($result);
+
+ $no_updates = false;
+ break;
}
}
--
cgit v1.2.1
From 46dac33b82198ee459ccdfb7bb5514a7d480bb05 Mon Sep 17 00:00:00 2001
From: Meik Sievertsen
Date: Tue, 2 Sep 2008 08:52:53 +0000
Subject: 3.0.2 instead of 3.0.3. ;)
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8806 89ea8834-ac86-4346-8a33-228a782c2dd0
---
phpBB/install/database_update.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'phpBB/install/database_update.php')
diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php
index 88ad142013..53d22462c0 100644
--- a/phpBB/install/database_update.php
+++ b/phpBB/install/database_update.php
@@ -1833,7 +1833,7 @@ function change_database_data(&$no_updates, $version)
break;
// Changes from 3.0.2 to 3.0.3-RC1
- case '3.0.3':
+ case '3.0.2':
set_config('enable_queue_trigger', '0');
set_config('queue_trigger_posts', '3');
--
cgit v1.2.1
From 2fcd96ca72741bdfb36c24a0af9dd8230b5a828f Mon Sep 17 00:00:00 2001
From: Meik Sievertsen
Date: Thu, 4 Sep 2008 12:01:47 +0000
Subject: Ok, story real database server info, as well as caching it Store it
on installation too - allows us to check the db version used on installation
and used currently to warn the user about incompatibilities
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8814 89ea8834-ac86-4346-8a33-228a782c2dd0
---
phpBB/install/database_update.php | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
(limited to 'phpBB/install/database_update.php')
diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php
index 53d22462c0..c9ced1dbcb 100644
--- a/phpBB/install/database_update.php
+++ b/phpBB/install/database_update.php
@@ -552,7 +552,7 @@ switch ($db->sql_layer)
break;
case 'mysql4':
- if (version_compare($db->mysql_version, '4.1.3', '>='))
+ if (version_compare($db->sql_server_info(true), '4.1.3', '>='))
{
$map_dbms = 'mysql_41';
}
@@ -1837,6 +1837,9 @@ function change_database_data(&$no_updates, $version)
set_config('enable_queue_trigger', '0');
set_config('queue_trigger_posts', '3');
+ // Not prefilling yet
+ set_config('dbms_version', '');
+
// Resync post counts
$sql = 'SELECT COUNT(p.post_id) AS num_posts, u.user_id
FROM ' . USERS_TABLE . ' u
--
cgit v1.2.1
From 4a3db854b7d0ce56f3a3033f1dcc9f5baa0af8f9 Mon Sep 17 00:00:00 2001
From: Meik Sievertsen
Date: Tue, 23 Sep 2008 13:03:33 +0000
Subject: - Added 'max_recipients' setting for private messages. This setting
allows admins to define the maximum number of recipients per private message
with a board-wide setting and a group-specific setting. - Added new
permission setting for sending private messages to groups. Now there are two
permissions to define sending private messages to multiple recipients and
private messages to groups.
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8911 89ea8834-ac86-4346-8a33-228a782c2dd0
---
phpBB/install/database_update.php | 97 ++++++++++++++++++++++++++++++++++-----
1 file changed, 86 insertions(+), 11 deletions(-)
(limited to 'phpBB/install/database_update.php')
diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php
index c9ced1dbcb..81db58cf21 100644
--- a/phpBB/install/database_update.php
+++ b/phpBB/install/database_update.php
@@ -540,6 +540,9 @@ $database_update_info = array(
'template_inherits_id' => array('UINT:4', 0),
'template_inherit_path' => array('VCHAR', ''),
),
+ GROUPS_TABLE => array(
+ 'group_max_recipients' => array('UINT', 0),
+ ),
),
),
);
@@ -1413,7 +1416,7 @@ if (function_exists('exit_handler'))
*/
function change_database_data(&$no_updates, $version)
{
- global $db, $map_dbms, $errored, $error_ary, $config, $phpbb_root_path;
+ global $db, $map_dbms, $errored, $error_ary, $config, $phpbb_root_path, $phpEx;
switch ($version)
{
@@ -1837,22 +1840,94 @@ function change_database_data(&$no_updates, $version)
set_config('enable_queue_trigger', '0');
set_config('queue_trigger_posts', '3');
+ set_config('pm_max_recipients', '0');
+
+ // Set maximum number of recipients for the registered users, bots, guests group
+ $sql = 'UPDATE ' . GROUPS_TABLE . ' SET group_max_recipients = 5
+ WHERE ' . $db->sql_in_set('group_name', array('GUESTS', 'REGISTERED', 'REGISTERED_COPPA', 'BOTS'));
+ _sql($sql, $errored, $error_ary);
+
// Not prefilling yet
set_config('dbms_version', '');
- // Resync post counts
- $sql = 'SELECT COUNT(p.post_id) AS num_posts, u.user_id
- FROM ' . USERS_TABLE . ' u
- LEFT JOIN ' . POSTS_TABLE . ' p ON (u.user_id = p.poster_id AND p.post_postcount = 1 AND p.post_approved = 1)
- GROUP BY u.user_id';
- $result = _sql($sql, $errored, $error_ary);
+ // Add new permission u_masspm_group and duplicate settings from u_masspm
+ include_once($phpbb_root_path . 'includes/acp/auth.' . $phpEx);
+ $auth_admin = new auth_admin();
- while ($row = $db->sql_fetchrow($result))
+ // Only add the new permission if it does not already exist
+ if (empty($auth_admin->acl_options['id']['u_masspm_group']))
{
- $sql = 'UPDATE ' . USERS_TABLE . " SET user_posts = {$row['num_posts']} WHERE user_id = {$row['user_id']}";
- _sql($sql, $errored, $error_ary);
+ $auth_admin->acl_add_option(array('global' => array('u_masspm_group')));
+
+ // Now the tricky part, filling the permission
+ $old_id = $auth_admin->acl_options['id']['u_masspm'];
+ $new_id = $auth_admin->acl_options['id']['u_masspm_group'];
+
+ $tables = array(ACL_GROUPS_TABLE, ACL_ROLES_DATA_TABLE, ACL_USERS_TABLE);
+
+ foreach ($tables as $table)
+ {
+ $sql = 'SELECT *
+ FROM ' . $table . '
+ WHERE auth_option_id = ' . $old_id;
+ $result = _sql($sql, $errored, $error_ary);
+
+ $sql_ary = array();
+ while ($row = $db->sql_fetchrow($result))
+ {
+ $row['auth_option_id'] = $new_id;
+ $sql_ary[] = $row;
+ }
+ $db->sql_freeresult($result);
+
+ if (sizeof($sql_ary))
+ {
+ $db->sql_multi_insert($table, $sql_ary);
+ }
+ }
+
+ // Remove any old permission entries
+ $auth_admin->acl_clear_prefetch();
}
- $db->sql_freeresult($result);
+
+ /**
+ * Do not resync post counts here. An admin may later do this from the ACP
+ $start = 0;
+
+ do
+ {
+ @flush();
+
+ $sql = 'SELECT COUNT(p.post_id) AS num_posts, u.user_id
+ FROM ' . USERS_TABLE . ' u
+ LEFT JOIN ' . POSTS_TABLE . ' p ON (u.user_id = p.poster_id AND p.post_postcount = 1 AND p.post_approved = 1)
+ GROUP BY u.user_id
+ ORDER BY u.user_id ASC';
+ $result = $db->sql_query_limit($sql, 200, $start);
+
+ if ($row = $db->sql_fetchrow($result))
+ {
+ $i = 0;
+
+ do
+ {
+ $sql = 'UPDATE ' . USERS_TABLE . " SET user_posts = {$row['num_posts']} WHERE user_id = {$row['user_id']}";
+ _sql($sql, $errored, $error_ary);
+
+ $i++;
+ }
+ while ($row = $db->sql_fetchrow($result));
+
+ $start = ($i < 200) ? 0 : $start + 200;
+ }
+ else
+ {
+ $start = 0;
+ }
+ $db->sql_freeresult($result);
+ }
+ while ($start);
+ */
$no_updates = false;
break;
--
cgit v1.2.1
From 936f7d43f0635b59b4eb7fcdff4d04b37ea03c21 Mon Sep 17 00:00:00 2001
From: Meik Sievertsen
Date: Wed, 24 Sep 2008 13:57:13 +0000
Subject: better query for syncing post counts. Thanks to BartVB for this. ;)
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8932 89ea8834-ac86-4346-8a33-228a782c2dd0
---
phpBB/install/database_update.php | 26 ++++++++++++--------------
1 file changed, 12 insertions(+), 14 deletions(-)
(limited to 'phpBB/install/database_update.php')
diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php
index 81db58cf21..3e733e6b22 100644
--- a/phpBB/install/database_update.php
+++ b/phpBB/install/database_update.php
@@ -1893,32 +1893,30 @@ function change_database_data(&$no_updates, $version)
/**
* Do not resync post counts here. An admin may later do this from the ACP
$start = 0;
+ $step = ($config['num_posts']) ? (max((int) ($config['num_posts'] / 5), 20000)) : 20000;
+
+ $sql = 'UPDATE ' . USERS_TABLE . ' SET user_posts = 0';
+ _sql($sql, $errored, $error_ary);
do
{
- @flush();
-
- $sql = 'SELECT COUNT(p.post_id) AS num_posts, u.user_id
- FROM ' . USERS_TABLE . ' u
- LEFT JOIN ' . POSTS_TABLE . ' p ON (u.user_id = p.poster_id AND p.post_postcount = 1 AND p.post_approved = 1)
- GROUP BY u.user_id
- ORDER BY u.user_id ASC';
- $result = $db->sql_query_limit($sql, 200, $start);
+ $sql = 'SELECT COUNT(post_id) AS num_posts, poster_id
+ FROM ' . POSTS_TABLE . '
+ WHERE post_id BETWEEN ' . ($start + 1) . ' AND ' . ($start + $step) . '
+ AND post_postcount = 1 AND post_approved = 1
+ GROUP BY poster_id';
+ $result = _sql($sql, $errored, $error_ary);
if ($row = $db->sql_fetchrow($result))
{
- $i = 0;
-
do
{
- $sql = 'UPDATE ' . USERS_TABLE . " SET user_posts = {$row['num_posts']} WHERE user_id = {$row['user_id']}";
+ $sql = 'UPDATE ' . USERS_TABLE . " SET user_posts = user_posts + {$row['num_posts']} WHERE user_id = {$row['poster_id']}";
_sql($sql, $errored, $error_ary);
-
- $i++;
}
while ($row = $db->sql_fetchrow($result));
- $start = ($i < 200) ? 0 : $start + 200;
+ $start += $step;
}
else
{
--
cgit v1.2.1
From 36983da764695bb516645a176156bbc8187ef41a Mon Sep 17 00:00:00 2001
From: Chris Smith
Date: Mon, 13 Oct 2008 18:45:24 +0000
Subject: Disable mass e-mail when e-mail is disabled. #27385
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9011 89ea8834-ac86-4346-8a33-228a782c2dd0
---
phpBB/install/database_update.php | 6 ++++++
1 file changed, 6 insertions(+)
(limited to 'phpBB/install/database_update.php')
diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php
index 3e733e6b22..aba05722a1 100644
--- a/phpBB/install/database_update.php
+++ b/phpBB/install/database_update.php
@@ -1927,6 +1927,12 @@ function change_database_data(&$no_updates, $version)
while ($start);
*/
+ $sql = 'UPDATE ' . MODULES_TABLE . '
+ SET module_auth = \'acl_a_email && cfg_email_enable\'
+ WHERE module_class = \'acp\'
+ AND module_basename = \'email\'';
+ _sql($sql, $errored, $error_ary);
+
$no_updates = false;
break;
}
--
cgit v1.2.1
From fe4a53b76e7e55eafce56d502737ad3f5dcf2423 Mon Sep 17 00:00:00 2001
From: Meik Sievertsen
Date: Sat, 25 Oct 2008 14:12:13 +0000
Subject: Help the user if FTP update fails.
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9035 89ea8834-ac86-4346-8a33-228a782c2dd0
---
phpBB/install/database_update.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'phpBB/install/database_update.php')
diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php
index aba05722a1..dd8f2d9704 100644
--- a/phpBB/install/database_update.php
+++ b/phpBB/install/database_update.php
@@ -8,7 +8,7 @@
*
*/
-$updates_to_version = '3.0.2';
+$updates_to_version = '3.0.3-RC1';
// Return if we "just include it" to find out for which version the database update is responsible for
if (defined('IN_PHPBB') && defined('IN_INSTALL'))
--
cgit v1.2.1
From 5d9306c5128f45cfc9a448ce888b725bbc4408b8 Mon Sep 17 00:00:00 2001
From: Meik Sievertsen
Date: Sat, 25 Oct 2008 14:16:17 +0000
Subject: up the version number
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9036 89ea8834-ac86-4346-8a33-228a782c2dd0
---
phpBB/install/database_update.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'phpBB/install/database_update.php')
diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php
index dd8f2d9704..e84d63a950 100644
--- a/phpBB/install/database_update.php
+++ b/phpBB/install/database_update.php
@@ -1891,7 +1891,7 @@ function change_database_data(&$no_updates, $version)
}
/**
- * Do not resync post counts here. An admin may later do this from the ACP
+ * Do not resync post counts here. An admin may do this later from the ACP
$start = 0;
$step = ($config['num_posts']) ? (max((int) ($config['num_posts'] / 5), 20000)) : 20000;
--
cgit v1.2.1
From 538acb3db5e91f983849cd70fa754bb29ee364a0 Mon Sep 17 00:00:00 2001
From: Chris Smith
Date: Wed, 5 Nov 2008 22:03:16 +0000
Subject: Remove deprecated language key and update any references in the
database to the correct one.
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9049 89ea8834-ac86-4346-8a33-228a782c2dd0
---
phpBB/install/database_update.php | 10 ++++++++++
1 file changed, 10 insertions(+)
(limited to 'phpBB/install/database_update.php')
diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php
index e84d63a950..a6abc21508 100644
--- a/phpBB/install/database_update.php
+++ b/phpBB/install/database_update.php
@@ -1935,6 +1935,16 @@ function change_database_data(&$no_updates, $version)
$no_updates = false;
break;
+
+ // Changes from 3.0.3-RC1 to 3.0.3-RC2
+ case '3.0.3-RC1':
+ $sql = 'UPDATE ' . LOG_TABLE . "
+ SET log_operation = 'LOG_DELETE_TOPIC'
+ WHERE log_operation = 'LOG_TOPIC_DELETED'";
+ _sql($sql, $errored, $error_ary);
+
+ $no_updates = false;
+ break;
}
}
--
cgit v1.2.1
From c185c3b64bcba881f723eb2ea9fee35afe9c29ec Mon Sep 17 00:00:00 2001
From: Meik Sievertsen
Date: Sat, 8 Nov 2008 20:02:22 +0000
Subject: Fix Bug #36535 (PHP 5.3 compatibility) + version number updates (if
RC2 will be released we will change it again. ;))
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9050 89ea8834-ac86-4346-8a33-228a782c2dd0
---
phpBB/install/database_update.php | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
(limited to 'phpBB/install/database_update.php')
diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php
index a6abc21508..5fe9c19964 100644
--- a/phpBB/install/database_update.php
+++ b/phpBB/install/database_update.php
@@ -78,7 +78,7 @@ if (version_compare(PHP_VERSION, '6.0.0-dev', '>='))
}
else
{
- set_magic_quotes_runtime(0);
+ @set_magic_quotes_runtime(0);
define('STRIP', (get_magic_quotes_gpc()) ? true : false);
}
@@ -545,6 +545,9 @@ $database_update_info = array(
),
),
),
+
+ // No changes from 3.0.3-RC1 to 3.0.3
+ '3.0.3-RC1' => array(),
);
// Determine mapping database type
@@ -1936,7 +1939,7 @@ function change_database_data(&$no_updates, $version)
$no_updates = false;
break;
- // Changes from 3.0.3-RC1 to 3.0.3-RC2
+ // Changes from 3.0.3-RC1 to 3.0.3
case '3.0.3-RC1':
$sql = 'UPDATE ' . LOG_TABLE . "
SET log_operation = 'LOG_DELETE_TOPIC'
--
cgit v1.2.1
From 40fa01b9f0cdd061967d929be0967599107ef2dc Mon Sep 17 00:00:00 2001
From: Meik Sievertsen
Date: Wed, 12 Nov 2008 20:26:36 +0000
Subject: gah, forgot this tiny little thing...
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9058 89ea8834-ac86-4346-8a33-228a782c2dd0
---
phpBB/install/database_update.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'phpBB/install/database_update.php')
diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php
index 5fe9c19964..48fd4e3ad2 100644
--- a/phpBB/install/database_update.php
+++ b/phpBB/install/database_update.php
@@ -8,7 +8,7 @@
*
*/
-$updates_to_version = '3.0.3-RC1';
+$updates_to_version = '3.0.3';
// Return if we "just include it" to find out for which version the database update is responsible for
if (defined('IN_PHPBB') && defined('IN_INSTALL'))
--
cgit v1.2.1
From fb77cdd0513994dca478c06a3c9ac5912da07872 Mon Sep 17 00:00:00 2001
From: Meik Sievertsen
Date: Wed, 26 Nov 2008 19:58:35 +0000
Subject: Better handling and finer control for custom profile fields
visibility options. (Patch by Highway of Life)
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9127 89ea8834-ac86-4346-8a33-228a782c2dd0
---
phpBB/install/database_update.php | 52 ++++++++++++++++++++++++++++++++++++++-
1 file changed, 51 insertions(+), 1 deletion(-)
(limited to 'phpBB/install/database_update.php')
diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php
index 48fd4e3ad2..b5839f517a 100644
--- a/phpBB/install/database_update.php
+++ b/phpBB/install/database_update.php
@@ -548,6 +548,15 @@ $database_update_info = array(
// No changes from 3.0.3-RC1 to 3.0.3
'3.0.3-RC1' => array(),
+
+ // Changes from 3.0.3 to 3.0.4-RC1
+ '3.0.3' => array(
+ 'add_columns' => array(
+ PROFILE_FIELDS_TABLE => array(
+ 'field_show_profile' => array('BOOL', 0),
+ ),
+ ),
+ ),
);
// Determine mapping database type
@@ -1948,6 +1957,47 @@ function change_database_data(&$no_updates, $version)
$no_updates = false;
break;
+
+ // Changes from 3.0.3 to 3.0.4-RC1
+ case '3.0.3':
+ // Update the Custom Profile Fields based on previous settings to the new format
+ $sql = 'SELECT field_id, field_required, field_show_on_reg, field_hide
+ FROM ' . PROFILE_FIELDS_TABLE;
+ $result = _sql($sql, $errored, $error_ary);
+
+ while ($row = $db->sql_fetchrow($result))
+ {
+ $sql_ary = array(
+ 'field_required' => 0,
+ 'field_show_on_reg' => 0,
+ 'field_hide' => 0,
+ 'field_show_profile'=> 0,
+ );
+
+ if ($row['field_required'])
+ {
+ $sql_ary['field_required'] = $sql_ary['field_show_on_reg'] = $sql_ary['field_show_profile'] = 1;
+ }
+ else if ($row['field_show_on_reg'])
+ {
+ $sql_ary['field_show_on_reg'] = $sql_ary['field_show_profile'] = 1;
+ }
+ else if ($row['field_hide'])
+ {
+ // Only administrators and moderators can see this CPF, if the view is enabled, they can see it, otherwise just admins in the acp_users module
+ $sql_ary['field_hide'] = 1;
+ }
+ else
+ {
+ // equivelant to "none", which is the "Display in user control panel" option
+ $sql_ary['field_show_profile'] = 1;
+ }
+
+ _sql('UPDATE ' . PROFILE_FIELDS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . ' WHERE field_id = ' . $row['field_id'], $errored, $error_ary);
+ }
+
+ $no_updates = false;
+ break;
}
}
@@ -3082,4 +3132,4 @@ function utf8_new_clean_string($text)
return trim($text);
}
-?>
\ No newline at end of file
+?>
--
cgit v1.2.1
From 481e5c193fa21bd2cb8d7086fcdccd3d6964604d Mon Sep 17 00:00:00 2001
From: Meik Sievertsen
Date: Thu, 27 Nov 2008 13:44:24 +0000
Subject: extend the style columns (style_id, template_id, imageset_id,
image_id...) No, not only because of possible style demos. :o
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9129 89ea8834-ac86-4346-8a33-228a782c2dd0
---
phpBB/install/database_update.php | 32 +++++++++++++++++++++++++++++++-
1 file changed, 31 insertions(+), 1 deletion(-)
(limited to 'phpBB/install/database_update.php')
diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php
index b5839f517a..a0627a917f 100644
--- a/phpBB/install/database_update.php
+++ b/phpBB/install/database_update.php
@@ -8,7 +8,7 @@
*
*/
-$updates_to_version = '3.0.3';
+$updates_to_version = '3.0.4-RC1';
// Return if we "just include it" to find out for which version the database update is responsible for
if (defined('IN_PHPBB') && defined('IN_INSTALL'))
@@ -556,6 +556,36 @@ $database_update_info = array(
'field_show_profile' => array('BOOL', 0),
),
),
+ 'change_columns' => array(
+ STYLES_TABLE => array(
+ 'style_id' => array('UINT', NULL, 'auto_increment'),
+ 'template_id' => array('UINT', 0),
+ 'theme_id' => array('UINT', 0),
+ 'imageset_id' => array('UINT', 0),
+ ),
+ STYLES_IMAGESET_TABLE => array(
+ 'imageset_id' => array('UINT', NULL, 'auto_increment'),
+ ),
+ STYLES_IMAGESET_DATA_TABLE => array(
+ 'image_id' => array('UINT', NULL, 'auto_increment'),
+ 'imageset_id' => array('UINT', 0),
+ ),
+ STYLES_THEME_TABLE => array(
+ 'theme_id' => array('UINT', NULL, 'auto_increment'),
+ ),
+ STYLES_TEMPLATE_TABLE => array(
+ 'template_id' => array('UINT', NULL, 'auto_increment'),
+ ),
+ STYLES_TEMPLATE_DATA_TABLE => array(
+ 'template_id' => array('UINT', 0),
+ ),
+ FORUMS_TABLE => array(
+ 'forum_style' => array('USINT', 0),
+ ),
+ USERS_TABLE => array(
+ 'user_style' => array('UINT', 0),
+ ),
+ ),
),
);
--
cgit v1.2.1
From 0481a574cedad6b0f09cb2d137e74da8f01bec47 Mon Sep 17 00:00:00 2001
From: Meik Sievertsen
Date: Fri, 12 Dec 2008 14:47:03 +0000
Subject: Change version number from 3.0.4-RC1 to 3.0.4
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9187 89ea8834-ac86-4346-8a33-228a782c2dd0
---
phpBB/install/database_update.php | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
(limited to 'phpBB/install/database_update.php')
diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php
index a0627a917f..fb37b62203 100644
--- a/phpBB/install/database_update.php
+++ b/phpBB/install/database_update.php
@@ -8,7 +8,7 @@
*
*/
-$updates_to_version = '3.0.4-RC1';
+$updates_to_version = '3.0.4';
// Return if we "just include it" to find out for which version the database update is responsible for
if (defined('IN_PHPBB') && defined('IN_INSTALL'))
@@ -587,6 +587,9 @@ $database_update_info = array(
),
),
),
+
+ // Changes from 3.0.4-RC1 to 3.0.4
+ '3.0.4-RC1' => array(),
);
// Determine mapping database type
@@ -2028,6 +2031,10 @@ function change_database_data(&$no_updates, $version)
$no_updates = false;
break;
+
+ // Changes from 3.0.4-RC1 to 3.0.4
+ case '3.0.4-RC1':
+ break;
}
}
--
cgit v1.2.1
From 71039008474e678959a432db1868faf5d6a3cb71 Mon Sep 17 00:00:00 2001
From: Henry Sudhof
Date: Wed, 21 Jan 2009 13:37:50 +0000
Subject: New option for the GD VC. Parameters need some more tweaking
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9283 89ea8834-ac86-4346-8a33-228a782c2dd0
---
phpBB/install/database_update.php | 5 +++++
1 file changed, 5 insertions(+)
(limited to 'phpBB/install/database_update.php')
diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php
index fb37b62203..54f7320e9e 100644
--- a/phpBB/install/database_update.php
+++ b/phpBB/install/database_update.php
@@ -2035,6 +2035,11 @@ function change_database_data(&$no_updates, $version)
// Changes from 3.0.4-RC1 to 3.0.4
case '3.0.4-RC1':
break;
+
+ // Changes from 3.0.4 to 3.0.4dev
+ case '3.0.4':
+ set_config('captcha_gd_wave', 0);
+ break;
}
}
--
cgit v1.2.1
From e5f0824e4b1f4215c0126edccc162aa1a7c6787d Mon Sep 17 00:00:00 2001
From: Henry Sudhof
Date: Fri, 6 Feb 2009 14:51:26 +0000
Subject: As proposed by marshalrusty: re-hash plain MD5s left in the database
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9312 89ea8834-ac86-4346-8a33-228a782c2dd0
---
phpBB/install/database_update.php | 30 +++++++++++++++++++++++++++---
1 file changed, 27 insertions(+), 3 deletions(-)
(limited to 'phpBB/install/database_update.php')
diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php
index 54f7320e9e..ff6579d2ed 100644
--- a/phpBB/install/database_update.php
+++ b/phpBB/install/database_update.php
@@ -8,7 +8,7 @@
*
*/
-$updates_to_version = '3.0.4';
+$updates_to_version = '3.0.5-dev';
// Return if we "just include it" to find out for which version the database update is responsible for
if (defined('IN_PHPBB') && defined('IN_INSTALL'))
@@ -590,6 +590,9 @@ $database_update_info = array(
// Changes from 3.0.4-RC1 to 3.0.4
'3.0.4-RC1' => array(),
+
+ // Changes from 3.0.4 to 3.0.5-dev
+ '3.0.4' => array(),
);
// Determine mapping database type
@@ -2028,17 +2031,38 @@ function change_database_data(&$no_updates, $version)
_sql('UPDATE ' . PROFILE_FIELDS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . ' WHERE field_id = ' . $row['field_id'], $errored, $error_ary);
}
-
$no_updates = false;
+
break;
// Changes from 3.0.4-RC1 to 3.0.4
case '3.0.4-RC1':
break;
- // Changes from 3.0.4 to 3.0.4dev
+ // Changes from 3.0.4 to 3.0.5-dev
case '3.0.4':
+
set_config('captcha_gd_wave', 0);
+
+ $sql = 'SELECT user_id, user_password
+ FROM ' . USERS_TABLE . '
+ WHERE user_pass_convert = 1';
+ $result = _sql($sql, $errored, $error_ary);
+
+ while ($row = $db->sql_fetchrow($result))
+ {
+ if (strlen($row['user_password']) == 32)
+ {
+ $sql_ary = array(
+ 'user_password' => phpbb_hash($row['user_password']),
+ );
+
+ _sql('UPDATE ' . USERS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . ' WHERE user_id = ' . $row['user_id'], $errored, $error_ary);
+ }
+ }
+
+ $no_updates = false;
+
break;
}
}
--
cgit v1.2.1
From 6f486b0499258d1a236837acae120274bb1832d1 Mon Sep 17 00:00:00 2001
From: Henry Sudhof
Date: Sun, 8 Feb 2009 14:15:49 +0000
Subject: and another CAPTCHA setting - add new noise shapes to the noise array
for more variations.
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9320 89ea8834-ac86-4346-8a33-228a782c2dd0
---
phpBB/install/database_update.php | 2 ++
1 file changed, 2 insertions(+)
(limited to 'phpBB/install/database_update.php')
diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php
index ff6579d2ed..18a94b3219 100644
--- a/phpBB/install/database_update.php
+++ b/phpBB/install/database_update.php
@@ -2043,6 +2043,8 @@ function change_database_data(&$no_updates, $version)
case '3.0.4':
set_config('captcha_gd_wave', 0);
+ set_config('captcha_gd_3d_noise', 1);
+
$sql = 'SELECT user_id, user_password
FROM ' . USERS_TABLE . '
--
cgit v1.2.1
From bfa4e6038e1e15bab8c19a6a0caa9607933b972b Mon Sep 17 00:00:00 2001
From: Meik Sievertsen
Date: Sat, 28 Feb 2009 19:20:29 +0000
Subject: refactor the database updater: - no longer support versions prior
3.0.0 - more apparent place for adding schema/data changes - use db_tools -
added check for wrong schema (MySQL 3x/4x schema on MySQL > 4.0)
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9350 89ea8834-ac86-4346-8a33-228a782c2dd0
---
phpBB/install/database_update.php | 2924 ++++---------------------------------
1 file changed, 321 insertions(+), 2603 deletions(-)
(limited to 'phpBB/install/database_update.php')
diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php
index 18a94b3219..4f96966a81 100644
--- a/phpBB/install/database_update.php
+++ b/phpBB/install/database_update.php
@@ -10,6 +10,9 @@
$updates_to_version = '3.0.5-dev';
+// Enter any version to update from to test updates. The version within the db will not be updated.
+$debug_from_version = false;
+
// Return if we "just include it" to find out for which version the database update is responsible for
if (defined('IN_PHPBB') && defined('IN_INSTALL'))
{
@@ -140,492 +143,25 @@ include($phpbb_root_path . 'language/' . $language . '/install.' . $phpEx);
// Define some variables for the database update
$inline_update = (request_var('type', 0)) ? true : false;
-// Database column types mapping
-$dbms_type_map = array(
- 'mysql_41' => array(
- 'INT:' => 'int(%d)',
- 'BINT' => 'bigint(20)',
- 'UINT' => 'mediumint(8) UNSIGNED',
- 'UINT:' => 'int(%d) UNSIGNED',
- 'TINT:' => 'tinyint(%d)',
- 'USINT' => 'smallint(4) UNSIGNED',
- 'BOOL' => 'tinyint(1) UNSIGNED',
- 'VCHAR' => 'varchar(255)',
- 'VCHAR:' => 'varchar(%d)',
- 'CHAR:' => 'char(%d)',
- 'XSTEXT' => 'text',
- 'XSTEXT_UNI'=> 'varchar(100)',
- 'STEXT' => 'text',
- 'STEXT_UNI' => 'varchar(255)',
- 'TEXT' => 'text',
- 'TEXT_UNI' => 'text',
- 'MTEXT' => 'mediumtext',
- 'MTEXT_UNI' => 'mediumtext',
- 'TIMESTAMP' => 'int(11) UNSIGNED',
- 'DECIMAL' => 'decimal(5,2)',
- 'VCHAR_UNI' => 'varchar(255)',
- 'VCHAR_UNI:'=> 'varchar(%d)',
- 'VCHAR_CI' => 'varchar(255)',
- 'VARBINARY' => 'varbinary(255)',
- ),
-
- 'mysql_40' => array(
- 'INT:' => 'int(%d)',
- 'BINT' => 'bigint(20)',
- 'UINT' => 'mediumint(8) UNSIGNED',
- 'UINT:' => 'int(%d) UNSIGNED',
- 'TINT:' => 'tinyint(%d)',
- 'USINT' => 'smallint(4) UNSIGNED',
- 'BOOL' => 'tinyint(1) UNSIGNED',
- 'VCHAR' => 'varbinary(255)',
- 'VCHAR:' => 'varbinary(%d)',
- 'CHAR:' => 'binary(%d)',
- 'XSTEXT' => 'blob',
- 'XSTEXT_UNI'=> 'blob',
- 'STEXT' => 'blob',
- 'STEXT_UNI' => 'blob',
- 'TEXT' => 'blob',
- 'TEXT_UNI' => 'blob',
- 'MTEXT' => 'mediumblob',
- 'MTEXT_UNI' => 'mediumblob',
- 'TIMESTAMP' => 'int(11) UNSIGNED',
- 'DECIMAL' => 'decimal(5,2)',
- 'VCHAR_UNI' => 'blob',
- 'VCHAR_UNI:'=> array('varbinary(%d)', 'limit' => array('mult', 3, 255, 'blob')),
- 'VCHAR_CI' => 'blob',
- 'VARBINARY' => 'varbinary(255)',
- ),
-
- 'firebird' => array(
- 'INT:' => 'INTEGER',
- 'BINT' => 'DOUBLE PRECISION',
- 'UINT' => 'INTEGER',
- 'UINT:' => 'INTEGER',
- 'TINT:' => 'INTEGER',
- 'USINT' => 'INTEGER',
- 'BOOL' => 'INTEGER',
- 'VCHAR' => 'VARCHAR(255) CHARACTER SET NONE',
- 'VCHAR:' => 'VARCHAR(%d) CHARACTER SET NONE',
- 'CHAR:' => 'CHAR(%d) CHARACTER SET NONE',
- 'XSTEXT' => 'BLOB SUB_TYPE TEXT CHARACTER SET NONE',
- 'STEXT' => 'BLOB SUB_TYPE TEXT CHARACTER SET NONE',
- 'TEXT' => 'BLOB SUB_TYPE TEXT CHARACTER SET NONE',
- 'MTEXT' => 'BLOB SUB_TYPE TEXT CHARACTER SET NONE',
- 'XSTEXT_UNI'=> 'VARCHAR(100) CHARACTER SET UTF8',
- 'STEXT_UNI' => 'VARCHAR(255) CHARACTER SET UTF8',
- 'TEXT_UNI' => 'BLOB SUB_TYPE TEXT CHARACTER SET UTF8',
- 'MTEXT_UNI' => 'BLOB SUB_TYPE TEXT CHARACTER SET UTF8',
- 'TIMESTAMP' => 'INTEGER',
- 'DECIMAL' => 'DOUBLE PRECISION',
- 'VCHAR_UNI' => 'VARCHAR(255) CHARACTER SET UTF8',
- 'VCHAR_UNI:'=> 'VARCHAR(%d) CHARACTER SET UTF8',
- 'VCHAR_CI' => 'VARCHAR(255) CHARACTER SET UTF8',
- 'VARBINARY' => 'CHAR(255) CHARACTER SET NONE',
- ),
-
- 'mssql' => array(
- 'INT:' => '[int]',
- 'BINT' => '[float]',
- 'UINT' => '[int]',
- 'UINT:' => '[int]',
- 'TINT:' => '[int]',
- 'USINT' => '[int]',
- 'BOOL' => '[int]',
- 'VCHAR' => '[varchar] (255)',
- 'VCHAR:' => '[varchar] (%d)',
- 'CHAR:' => '[char] (%d)',
- 'XSTEXT' => '[varchar] (1000)',
- 'STEXT' => '[varchar] (3000)',
- 'TEXT' => '[varchar] (8000)',
- 'MTEXT' => '[text]',
- 'XSTEXT_UNI'=> '[varchar] (100)',
- 'STEXT_UNI' => '[varchar] (255)',
- 'TEXT_UNI' => '[varchar] (4000)',
- 'MTEXT_UNI' => '[text]',
- 'TIMESTAMP' => '[int]',
- 'DECIMAL' => '[float]',
- 'VCHAR_UNI' => '[varchar] (255)',
- 'VCHAR_UNI:'=> '[varchar] (%d)',
- 'VCHAR_CI' => '[varchar] (255)',
- 'VARBINARY' => '[varchar] (255)',
- ),
-
- 'oracle' => array(
- 'INT:' => 'number(%d)',
- 'BINT' => 'number(20)',
- 'UINT' => 'number(8)',
- 'UINT:' => 'number(%d)',
- 'TINT:' => 'number(%d)',
- 'USINT' => 'number(4)',
- 'BOOL' => 'number(1)',
- 'VCHAR' => 'varchar2(255)',
- 'VCHAR:' => 'varchar2(%d)',
- 'CHAR:' => 'char(%d)',
- 'XSTEXT' => 'varchar2(1000)',
- 'STEXT' => 'varchar2(3000)',
- 'TEXT' => 'clob',
- 'MTEXT' => 'clob',
- 'XSTEXT_UNI'=> 'varchar2(300)',
- 'STEXT_UNI' => 'varchar2(765)',
- 'TEXT_UNI' => 'clob',
- 'MTEXT_UNI' => 'clob',
- 'TIMESTAMP' => 'number(11)',
- 'DECIMAL' => 'number(5, 2)',
- 'VCHAR_UNI' => 'varchar2(765)',
- 'VCHAR_UNI:'=> array('varchar2(%d)', 'limit' => array('mult', 3, 765, 'clob')),
- 'VCHAR_CI' => 'varchar2(255)',
- 'VARBINARY' => 'raw(255)',
- ),
-
- 'sqlite' => array(
- 'INT:' => 'int(%d)',
- 'BINT' => 'bigint(20)',
- 'UINT' => 'INTEGER UNSIGNED', //'mediumint(8) UNSIGNED',
- 'UINT:' => 'INTEGER UNSIGNED', // 'int(%d) UNSIGNED',
- 'TINT:' => 'tinyint(%d)',
- 'USINT' => 'INTEGER UNSIGNED', //'mediumint(4) UNSIGNED',
- 'BOOL' => 'INTEGER UNSIGNED', //'tinyint(1) UNSIGNED',
- 'VCHAR' => 'varchar(255)',
- 'VCHAR:' => 'varchar(%d)',
- 'CHAR:' => 'char(%d)',
- 'XSTEXT' => 'text(65535)',
- 'STEXT' => 'text(65535)',
- 'TEXT' => 'text(65535)',
- 'MTEXT' => 'mediumtext(16777215)',
- 'XSTEXT_UNI'=> 'text(65535)',
- 'STEXT_UNI' => 'text(65535)',
- 'TEXT_UNI' => 'text(65535)',
- 'MTEXT_UNI' => 'mediumtext(16777215)',
- 'TIMESTAMP' => 'INTEGER UNSIGNED', //'int(11) UNSIGNED',
- 'DECIMAL' => 'decimal(5,2)',
- 'VCHAR_UNI' => 'varchar(255)',
- 'VCHAR_UNI:'=> 'varchar(%d)',
- 'VCHAR_CI' => 'varchar(255)',
- 'VARBINARY' => 'blob',
- ),
-
- 'postgres' => array(
- 'INT:' => 'INT4',
- 'BINT' => 'INT8',
- 'UINT' => 'INT4', // unsigned
- 'UINT:' => 'INT4', // unsigned
- 'USINT' => 'INT2', // unsigned
- 'BOOL' => 'INT2', // unsigned
- 'TINT:' => 'INT2',
- 'VCHAR' => 'varchar(255)',
- 'VCHAR:' => 'varchar(%d)',
- 'CHAR:' => 'char(%d)',
- 'XSTEXT' => 'varchar(1000)',
- 'STEXT' => 'varchar(3000)',
- 'TEXT' => 'varchar(8000)',
- 'MTEXT' => 'TEXT',
- 'XSTEXT_UNI'=> 'varchar(100)',
- 'STEXT_UNI' => 'varchar(255)',
- 'TEXT_UNI' => 'varchar(4000)',
- 'MTEXT_UNI' => 'TEXT',
- 'TIMESTAMP' => 'INT4', // unsigned
- 'DECIMAL' => 'decimal(5,2)',
- 'VCHAR_UNI' => 'varchar(255)',
- 'VCHAR_UNI:'=> 'varchar(%d)',
- 'VCHAR_CI' => 'varchar_ci',
- 'VARBINARY' => 'bytea',
- ),
-);
-
-// A list of types being unsigned for better reference in some db's
-$unsigned_types = array('UINT', 'UINT:', 'USINT', 'BOOL', 'TIMESTAMP');
-
-// Only an example, but also commented out
-$database_update_info = array(
- // Changes from 3.0.RC2 to the next version
- '3.0.RC2' => array(
- // Change the following columns
- 'change_columns' => array(
- BANLIST_TABLE => array(
- 'ban_reason' => array('VCHAR_UNI', ''),
- 'ban_give_reason' => array('VCHAR_UNI', ''),
- ),
- ),
- ),
- // Changes from 3.0.RC3 to the next version
- '3.0.RC3' => array(
- // Change the following columns
- 'change_columns' => array(
- BANLIST_TABLE => array(
- 'ban_reason' => array('VCHAR_UNI', ''),
- 'ban_give_reason' => array('VCHAR_UNI', ''),
- ),
- STYLES_TABLE => array(
- 'style_id' => array('USINT', 0),
- 'template_id' => array('USINT', 0),
- 'theme_id' => array('USINT', 0),
- 'imageset_id' => array('USINT', 0),
- ),
- STYLES_TEMPLATE_TABLE => array(
- 'template_id' => array('USINT', 0),
- ),
- STYLES_TEMPLATE_DATA_TABLE => array(
- 'template_id' => array('USINT', 0),
- ),
- STYLES_THEME_TABLE => array(
- 'theme_id' => array('USINT', 0),
- ),
- STYLES_IMAGESET_TABLE => array(
- 'imageset_id' => array('USINT', 0),
- ),
- STYLES_IMAGESET_DATA_TABLE => array(
- 'imageset_id' => array('USINT', 0),
- ),
- USERS_TABLE => array(
- 'user_style' => array('USINT', 0),
- ),
- FORUMS_TABLE => array(
- 'forum_style' => array('USINT', 0),
- ),
- GROUPS_TABLE => array(
- 'group_avatar_type' => array('TINT:2', 0),
- 'group_avatar_width' => array('USINT', 0),
- 'group_avatar_height' => array('USINT', 0),
- ),
- ),
- ),
- // Changes from 3.0.RC4 to the next version
- '3.0.RC4' => array(
- // Change the following columns
- 'change_columns' => array(
- STYLES_TABLE => array(
- 'style_id' => array('USINT', NULL, 'auto_increment'),
- 'template_id' => array('USINT', 0),
- 'theme_id' => array('USINT', 0),
- 'imageset_id' => array('USINT', 0),
- ),
- STYLES_TEMPLATE_TABLE => array(
- 'template_id' => array('USINT', NULL, 'auto_increment'),
- ),
- STYLES_TEMPLATE_DATA_TABLE => array(
- 'template_id' => array('USINT', 0),
- ),
- STYLES_THEME_TABLE => array(
- 'theme_id' => array('USINT', NULL, 'auto_increment'),
- ),
- STYLES_IMAGESET_TABLE => array(
- 'imageset_id' => array('USINT', NULL, 'auto_increment'),
- ),
- STYLES_IMAGESET_DATA_TABLE => array(
- 'imageset_id' => array('USINT', 0),
- ),
- USERS_TABLE => array(
- 'user_style' => array('USINT', 0),
- ),
- FORUMS_TABLE => array(
- 'forum_style' => array('USINT', 0),
- ),
- GROUPS_TABLE => array(
- 'group_avatar_width' => array('USINT', 0),
- 'group_avatar_height' => array('USINT', 0),
- ),
- ),
- ),
- // Changes from 3.0.RC5 to the next version
- '3.0.RC5' => array(
- // Add the following columns
- 'add_columns' => array(
- USERS_TABLE => array(
- 'user_form_salt' => array('VCHAR_UNI:32', ''),
- ),
- ),
- // Change the following columns
- 'change_columns' => array(
- POSTS_TABLE => array(
- 'bbcode_uid' => array('VCHAR:8', ''),
- ),
- PRIVMSGS_TABLE => array(
- 'bbcode_uid' => array('VCHAR:8', ''),
- ),
- USERS_TABLE => array(
- 'user_sig_bbcode_uid' => array('VCHAR:8', ''),
- ),
- ),
- ),
- // Changes from 3.0.RC6 to the next version
- '3.0.RC6' => array(
- // Change the following columns
- 'change_columns' => array(
- FORUMS_TABLE => array(
- 'forum_desc_uid' => array('VCHAR:8', ''),
- 'forum_rules_uid' => array('VCHAR:8', ''),
- ),
- GROUPS_TABLE => array(
- 'group_desc_uid' => array('VCHAR:8', ''),
- ),
- USERS_TABLE => array(
- 'user_newpasswd' => array('VCHAR_UNI:40', ''),
- ),
- ),
- ),
- // Changes from 3.0.RC8 to the next version
- '3.0.RC8' => array(
- // Change the following columns
- 'change_columns' => array(
- USERS_TABLE => array(
- 'user_new_privmsg' => array('INT:4', 0),
- 'user_unread_privmsg' => array('INT:4', 0),
- ),
- ),
- ),
- // Changes from 3.0.0 to the next version
- '3.0.0' => array(
- // Add the following columns
- 'add_columns' => array(
- FORUMS_TABLE => array(
- 'display_subforum_list' => array('BOOL', 1),
- ),
- SESSIONS_TABLE => array(
- 'session_forum_id' => array('UINT', 0),
- ),
- ),
- 'add_index' => array(
- SESSIONS_TABLE => array(
- 'session_forum_id' => array('session_forum_id'),
- ),
- GROUPS_TABLE => array(
- 'group_legend_name' => array('group_legend', 'group_name'),
- ),
- ),
- 'drop_keys' => array(
- GROUPS_TABLE => array('group_legend'),
- ),
- ),
- // No changes from 3.0.1-RC1 to 3.0.1
- '3.0.1-RC1' => array(),
- // No changes from 3.0.1 to 3.0.2-RC1
- '3.0.1' => array(),
- // Changes from 3.0.2-RC1 to 3.0.2-RC2
- '3.0.2-RC1' => array(
- 'change_columns' => array(
- DRAFTS_TABLE => array(
- 'draft_subject' => array('STEXT_UNI', ''),
- ),
- FORUMS_TABLE => array(
- 'forum_last_post_subject' => array('STEXT_UNI', ''),
- ),
- POSTS_TABLE => array(
- 'post_subject' => array('STEXT_UNI', '', 'true_sort'),
- ),
- PRIVMSGS_TABLE => array(
- 'message_subject' => array('STEXT_UNI', ''),
- ),
- TOPICS_TABLE => array(
- 'topic_title' => array('STEXT_UNI', '', 'true_sort'),
- 'topic_last_post_subject' => array('STEXT_UNI', ''),
- ),
- ),
- 'drop_keys' => array(
- SESSIONS_TABLE => array('session_forum_id'),
- ),
- 'add_index' => array(
- SESSIONS_TABLE => array(
- 'session_fid' => array('session_forum_id'),
- ),
- ),
- ),
- // No changes from 3.0.2-RC2 to 3.0.2
- '3.0.2-RC2' => array(),
-
- // Changes from 3.0.2 to 3.0.3-RC1
- '3.0.2' => array(
- // Add the following columns
- 'add_columns' => array(
- STYLES_TEMPLATE_TABLE => array(
- 'template_inherits_id' => array('UINT:4', 0),
- 'template_inherit_path' => array('VCHAR', ''),
- ),
- GROUPS_TABLE => array(
- 'group_max_recipients' => array('UINT', 0),
- ),
- ),
- ),
-
- // No changes from 3.0.3-RC1 to 3.0.3
- '3.0.3-RC1' => array(),
-
- // Changes from 3.0.3 to 3.0.4-RC1
- '3.0.3' => array(
- 'add_columns' => array(
- PROFILE_FIELDS_TABLE => array(
- 'field_show_profile' => array('BOOL', 0),
- ),
- ),
- 'change_columns' => array(
- STYLES_TABLE => array(
- 'style_id' => array('UINT', NULL, 'auto_increment'),
- 'template_id' => array('UINT', 0),
- 'theme_id' => array('UINT', 0),
- 'imageset_id' => array('UINT', 0),
- ),
- STYLES_IMAGESET_TABLE => array(
- 'imageset_id' => array('UINT', NULL, 'auto_increment'),
- ),
- STYLES_IMAGESET_DATA_TABLE => array(
- 'image_id' => array('UINT', NULL, 'auto_increment'),
- 'imageset_id' => array('UINT', 0),
- ),
- STYLES_THEME_TABLE => array(
- 'theme_id' => array('UINT', NULL, 'auto_increment'),
- ),
- STYLES_TEMPLATE_TABLE => array(
- 'template_id' => array('UINT', NULL, 'auto_increment'),
- ),
- STYLES_TEMPLATE_DATA_TABLE => array(
- 'template_id' => array('UINT', 0),
- ),
- FORUMS_TABLE => array(
- 'forum_style' => array('USINT', 0),
- ),
- USERS_TABLE => array(
- 'user_style' => array('UINT', 0),
- ),
- ),
- ),
+// To let set_config() calls succeed, we need to make the config array available globally
+$config = array();
- // Changes from 3.0.4-RC1 to 3.0.4
- '3.0.4-RC1' => array(),
-
- // Changes from 3.0.4 to 3.0.5-dev
- '3.0.4' => array(),
-);
+$sql = 'SELECT *
+ FROM ' . CONFIG_TABLE;
+$result = $db->sql_query($sql);
-// Determine mapping database type
-switch ($db->sql_layer)
+while ($row = $db->sql_fetchrow($result))
{
- case 'mysql':
- $map_dbms = 'mysql_40';
- break;
-
- case 'mysql4':
- if (version_compare($db->sql_server_info(true), '4.1.3', '>='))
- {
- $map_dbms = 'mysql_41';
- }
- else
- {
- $map_dbms = 'mysql_40';
- }
- break;
+ $config[$row['config_name']] = $row['config_value'];
+}
+$db->sql_freeresult($result);
- case 'mysqli':
- $map_dbms = 'mysql_41';
- break;
+// Include DB Tools
+include($phpbb_root_path . 'includes/db/db_tools.' . $phpEx);
- case 'mssql':
- case 'mssql_odbc':
- $map_dbms = 'mssql';
- break;
+$db_tools = new phpbb_db_tools($db, true);
- default:
- $map_dbms = $db->sql_layer;
- break;
-}
+$database_update_info = database_update_info();
$error_ary = array();
$errored = false;
@@ -657,7 +193,7 @@ header('Content-type: text/html; charset=UTF-8');
-
+
@@ -666,22 +202,10 @@ header('Content-type: text/html; charset=UTF-8');
:: sql_layer; ?>
sql_query($sql);
-
-while ($row = $db->sql_fetchrow($result))
-{
- $config[$row['config_name']] = $row['config_value'];
-}
-$db->sql_freeresult($result);
-
-/*if ($debug_from_version !== false)
+if ($debug_from_version !== false)
{
$config['version'] = $debug_from_version;
-}*/
+}
echo $lang['PREVIOUS_VERSION'] . ' :: ' . $config['version'] . '
';
echo $lang['UPDATED_VERSION'] . ' :: ' . $updates_to_version . '
';
@@ -690,6 +214,61 @@ $current_version = str_replace('rc', 'RC', strtolower($config['version']));
$latest_version = str_replace('rc', 'RC', strtolower($updates_to_version));
$orig_version = $config['version'];
+// Fill DB version
+if (empty($config['dbms_version']))
+{
+ set_config('dbms_version', $db->sql_server_info(true));
+}
+
+// MySQL update from MySQL 3.x/4.x to > 4.1.x required?
+if ($db->sql_layer == 'mysql' || $db->sql_layer == 'mysql4' || $db->sql_layer == 'mysqli')
+{
+ // Verify by fetching column... if the column type matches the new type we update dbms_version...
+ $sql = "SHOW COLUMNS FROM " . CONFIG_TABLE;
+ $result = $db->sql_query($sql);
+
+ $column_type = '';
+ while ($row = $db->sql_fetchrow($result))
+ {
+ $field = strtolower($row['Field']);
+
+ if ($field == 'config_value')
+ {
+ $column_type = strtolower($row['Type']);
+ break;
+ }
+ }
+ $db->sql_freeresult($result);
+
+ // If column type is blob, but mysql version says we are on > 4.1.3, then the schema needs an update
+ if (strpos($column_type, 'blob') !== false && version_compare($db->sql_server_info(true), '4.1.3', '>='))
+ {
+ echo '
';
+ echo '
' . $lang['ERROR'] . '
';
+
+ echo '
' . sprintf($lang['MYSQL_SCHEMA_UPDATE_REQUIRED'], $config['dbms_version'], $db->sql_server_info(true)) . '
';
+?>
+
+
+
+
+
+
+
+
+
+
+