From d78bb2865b27aa753b165fdc8aaa73ed82eaeac8 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Sat, 22 Nov 2014 02:15:06 +0100 Subject: [ticket/13421] Always require the interface when possible PHPBB3-13421 --- phpBB/phpbb/db/migration/migration.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/migration.php b/phpBB/phpbb/db/migration/migration.php index 5f120333e1..6cf7685350 100644 --- a/phpBB/phpbb/db/migration/migration.php +++ b/phpBB/phpbb/db/migration/migration.php @@ -28,7 +28,7 @@ abstract class migration /** @var \phpbb\db\driver\driver_interface */ protected $db; - /** @var \phpbb\db\tools */ + /** @var \phpbb\db\tools_interface */ protected $db_tools; /** @var string */ @@ -51,12 +51,12 @@ abstract class migration * * @param \phpbb\config\config $config * @param \phpbb\db\driver\driver_interface $db - * @param \phpbb\db\tools $db_tools + * @param \phpbb\db\tools_interface $db_tools * @param string $phpbb_root_path * @param string $php_ext * @param string $table_prefix */ - public function __construct(\phpbb\config\config $config, \phpbb\db\driver\driver_interface $db, \phpbb\db\tools $db_tools, $phpbb_root_path, $php_ext, $table_prefix) + public function __construct(\phpbb\config\config $config, \phpbb\db\driver\driver_interface $db, \phpbb\db\tools_interface $db_tools, $phpbb_root_path, $php_ext, $table_prefix) { $this->config = $config; $this->db = $db; -- cgit v1.2.1 From ec90f2b380a598a3dbf7ada0e95878d9d1b85cbe Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Sat, 6 Dec 2014 16:34:02 +0100 Subject: [ticket/13421] Move tools to subdirectory PHPBB3-13421 --- phpBB/phpbb/db/migration/data/v30x/release_3_0_9_rc1.php | 2 +- phpBB/phpbb/db/migration/migration.php | 6 +++--- phpBB/phpbb/db/migration/schema_generator.php | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_9_rc1.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_9_rc1.php index 06e46d522f..5f928df47c 100644 --- a/phpBB/phpbb/db/migration/data/v30x/release_3_0_9_rc1.php +++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_9_rc1.php @@ -34,7 +34,7 @@ class release_3_0_9_rc1 extends \phpbb\db\migration\migration // this column was removed from the database updater // after 3.0.9-RC3 was released. It might still exist // in 3.0.9-RCX installations and has to be dropped as - // soon as the db_tools class is capable of properly + // soon as the \phpbb\db\tools\tools class is capable of properly // removing a primary key. // 'attempt_id' => array('UINT', NULL, 'auto_increment'), 'attempt_ip' => array('VCHAR:40', ''), diff --git a/phpBB/phpbb/db/migration/migration.php b/phpBB/phpbb/db/migration/migration.php index 6cf7685350..2304c8e44c 100644 --- a/phpBB/phpbb/db/migration/migration.php +++ b/phpBB/phpbb/db/migration/migration.php @@ -28,7 +28,7 @@ abstract class migration /** @var \phpbb\db\driver\driver_interface */ protected $db; - /** @var \phpbb\db\tools_interface */ + /** @var \phpbb\db\tools\tools_interface */ protected $db_tools; /** @var string */ @@ -51,12 +51,12 @@ abstract class migration * * @param \phpbb\config\config $config * @param \phpbb\db\driver\driver_interface $db - * @param \phpbb\db\tools_interface $db_tools + * @param \phpbb\db\tools\tools_interface $db_tools * @param string $phpbb_root_path * @param string $php_ext * @param string $table_prefix */ - public function __construct(\phpbb\config\config $config, \phpbb\db\driver\driver_interface $db, \phpbb\db\tools_interface $db_tools, $phpbb_root_path, $php_ext, $table_prefix) + public function __construct(\phpbb\config\config $config, \phpbb\db\driver\driver_interface $db, \phpbb\db\tools\tools_interface $db_tools, $phpbb_root_path, $php_ext, $table_prefix) { $this->config = $config; $this->db = $db; diff --git a/phpBB/phpbb/db/migration/schema_generator.php b/phpBB/phpbb/db/migration/schema_generator.php index 91d8307d91..7003844bc4 100644 --- a/phpBB/phpbb/db/migration/schema_generator.php +++ b/phpBB/phpbb/db/migration/schema_generator.php @@ -24,7 +24,7 @@ class schema_generator /** @var \phpbb\db\driver\driver_interface */ protected $db; - /** @var \phpbb\db\tools */ + /** @var \phpbb\db\tools\tools_interface */ protected $db_tools; /** @var array */ @@ -48,7 +48,7 @@ class schema_generator /** * Constructor */ - public function __construct(array $class_names, \phpbb\config\config $config, \phpbb\db\driver\driver_interface $db, \phpbb\db\tools $db_tools, $phpbb_root_path, $php_ext, $table_prefix) + public function __construct(array $class_names, \phpbb\config\config $config, \phpbb\db\driver\driver_interface $db, \phpbb\db\tools\tools_interface $db_tools, $phpbb_root_path, $php_ext, $table_prefix) { $this->config = $config; $this->db = $db; -- cgit v1.2.1 From b5544b2f471ce4c93b08d19919ab062725545ce8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gae=CC=88tan=20Muller?= Date: Sat, 3 Jan 2015 11:39:29 +0100 Subject: [ticket/13450] Type-hint return value of $phpbb_container->get() PHPBB3-13450 --- phpBB/phpbb/db/migration/data/v30x/release_3_0_5_rc1.php | 1 + phpBB/phpbb/db/migration/profilefield_base_migration.php | 2 ++ 2 files changed, 3 insertions(+) (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_5_rc1.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_5_rc1.php index 2cc7786046..20543463ab 100644 --- a/phpBB/phpbb/db/migration/data/v30x/release_3_0_5_rc1.php +++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_5_rc1.php @@ -57,6 +57,7 @@ class release_3_0_5_rc1 extends \phpbb\db\migration\migration { global $phpbb_container; + /* @var $passwords_manager \phpbb\passwords\manager */ $passwords_manager = $phpbb_container->get('passwords.manager'); $sql = 'SELECT user_id, user_password FROM ' . $this->table_prefix . 'users diff --git a/phpBB/phpbb/db/migration/profilefield_base_migration.php b/phpBB/phpbb/db/migration/profilefield_base_migration.php index 9000949a7d..bc3d2e9ee5 100644 --- a/phpBB/phpbb/db/migration/profilefield_base_migration.php +++ b/phpBB/phpbb/db/migration/profilefield_base_migration.php @@ -238,6 +238,8 @@ abstract class profilefield_base_migration extends \phpbb\db\migration\migration if ($profile_row === null) { global $phpbb_container; + + /* @var $manager \phpbb\profilefields\manager */ $manager = $phpbb_container->get('profilefields.manager'); $profile_row = $manager->build_insert_sql_array(array()); } -- cgit v1.2.1 From 7fc586080bf5e7b6e90dcf44526200d7c9356d57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gae=CC=88tan=20Muller?= Date: Mon, 5 Jan 2015 22:21:31 +0100 Subject: [ticket/13468] Update calls to `add_log()` PHPBB3-13468 --- phpBB/phpbb/db/migration/tool/module.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/tool/module.php b/phpBB/phpbb/db/migration/tool/module.php index 035625b095..b6f0372181 100644 --- a/phpBB/phpbb/db/migration/tool/module.php +++ b/phpBB/phpbb/db/migration/tool/module.php @@ -171,6 +171,8 @@ class module implements \phpbb\db\migration\tool\tool_interface */ public function add($class, $parent = 0, $data = array()) { + global $user, $phpbb_log; + // Allows '' to be sent as 0 $parent = $parent ?: 0; @@ -266,7 +268,7 @@ class module implements \phpbb\db\migration\tool\tool_interface { // Success $module_log_name = ((isset($this->user->lang[$data['module_langname']])) ? $this->user->lang[$data['module_langname']] : $data['module_langname']); - add_log('admin', 'LOG_MODULE_ADD', $module_log_name); + $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_MODULE_ADD', false, array($module_log_name)); // Move the module if requested above/below an existing one if (isset($data['before']) && $data['before']) -- cgit v1.2.1 From 79d4ff553844fa80be4da9286239f62a45489072 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gae=CC=88tan=20Muller?= Date: Sun, 11 Jan 2015 17:32:31 +0100 Subject: [ticket/13494] Update calls to `set_config()` PHPBB3-13494 --- phpBB/phpbb/db/migration/data/v310/style_update_p1.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v310/style_update_p1.php b/phpBB/phpbb/db/migration/data/v310/style_update_p1.php index e8d3a3af64..918a565e06 100644 --- a/phpBB/phpbb/db/migration/data/v310/style_update_p1.php +++ b/phpBB/phpbb/db/migration/data/v310/style_update_p1.php @@ -62,6 +62,8 @@ class style_update_p1 extends \phpbb\db\migration\migration public function styles_update() { + global $config; + // Get list of valid 3.1 styles $available_styles = array('prosilver'); @@ -163,7 +165,7 @@ class style_update_p1 extends \phpbb\db\migration\migration $default_style = $this->db->sql_fetchfield($result); $this->db->sql_freeresult($result); - set_config('default_style', $default_style); + $config->set('default_style', $default_style); $sql = 'UPDATE ' . USERS_TABLE . ' SET user_style = 0'; $this->sql_query($sql); -- cgit v1.2.1 From 77ee0e62ca1685e4577947cc60163367dfa97de6 Mon Sep 17 00:00:00 2001 From: MateBartus Date: Sun, 31 May 2015 13:21:45 +0200 Subject: [ticket/13777] Use module manager in phpBB core files PHPBB3-13777 --- .../migration/data/v310/acp_prune_users_module.php | 11 ++--- phpBB/phpbb/db/migration/data/v310/dev.php | 11 ++--- phpBB/phpbb/db/migration/tool/module.php | 55 +++++++--------------- 3 files changed, 24 insertions(+), 53 deletions(-) (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v310/acp_prune_users_module.php b/phpBB/phpbb/db/migration/data/v310/acp_prune_users_module.php index 0ca4f2f19c..725c57ca86 100644 --- a/phpBB/phpbb/db/migration/data/v310/acp_prune_users_module.php +++ b/phpBB/phpbb/db/migration/data/v310/acp_prune_users_module.php @@ -13,7 +13,7 @@ namespace phpbb\db\migration\data\v310; -class acp_prune_users_module extends \phpbb\db\migration\migration +class acp_prune_users_module extends \phpbb\db\migration\container_aware_migration { public function effectively_installed() { @@ -70,12 +70,7 @@ class acp_prune_users_module extends \phpbb\db\migration\migration $acp_cat_users_id = (int) $this->db->sql_fetchfield('module_id'); $this->db->sql_freeresult($result); - if (!class_exists('\acp_modules')) - { - include($this->phpbb_root_path . 'includes/acp/acp_modules.' . $this->php_ext); - } - $module_manager = new \acp_modules(); - $module_manager->module_class = 'acp'; - $module_manager->move_module($acp_prune_users_id, $acp_cat_users_id); + $module_manager = $this->container->get('module.manager'); + $module_manager->move_module($acp_prune_users_id, $acp_cat_users_id, 'acp'); } } diff --git a/phpBB/phpbb/db/migration/data/v310/dev.php b/phpBB/phpbb/db/migration/data/v310/dev.php index f037191c2a..250258eea7 100644 --- a/phpBB/phpbb/db/migration/data/v310/dev.php +++ b/phpBB/phpbb/db/migration/data/v310/dev.php @@ -13,7 +13,7 @@ namespace phpbb\db\migration\data\v310; -class dev extends \phpbb\db\migration\migration +class dev extends \phpbb\db\migration\container_aware_migration { public function effectively_installed() { @@ -204,18 +204,13 @@ class dev extends \phpbb\db\migration\migration $language_management_module_id = $this->db->sql_fetchfield('module_id'); $this->db->sql_freeresult($result); - if (!class_exists('acp_modules')) - { - include($this->phpbb_root_path . 'includes/acp/acp_modules.' . $this->php_ext); - } // acp_modules calls adm_back_link, which is undefined at this point if (!function_exists('adm_back_link')) { include($this->phpbb_root_path . 'includes/functions_acp.' . $this->php_ext); } - $module_manager = new \acp_modules(); - $module_manager->module_class = 'acp'; - $module_manager->move_module($language_module_id, $language_management_module_id); + $module_manager = $this->container->get('module.manager'); + $module_manager->move_module($language_module_id, $language_management_module_id, 'acp'); } public function update_ucp_pm_basename() diff --git a/phpBB/phpbb/db/migration/tool/module.php b/phpBB/phpbb/db/migration/tool/module.php index b6f0372181..3b181872db 100644 --- a/phpBB/phpbb/db/migration/tool/module.php +++ b/phpBB/phpbb/db/migration/tool/module.php @@ -13,6 +13,8 @@ namespace phpbb\db\migration\tool; +use phpbb\module\exception\module_exception; + /** * Migration module management tool */ @@ -27,6 +29,9 @@ class module implements \phpbb\db\migration\tool\tool_interface /** @var \phpbb\user */ protected $user; + /** @var \phpbb\module\module_manager */ + protected $module_manager; + /** @var string */ protected $phpbb_root_path; @@ -42,15 +47,17 @@ class module implements \phpbb\db\migration\tool\tool_interface * @param \phpbb\db\driver\driver_interface $db * @param \phpbb\cache\service $cache * @param \phpbb\user $user + * @param \phpbb\module\module_manager $module_manager * @param string $phpbb_root_path * @param string $php_ext * @param string $modules_table */ - public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\cache\service $cache, \phpbb\user $user, $phpbb_root_path, $php_ext, $modules_table) + public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\cache\service $cache, \phpbb\user $user, \phpbb\module\module_manager $module_manager, $phpbb_root_path, $php_ext, $modules_table) { $this->db = $db; $this->cache = $cache; $this->user = $user; + $this->module_manager = $module_manager; $this->phpbb_root_path = $phpbb_root_path; $this->php_ext = $php_ext; $this->modules_table = $modules_table; @@ -188,7 +195,6 @@ class module implements \phpbb\db\migration\tool\tool_interface $basename = (isset($data['module_basename'])) ? $data['module_basename'] : ''; $module = $this->get_module_info($class, $basename); - $result = ''; foreach ($module['modes'] as $mode => $module_info) { if (!isset($data['modes']) || in_array($mode, $data['modes'])) @@ -239,13 +245,6 @@ class module implements \phpbb\db\migration\tool\tool_interface return; } - if (!class_exists('acp_modules')) - { - include($this->phpbb_root_path . 'includes/acp/acp_modules.' . $this->php_ext); - $this->user->add_lang('acp/modules'); - } - $acp_modules = new \acp_modules(); - $module_data = array( 'module_enabled' => (isset($data['module_enabled'])) ? $data['module_enabled'] : 1, 'module_display' => (isset($data['module_display'])) ? $data['module_display'] : 1, @@ -256,16 +255,11 @@ class module implements \phpbb\db\migration\tool\tool_interface 'module_mode' => (isset($data['module_mode'])) ? $data['module_mode'] : '', 'module_auth' => (isset($data['module_auth'])) ? $data['module_auth'] : '', ); - $result = $acp_modules->update_module_data($module_data, true); - // update_module_data can either return a string or an empty array... - if (is_string($result)) - { - // Error - throw new \phpbb\db\migration\exception('MODULE_ERROR', $result); - } - else + try { + $this->module_manager->update_module_data($module_data); + // Success $module_log_name = ((isset($this->user->lang[$data['module_langname']])) ? $this->user->lang[$data['module_langname']] : $data['module_langname']); $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_MODULE_ADD', false, array($module_log_name)); @@ -318,6 +312,11 @@ class module implements \phpbb\db\migration\tool\tool_interface $this->db->sql_query($sql); } } + catch (module_exception $e) + { + // Error + throw new \phpbb\db\migration\exception('MODULE_ERROR', $e->getMessage()); + } // Clear the Modules Cache $this->cache->destroy("_modules_$class"); @@ -417,21 +416,9 @@ class module implements \phpbb\db\migration\tool\tool_interface $module_ids[] = (int) $module; } - if (!class_exists('acp_modules')) - { - include($this->phpbb_root_path . 'includes/acp/acp_modules.' . $this->php_ext); - $this->user->add_lang('acp/modules'); - } - $acp_modules = new \acp_modules(); - $acp_modules->module_class = $class; - foreach ($module_ids as $module_id) { - $result = $acp_modules->delete_module($module_id); - if (!empty($result)) - { - return; - } + $this->module_manager->delete_module($module_id, $class); } $this->cache->destroy("_modules_$class"); @@ -474,13 +461,7 @@ class module implements \phpbb\db\migration\tool\tool_interface */ protected function get_module_info($class, $basename) { - if (!class_exists('acp_modules')) - { - include($this->phpbb_root_path . 'includes/acp/acp_modules.' . $this->php_ext); - $this->user->add_lang('acp/modules'); - } - $acp_modules = new \acp_modules(); - $module = $acp_modules->get_module_infos($basename, $class, true); + $module = $this->module_manager->get_module_infos($basename, $class, true); if (empty($module)) { -- cgit v1.2.1 From 4044b5df8997b720ef86955f9e660189962182ea Mon Sep 17 00:00:00 2001 From: MateBartus Date: Sun, 31 May 2015 16:03:11 +0200 Subject: [ticket/13777] Reorder get_module_infos() method's arguments PHPBB3-13777 --- phpBB/phpbb/db/migration/tool/module.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/tool/module.php b/phpBB/phpbb/db/migration/tool/module.php index 3b181872db..69ac71abb7 100644 --- a/phpBB/phpbb/db/migration/tool/module.php +++ b/phpBB/phpbb/db/migration/tool/module.php @@ -461,7 +461,7 @@ class module implements \phpbb\db\migration\tool\tool_interface */ protected function get_module_info($class, $basename) { - $module = $this->module_manager->get_module_infos($basename, $class, true); + $module = $this->module_manager->get_module_infos($class, $basename, true); if (empty($module)) { -- cgit v1.2.1 From be0d4e20d4be8bc3217e5d025058e065b8f2071a Mon Sep 17 00:00:00 2001 From: Nicofuma Date: Mon, 28 Apr 2014 14:00:27 +0200 Subject: [ticket/11444] Moving the in-board notifications to a method class Currently the in-board method for the notifications is hardcoded and cannot be disabled. This method should be in his own class extending `phpbb\notification\method\method_interface`. It also add the possibility, for each method, to be enabled by default (ie: no entry in the DB => notification enabled). https://tracker.phpbb.com/browse/PHPBB3-11444 https://tracker.phpbb.com/browse/PHPBB3-11967 PHPBB3-11444 --- .../db/migration/data/v310/notifications_board.php | 73 ++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v310/notifications_board.php (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v310/notifications_board.php b/phpBB/phpbb/db/migration/data/v310/notifications_board.php new file mode 100644 index 0000000000..525d94e984 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v310/notifications_board.php @@ -0,0 +1,73 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v310; + +class notifications_board extends \phpbb\db\migration\migration +{ + static public function depends_on() + { + return array('\phpbb\db\migration\data\v310\notifications'); + } + + public function update_data() + { + return array( + array('config.add', array('allow_board_notifications', 1)), + array('custom', array(array($this, 'update_user_subscriptions'))), + array('custom', array(array($this, 'update_module'))), + ); + } + + public function update_module() + { + $sql = 'UPDATE ' . MODULES_TABLE . " + SET auth = 'cfg_allow_board_notifications' + WHERE module_basename = 'ucp_notifications' + AND module_mode = 'notification_list'"; + $this->sql_query($sql); + } + + public function update_user_subscriptions() + { + $sql = 'UPDATE ' . USER_NOTIFICATIONS_TABLE . " + SET method = 'notification.method.board' + WHERE method = ''"; + $this->sql_query($sql); + } + + public function revert_data() + { + return array( + array('custom', array(array($this, 'revert_user_subscriptions'))), + array('custom', array(array($this, 'revert_module'))), + ); + } + + public function revert_user_subscriptions() + { + $sql = 'UPDATE ' . USER_NOTIFICATIONS_TABLE . " + SET method = '' + WHERE method = 'notification.method.board'"; + $this->sql_query($sql); + } + + public function revert_module() + { + $sql = 'UPDATE ' . MODULES_TABLE . " + SET auth = '' + WHERE module_basename = 'ucp_notifications' + AND module_mode = 'notification_list'"; + $this->sql_query($sql); + } +} -- cgit v1.2.1 From da7fc9e5daf6e72f9b86dbc5e002febb202f516e Mon Sep 17 00:00:00 2001 From: JoshyPHP Date: Wed, 10 Jun 2015 15:11:27 +0200 Subject: [ticket/13935] Allow more admin-configurable schemes in post links PHPBB3-13935 --- .../migration/data/v320/allowed_schemes_links.php | 24 ++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v320/allowed_schemes_links.php (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v320/allowed_schemes_links.php b/phpBB/phpbb/db/migration/data/v320/allowed_schemes_links.php new file mode 100644 index 0000000000..de127e3745 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v320/allowed_schemes_links.php @@ -0,0 +1,24 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v320; + +class allowed_schemes_links extends \phpbb\db\migration\migration +{ + public function update_data() + { + return array( + array('config.add', array('allowed_schemes_links', 'http,https,ftp')), + ); + } +} -- cgit v1.2.1 From df56b2ed364e24f803047c9f64d168432ba2680c Mon Sep 17 00:00:00 2001 From: Oliver Schramm Date: Wed, 16 Jul 2014 18:30:27 +0200 Subject: [ticket/8708] Add f_announce_global permission PHPBB3-8708 --- .../data/v320/announce_global_permission.php | 41 ++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v320/announce_global_permission.php (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v320/announce_global_permission.php b/phpBB/phpbb/db/migration/data/v320/announce_global_permission.php new file mode 100644 index 0000000000..fe30a1c1b8 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v320/announce_global_permission.php @@ -0,0 +1,41 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v320; + +class announce_global_permission extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + $sql = 'SELECT auth_option_id + FROM ' . ACL_OPTIONS_TABLE . " + WHERE auth_option = 'f_announce_global'"; + $result = $this->db->sql_query($sql); + $auth_option_id = $this->db->sql_fetchfield('auth_option_id'); + $this->db->sql_freeresult($result); + + return $auth_option_id !== false; + } + + static public function depends_on() + { + return array('\phpbb\db\migration\data\v310\rc2'); + } + + public function update_data() + { + return array( + array('permission.add', array('f_announce_global', false, 'f_announce')), + ); + } +} -- cgit v1.2.1 From 1f16704d347277ca1923bd2e532bc25bafacf51c Mon Sep 17 00:00:00 2001 From: n-aleha Date: Sat, 18 Jul 2015 02:12:12 +0300 Subject: [ticket/12505] Add migration PHPBB3-12505 --- .../migration/data/v320/remove_outdated_media.php | 83 ++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v320/remove_outdated_media.php (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v320/remove_outdated_media.php b/phpBB/phpbb/db/migration/data/v320/remove_outdated_media.php new file mode 100644 index 0000000000..b2a0a79187 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v320/remove_outdated_media.php @@ -0,0 +1,83 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v320; + +class remove_outdated_media extends \phpbb\db\migration\migration +{ + protected $cat_id = array( + ATTACHMENT_CATEGORY_WM, + ATTACHMENT_CATEGORY_RM, + ATTACHMENT_CATEGORY_QUICKTIME, + ); + + public function update_data() + { + return array( + array('custom', array(array($this, 'change_extension_group'))), + ); + } + + public function change_extension_group() + { + // select group ids of outdated media + $sql = 'SELECT group_id + FROM ' . EXTENSION_GROUPS_TABLE . ' + WHERE ' . $this->db->sql_in_set('cat_id', $cat_id); + $result = $this->db->sql_query($sql); + + $group_ids = array(); + while ($group_id = (int) $this->db->sql_fetchfield('group_id')) + { + $group_ids[] = $group_id; + } + $this->db->sql_freeresult($result); + + // nothing to do, admin has removed all the outdated media extension groups + if (empty($group_ids)) + { + return true; + } + + // get the group id of downloadable files + $sql = 'SELECT group_id + FROM ' . EXTENSION_GROUPS_TABLE . " + WHERE group_name = 'DOWNLOADABLE_FILES'"; + $result = $this->db->sql_query($sql); + $download_id = (int) $this->db->sql_fetchfield('group_id'); + $this->db->sql_freeresult($result); + + if (empty($download_id)) + { + $sql = 'UPDATE ' . EXTENSIONS_TABLE . ' + SET group_id = 0 + WHERE ' . $this->db->sql_in_set('group_id', $group_ids); + } + else + { + // move outdated media extensions to downloadable files + $sql = 'UPDATE ' . EXTENSIONS_TABLE . " + SET group_id = $download_id" . ' + WHERE ' . $this->db->sql_in_set('group_id', $group_ids); + } + + $result = $this->db->sql_query($sql); + $this->db->sql_freeresult($result); + + // delete the now empty, outdated media extension groups + $sql = 'DELETE FROM ' . EXTENSION_GROUPS_TABLE . ' + WHERE ' . $this->db->sql_in_set('group_id', $group_ids); + $result = $this->db->sql_query($sql); + $this->db->sql_freeresult($result); + } +} -- cgit v1.2.1 From afccb9cb49ce8e96079d3f0b1ea1f9084194a316 Mon Sep 17 00:00:00 2001 From: n-aleha Date: Tue, 21 Jul 2015 00:42:34 +0300 Subject: [ticket/12505] Fix variable usage in migration file PHPBB3-12505 --- phpBB/phpbb/db/migration/data/v320/remove_outdated_media.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v320/remove_outdated_media.php b/phpBB/phpbb/db/migration/data/v320/remove_outdated_media.php index b2a0a79187..59208be4dc 100644 --- a/phpBB/phpbb/db/migration/data/v320/remove_outdated_media.php +++ b/phpBB/phpbb/db/migration/data/v320/remove_outdated_media.php @@ -33,7 +33,7 @@ class remove_outdated_media extends \phpbb\db\migration\migration // select group ids of outdated media $sql = 'SELECT group_id FROM ' . EXTENSION_GROUPS_TABLE . ' - WHERE ' . $this->db->sql_in_set('cat_id', $cat_id); + WHERE ' . $this->db->sql_in_set('cat_id', $this->cat_id); $result = $this->db->sql_query($sql); $group_ids = array(); -- cgit v1.2.1 From 306fbf23a8113e6d9d7160e02889bd10ea24b495 Mon Sep 17 00:00:00 2001 From: Zoddo Date: Sun, 30 Aug 2015 16:22:26 +0200 Subject: [ticket/9485] Add a "View post" link in the moderation logs PHPBB3-9485 --- phpBB/phpbb/db/migration/data/v320/log_post_id.php | 44 ++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v320/log_post_id.php (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v320/log_post_id.php b/phpBB/phpbb/db/migration/data/v320/log_post_id.php new file mode 100644 index 0000000000..0f155d543c --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v320/log_post_id.php @@ -0,0 +1,44 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v320; + +class log_post_id extends \phpbb\db\migration\migration +{ + static public function depends_on() + { + return array('\phpbb\db\migration\data\v310\dev'); + } + + public function update_schema() + { + return array( + 'add_columns' => array( + $this->table_prefix . 'log' => array( + 'post_id' => array('UINT', 0, 'after' => 'topic_id'), + ), + ), + ); + } + + public function revert_schema() + { + return array( + 'drop_columns' => array( + $this->table_prefix . 'log' => array( + 'post_id', + ), + ), + ); + } +} -- cgit v1.2.1 From 956723af0ed94f79dbbeed2bcfc8617b2c73960e Mon Sep 17 00:00:00 2001 From: Michael Miday Date: Tue, 15 Sep 2015 22:23:24 +0200 Subject: [ticket/12769] Properly include FA --- .../db/migration/data/v320/font_awesome_update.php | 29 ++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v320/font_awesome_update.php (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v320/font_awesome_update.php b/phpBB/phpbb/db/migration/data/v320/font_awesome_update.php new file mode 100644 index 0000000000..6ffaf18b4a --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v320/font_awesome_update.php @@ -0,0 +1,29 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v320; + +class font_awesome_update extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return isset($this->config['load_font_awesome_url']); + } + + public function update_data() + { + return array( + array('config.add', array('load_font_awesome_url', 'https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css')), + ); + } +} -- cgit v1.2.1 From a7ba640ea778bf1936a035952f99b78497feef22 Mon Sep 17 00:00:00 2001 From: Tristan Darricau Date: Mon, 21 Sep 2015 10:46:48 +0200 Subject: [ticket/14182] Move v310\notifications_board migration to v320\... PHPBB3-14182 --- .../db/migration/data/v310/notifications_board.php | 73 ---------------------- .../db/migration/data/v320/notifications_board.php | 73 ++++++++++++++++++++++ 2 files changed, 73 insertions(+), 73 deletions(-) delete mode 100644 phpBB/phpbb/db/migration/data/v310/notifications_board.php create mode 100644 phpBB/phpbb/db/migration/data/v320/notifications_board.php (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v310/notifications_board.php b/phpBB/phpbb/db/migration/data/v310/notifications_board.php deleted file mode 100644 index 525d94e984..0000000000 --- a/phpBB/phpbb/db/migration/data/v310/notifications_board.php +++ /dev/null @@ -1,73 +0,0 @@ - -* @license GNU General Public License, version 2 (GPL-2.0) -* -* For full copyright and license information, please see -* the docs/CREDITS.txt file. -* -*/ - -namespace phpbb\db\migration\data\v310; - -class notifications_board extends \phpbb\db\migration\migration -{ - static public function depends_on() - { - return array('\phpbb\db\migration\data\v310\notifications'); - } - - public function update_data() - { - return array( - array('config.add', array('allow_board_notifications', 1)), - array('custom', array(array($this, 'update_user_subscriptions'))), - array('custom', array(array($this, 'update_module'))), - ); - } - - public function update_module() - { - $sql = 'UPDATE ' . MODULES_TABLE . " - SET auth = 'cfg_allow_board_notifications' - WHERE module_basename = 'ucp_notifications' - AND module_mode = 'notification_list'"; - $this->sql_query($sql); - } - - public function update_user_subscriptions() - { - $sql = 'UPDATE ' . USER_NOTIFICATIONS_TABLE . " - SET method = 'notification.method.board' - WHERE method = ''"; - $this->sql_query($sql); - } - - public function revert_data() - { - return array( - array('custom', array(array($this, 'revert_user_subscriptions'))), - array('custom', array(array($this, 'revert_module'))), - ); - } - - public function revert_user_subscriptions() - { - $sql = 'UPDATE ' . USER_NOTIFICATIONS_TABLE . " - SET method = '' - WHERE method = 'notification.method.board'"; - $this->sql_query($sql); - } - - public function revert_module() - { - $sql = 'UPDATE ' . MODULES_TABLE . " - SET auth = '' - WHERE module_basename = 'ucp_notifications' - AND module_mode = 'notification_list'"; - $this->sql_query($sql); - } -} diff --git a/phpBB/phpbb/db/migration/data/v320/notifications_board.php b/phpBB/phpbb/db/migration/data/v320/notifications_board.php new file mode 100644 index 0000000000..fd9f1a2ad6 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v320/notifications_board.php @@ -0,0 +1,73 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v320; + +class notifications_board extends \phpbb\db\migration\migration +{ + static public function depends_on() + { + return array('\phpbb\db\migration\data\v310\notifications'); + } + + public function update_data() + { + return array( + array('config.add', array('allow_board_notifications', 1)), + array('custom', array(array($this, 'update_user_subscriptions'))), + array('custom', array(array($this, 'update_module'))), + ); + } + + public function update_module() + { + $sql = 'UPDATE ' . MODULES_TABLE . " + SET auth = 'cfg_allow_board_notifications' + WHERE module_basename = 'ucp_notifications' + AND module_mode = 'notification_list'"; + $this->sql_query($sql); + } + + public function update_user_subscriptions() + { + $sql = 'UPDATE ' . USER_NOTIFICATIONS_TABLE . " + SET method = 'notification.method.board' + WHERE method = ''"; + $this->sql_query($sql); + } + + public function revert_data() + { + return array( + array('custom', array(array($this, 'revert_user_subscriptions'))), + array('custom', array(array($this, 'revert_module'))), + ); + } + + public function revert_user_subscriptions() + { + $sql = 'UPDATE ' . USER_NOTIFICATIONS_TABLE . " + SET method = '' + WHERE method = 'notification.method.board'"; + $this->sql_query($sql); + } + + public function revert_module() + { + $sql = 'UPDATE ' . MODULES_TABLE . " + SET auth = '' + WHERE module_basename = 'ucp_notifications' + AND module_mode = 'notification_list'"; + $this->sql_query($sql); + } +} -- cgit v1.2.1 From 21201aa1ab6dd94534c6f87f235d312d07d1db24 Mon Sep 17 00:00:00 2001 From: Zoddo Date: Sun, 13 Sep 2015 14:43:50 +0200 Subject: [ticket/13101] Remove existing MSN/WLM custom profile field PHPBB3-13101 --- .../data/v320/remove_profilefield_wlm.php | 150 +++++++++++++++++++++ 1 file changed, 150 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v320/remove_profilefield_wlm.php (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v320/remove_profilefield_wlm.php b/phpBB/phpbb/db/migration/data/v320/remove_profilefield_wlm.php new file mode 100644 index 0000000000..2898c708f8 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v320/remove_profilefield_wlm.php @@ -0,0 +1,150 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v320; + +class remove_profilefield_wlm extends \phpbb\db\migration\migration +{ + static public function depends_on() + { + return array('\phpbb\db\migration\data\v310\profilefield_wlm'); + } + + public function update_schema() + { + return array( + 'drop_columns' => array( + $this->table_prefix . 'profile_fields_data' => array( + 'pf_phpbb_wlm', + ), + ), + ); + } + + public function revert_schema() + { + return array( + 'add_columns' => array( + $this->table_prefix . 'profile_fields_data' => array( + 'pf_phpbb_wlm' => array('VCHAR', ''), + ), + ), + ); + } + + public function update_data() + { + return array( + array('custom', array(array($this, 'delete_custom_profile_field_data'))), + ); + } + + public function revert_data() + { + return array( + array('custom', array(array($this, 'create_custom_field'))), + ); + } + + public function delete_custom_profile_field_data() + { + $field_id = $this->get_custom_profile_field_id(); + + $sql = 'DELETE FROM ' . PROFILE_FIELDS_TABLE . ' + WHERE field_id = ' . (int) $field_id; + $this->db->sql_query($sql); + + $sql = 'DELETE FROM ' . PROFILE_LANG_TABLE . ' + WHERE field_id = ' . (int) $field_id; + $this->db->sql_query($sql); + + $sql = 'DELETE FROM ' . PROFILE_FIELDS_LANG_TABLE . ' + WHERE field_id = ' . (int) $field_id; + $this->db->sql_query($sql); + } + + /** + * Get custom profile field id + * @return int custom profile filed id + */ + public function get_custom_profile_field_id() + { + $sql = 'SELECT field_id + FROM ' . PROFILE_FIELDS_TABLE . " + WHERE field_name = 'phpbb_wlm'"; + $result = $this->db->sql_query($sql); + $field_id = (int) $this->db->sql_fetchfield('field_id'); + $this->db->sql_freeresult($result); + + return $field_id; + } + + public function create_custom_field() + { + $sql = 'SELECT MAX(field_order) as max_field_order + FROM ' . PROFILE_FIELDS_TABLE; + $result = $this->db->sql_query($sql); + $max_field_order = (int) $this->db->sql_fetchfield('max_field_order'); + $this->db->sql_freeresult($result); + + $sql_ary = array( + 'field_name' => 'phpbb_wlm', + 'field_type' => 'profilefields.type.string', + 'field_ident' => 'phpbb_wlm', + 'field_length' => '40', + 'field_minlen' => '5', + 'field_maxlen' => '255', + 'field_novalue' => '', + 'field_default_value' => '', + 'field_validation' => '.*', + 'field_required' => 0, + 'field_show_novalue' => 0, + 'field_show_on_reg' => 0, + 'field_show_on_pm' => 1, + 'field_show_on_vt' => 1, + 'field_show_on_ml' => 0, + 'field_show_profile' => 1, + 'field_hide' => 0, + 'field_no_view' => 0, + 'field_active' => 1, + 'field_is_contact' => 1, + 'field_contact_desc' => '', + 'field_contact_url' => '', + 'field_order' => $max_field_order + 1, + ); + + $sql = 'INSERT INTO ' . PROFILE_FIELDS_TABLE . ' ' . $this->db->sql_build_array('INSERT', $sql_ary); + $this->db->sql_query($sql); + $field_id = (int) $this->db->sql_nextid(); + + $insert_buffer = new \phpbb\db\sql_insert_buffer($this->db, PROFILE_LANG_TABLE); + + $sql = 'SELECT lang_id + FROM ' . LANG_TABLE; + $result = $this->db->sql_query($sql); + $lang_name = 'WLM'; + while ($lang_id = (int) $this->db->sql_fetchfield('lang_id')) + { + $insert_buffer->insert(array( + 'field_id' => (int) $field_id, + 'lang_id' => (int) $lang_id, + 'lang_name' => $lang_name, + 'lang_explain' => '', + 'lang_default_value' => '', + )); + } + $this->db->sql_freeresult($result); + + $insert_buffer->flush(); + } +} -- cgit v1.2.1 From 3937f1f4ae77b29faf69292783cc3ae267785ee4 Mon Sep 17 00:00:00 2001 From: Zoddo Date: Sat, 12 Sep 2015 00:53:33 +0200 Subject: [ticket/14157] Allow to set the alt/title attribute on post icons PHPBB3-14157 --- phpBB/phpbb/db/migration/data/v320/icons_alt.php | 44 ++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v320/icons_alt.php (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v320/icons_alt.php b/phpBB/phpbb/db/migration/data/v320/icons_alt.php new file mode 100644 index 0000000000..7071ae78db --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v320/icons_alt.php @@ -0,0 +1,44 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v320; + +class icons_alt extends \phpbb\db\migration\migration +{ + static public function depends_on() + { + return array('\phpbb\db\migration\data\v310\dev'); + } + + public function update_schema() + { + return array( + 'add_columns' => array( + $this->table_prefix . 'icons' => array( + 'icons_alt' => array('VCHAR', '', 'after' => 'icons_height'), + ), + ), + ); + } + + public function revert_schema() + { + return array( + 'drop_columns' => array( + $this->table_prefix . 'icons' => array( + 'icons_alt', + ), + ), + ); + } +} -- cgit v1.2.1 From 33500fd3728f6e3444d5479b09b941b2570ff47c Mon Sep 17 00:00:00 2001 From: Oliver Schramm Date: Sun, 25 Oct 2015 02:07:40 +0100 Subject: [ticket/14257] Use migrations instead of cron job for some reparsers PHPBB3-14257 --- .../phpbb/db/migration/data/v320/reparse_fast.php | 87 ++++++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v320/reparse_fast.php (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v320/reparse_fast.php b/phpBB/phpbb/db/migration/data/v320/reparse_fast.php new file mode 100644 index 0000000000..ddb11f7f67 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v320/reparse_fast.php @@ -0,0 +1,87 @@ + + * @license GNU General Public License, version 2 (GPL-2.0) + * + * For full copyright and license information, please see + * the docs/CREDITS.txt file. + * + */ + +namespace phpbb\db\migration\data\v320; + +class reparse_fast extends \phpbb\db\migration\container_aware_migration +{ + static public function depends_on() + { + return array('\phpbb\db\migration\data\v310\contact_admin_form'); + } + + public function effectively_installed() + { + return isset($this->config['reparse_lock']); + } + + public function update_data() + { + return array( + array('config.add', array('reparse_lock', 0, true)), + array('custom', array(array($this, 'reparse'))), + ); + } + + public function reparse($resume_data) + { + // Somtimes a cron job is too much + $limit = 200; + $fast_reparsers = array( + 'text_reparser.contact_admin_info', + 'text_reparser.forum_description', + 'text_reparser.forum_rules', + 'text_reparser.group_description', + ); + + if (!is_array($resume_data)) + { + $resume_data = array( + 'reparser' => 0, + 'current' => $this->container->get($fast_reparsers[0])->get_max_id(), + ); + } + + $fast_reparsers_size = sizeof($fast_reparsers); + $processed_records = 0; + while ($processed_records < $limit && $resume_data['reparser'] < $fast_reparsers_size) + { + $reparser = $this->container->get($fast_reparsers[$resume_data['reparser']]); + + // New reparser + if ($resume_data['current'] === 0) + { + $resume_data['current'] = $reparser->get_max_id(); + } + + $start = max(1, $resume_data['current'] + 1 - ($limit - $processed_records)); + $end = max(1, $resume_data['current']); + $reparser->reparse_range($start, $end); + + $processed_records = $end - $start + 1; + $resume_data['current'] = $start - 1; + + if ($start === 1) + { + $resume_data['reparser']++; + } + } + + if ($resume_data['reparser'] === $fast_reparsers_size) + { + return true; + } + + return $resume_data; + } +} -- cgit v1.2.1 From 25e2b17837f5b1c2330d07a86f88b25bb55d96c1 Mon Sep 17 00:00:00 2001 From: Oliver Schramm Date: Mon, 26 Oct 2015 01:39:52 +0100 Subject: [ticket/14257] Add text_reparser manager PHPBB3-14257 --- .../phpbb/db/migration/data/v320/reparse_fast.php | 87 ------------------ .../phpbb/db/migration/data/v320/text_reparser.php | 101 +++++++++++++++++++++ 2 files changed, 101 insertions(+), 87 deletions(-) delete mode 100644 phpBB/phpbb/db/migration/data/v320/reparse_fast.php create mode 100644 phpBB/phpbb/db/migration/data/v320/text_reparser.php (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v320/reparse_fast.php b/phpBB/phpbb/db/migration/data/v320/reparse_fast.php deleted file mode 100644 index ddb11f7f67..0000000000 --- a/phpBB/phpbb/db/migration/data/v320/reparse_fast.php +++ /dev/null @@ -1,87 +0,0 @@ - - * @license GNU General Public License, version 2 (GPL-2.0) - * - * For full copyright and license information, please see - * the docs/CREDITS.txt file. - * - */ - -namespace phpbb\db\migration\data\v320; - -class reparse_fast extends \phpbb\db\migration\container_aware_migration -{ - static public function depends_on() - { - return array('\phpbb\db\migration\data\v310\contact_admin_form'); - } - - public function effectively_installed() - { - return isset($this->config['reparse_lock']); - } - - public function update_data() - { - return array( - array('config.add', array('reparse_lock', 0, true)), - array('custom', array(array($this, 'reparse'))), - ); - } - - public function reparse($resume_data) - { - // Somtimes a cron job is too much - $limit = 200; - $fast_reparsers = array( - 'text_reparser.contact_admin_info', - 'text_reparser.forum_description', - 'text_reparser.forum_rules', - 'text_reparser.group_description', - ); - - if (!is_array($resume_data)) - { - $resume_data = array( - 'reparser' => 0, - 'current' => $this->container->get($fast_reparsers[0])->get_max_id(), - ); - } - - $fast_reparsers_size = sizeof($fast_reparsers); - $processed_records = 0; - while ($processed_records < $limit && $resume_data['reparser'] < $fast_reparsers_size) - { - $reparser = $this->container->get($fast_reparsers[$resume_data['reparser']]); - - // New reparser - if ($resume_data['current'] === 0) - { - $resume_data['current'] = $reparser->get_max_id(); - } - - $start = max(1, $resume_data['current'] + 1 - ($limit - $processed_records)); - $end = max(1, $resume_data['current']); - $reparser->reparse_range($start, $end); - - $processed_records = $end - $start + 1; - $resume_data['current'] = $start - 1; - - if ($start === 1) - { - $resume_data['reparser']++; - } - } - - if ($resume_data['reparser'] === $fast_reparsers_size) - { - return true; - } - - return $resume_data; - } -} diff --git a/phpBB/phpbb/db/migration/data/v320/text_reparser.php b/phpBB/phpbb/db/migration/data/v320/text_reparser.php new file mode 100644 index 0000000000..0d8fd2ebb5 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v320/text_reparser.php @@ -0,0 +1,101 @@ + + * @license GNU General Public License, version 2 (GPL-2.0) + * + * For full copyright and license information, please see + * the docs/CREDITS.txt file. + * + */ + +namespace phpbb\db\migration\data\v320; + +class text_reparser extends \phpbb\db\migration\container_aware_migration +{ + static public function depends_on() + { + return array('\phpbb\db\migration\data\v310\contact_admin_form'); + } + + public function effectively_installed() + { + return isset($this->config['reparse_lock']); + } + + public function update_data() + { + return array( + array('config.add', array('reparse_lock', 0, true)), + array('config.add', array('text_reparser.pm_text_cron_interval', 0)), + array('config.add', array('text_reparser.pm_text_last_cron', 0)), + array('config.add', array('text_reparser.poll_option_cron_interval', 0)), + array('config.add', array('text_reparser.poll_option_last_cron', 0)), + array('config.add', array('text_reparser.poll_title_cron_interval', 0)), + array('config.add', array('text_reparser.poll_title_last_cron', 0)), + array('config.add', array('text_reparser.post_text_cron_interval', 0)), + array('config.add', array('text_reparser.post_text_last_cron', 0)), + array('config.add', array('text_reparser.user_signature_cron_interval', 0)), + array('config.add', array('text_reparser.user_signature_last_cron', 0)), + array('custom', array(array($this, 'reparse'))), + ); + } + + public function reparse($resume_data) + { + // Somtimes a cron job is too much + $limit = 100; + $fast_reparsers = array( + 'text_reparser.contact_admin_info', + 'text_reparser.forum_description', + 'text_reparser.forum_rules', + 'text_reparser.group_description', + ); + + if (!is_array($resume_data)) + { + $resume_data = array( + 'reparser' => 0, + 'current' => $this->container->get($fast_reparsers[0])->get_max_id(), + ); + } + + $fast_reparsers_size = sizeof($fast_reparsers); + $processed_records = 0; + while ($processed_records < $limit && $resume_data['reparser'] < $fast_reparsers_size) + { + $reparser = $this->container->get($fast_reparsers[$resume_data['reparser']]); + + // New reparser + if ($resume_data['current'] === 0) + { + $resume_data['current'] = $reparser->get_max_id(); + } + + $start = max(1, $resume_data['current'] + 1 - ($limit - $processed_records)); + $end = max(1, $resume_data['current']); + $reparser->reparse_range($start, $end); + + $processed_records = $end - $start + 1; + $resume_data['current'] = $start - 1; + + if ($start === 1) + { + // Prevent CLI command from running these reparsers again + $reparser_manager = $this->container->get('text_reparser.manager'); + $reparser_manager->update_resume_data($fast_reparsers[$resume_data['reparser']], 1, 0, $limit); + + $resume_data['reparser']++; + } + } + + if ($resume_data['reparser'] === $fast_reparsers_size) + { + return true; + } + + return $resume_data; + } +} -- cgit v1.2.1 From 900ccd79af816d8d54e6974e9163d9999a823513 Mon Sep 17 00:00:00 2001 From: Oliver Schramm Date: Sun, 1 Nov 2015 03:49:01 +0100 Subject: [ticket/14257] Fix CLI reparser and set cron interval PHPBB3-14257 --- phpBB/phpbb/db/migration/data/v320/text_reparser.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v320/text_reparser.php b/phpBB/phpbb/db/migration/data/v320/text_reparser.php index 0d8fd2ebb5..1d73b74a76 100644 --- a/phpBB/phpbb/db/migration/data/v320/text_reparser.php +++ b/phpBB/phpbb/db/migration/data/v320/text_reparser.php @@ -29,15 +29,15 @@ class text_reparser extends \phpbb\db\migration\container_aware_migration { return array( array('config.add', array('reparse_lock', 0, true)), - array('config.add', array('text_reparser.pm_text_cron_interval', 0)), + array('config.add', array('text_reparser.pm_text_cron_interval', 10)), array('config.add', array('text_reparser.pm_text_last_cron', 0)), - array('config.add', array('text_reparser.poll_option_cron_interval', 0)), + array('config.add', array('text_reparser.poll_option_cron_interval', 10)), array('config.add', array('text_reparser.poll_option_last_cron', 0)), - array('config.add', array('text_reparser.poll_title_cron_interval', 0)), + array('config.add', array('text_reparser.poll_title_cron_interval', 10)), array('config.add', array('text_reparser.poll_title_last_cron', 0)), - array('config.add', array('text_reparser.post_text_cron_interval', 0)), + array('config.add', array('text_reparser.post_text_cron_interval', 10)), array('config.add', array('text_reparser.post_text_last_cron', 0)), - array('config.add', array('text_reparser.user_signature_cron_interval', 0)), + array('config.add', array('text_reparser.user_signature_cron_interval', 10)), array('config.add', array('text_reparser.user_signature_last_cron', 0)), array('custom', array(array($this, 'reparse'))), ); -- cgit v1.2.1 From e02432ec82a03539b94cad2814f2603d8bfe3a0b Mon Sep 17 00:00:00 2001 From: Mate Bartus Date: Sun, 8 Nov 2015 22:06:10 +0100 Subject: [ticket/14277] Fix undefined index error in migrations PHPBB3-14277 --- phpBB/phpbb/db/migration/tool/module.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/tool/module.php b/phpBB/phpbb/db/migration/tool/module.php index 69ac71abb7..7110760868 100644 --- a/phpBB/phpbb/db/migration/tool/module.php +++ b/phpBB/phpbb/db/migration/tool/module.php @@ -262,7 +262,7 @@ class module implements \phpbb\db\migration\tool\tool_interface // Success $module_log_name = ((isset($this->user->lang[$data['module_langname']])) ? $this->user->lang[$data['module_langname']] : $data['module_langname']); - $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_MODULE_ADD', false, array($module_log_name)); + $phpbb_log->add('admin', ANONYMOUS, $user->ip, 'LOG_MODULE_ADD', false, array($module_log_name)); // Move the module if requested above/below an existing one if (isset($data['before']) && $data['before']) -- cgit v1.2.1 From d04c7687c05b0474d3b3d42da94bc1383026ca7f Mon Sep 17 00:00:00 2001 From: Mate Bartus Date: Mon, 9 Nov 2015 09:11:03 +0100 Subject: [ticket/14277] Use user_id if available PHPBB3-14277 --- phpBB/phpbb/db/migration/tool/module.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/tool/module.php b/phpBB/phpbb/db/migration/tool/module.php index 7110760868..a5ed62fd65 100644 --- a/phpBB/phpbb/db/migration/tool/module.php +++ b/phpBB/phpbb/db/migration/tool/module.php @@ -262,7 +262,7 @@ class module implements \phpbb\db\migration\tool\tool_interface // Success $module_log_name = ((isset($this->user->lang[$data['module_langname']])) ? $this->user->lang[$data['module_langname']] : $data['module_langname']); - $phpbb_log->add('admin', ANONYMOUS, $user->ip, 'LOG_MODULE_ADD', false, array($module_log_name)); + $phpbb_log->add('admin', (isset($user->data['user_id'])) ? $user->data['user_id'] : ANONYMOUS, $user->ip, 'LOG_MODULE_ADD', false, array($module_log_name)); // Move the module if requested above/below an existing one if (isset($data['before']) && $data['before']) -- cgit v1.2.1 From 2144f35e9daf17d69f040082fd236c80bb71d04f Mon Sep 17 00:00:00 2001 From: Tristan Darricau Date: Thu, 15 Oct 2015 10:57:46 +0200 Subject: [prep-release-3.2.0-a1] Add migration for 3.2.0-a1 --- .../migration/data/v320/allowed_schemes_links.php | 7 ++++ .../data/v320/announce_global_permission.php | 4 +- phpBB/phpbb/db/migration/data/v320/dev.php | 36 ++++++++++++++++++ .../db/migration/data/v320/font_awesome_update.php | 7 ++++ phpBB/phpbb/db/migration/data/v320/icons_alt.php | 4 +- phpBB/phpbb/db/migration/data/v320/log_post_id.php | 4 +- .../db/migration/data/v320/notifications_board.php | 4 +- .../migration/data/v320/remove_outdated_media.php | 7 ++++ .../data/v320/remove_profilefield_wlm.php | 4 +- phpBB/phpbb/db/migration/data/v320/v320a1.php | 44 ++++++++++++++++++++++ 10 files changed, 116 insertions(+), 5 deletions(-) create mode 100644 phpBB/phpbb/db/migration/data/v320/dev.php create mode 100644 phpBB/phpbb/db/migration/data/v320/v320a1.php (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v320/allowed_schemes_links.php b/phpBB/phpbb/db/migration/data/v320/allowed_schemes_links.php index de127e3745..726822bc71 100644 --- a/phpBB/phpbb/db/migration/data/v320/allowed_schemes_links.php +++ b/phpBB/phpbb/db/migration/data/v320/allowed_schemes_links.php @@ -15,6 +15,13 @@ namespace phpbb\db\migration\data\v320; class allowed_schemes_links extends \phpbb\db\migration\migration { + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v320\dev', + ); + } + public function update_data() { return array( diff --git a/phpBB/phpbb/db/migration/data/v320/announce_global_permission.php b/phpBB/phpbb/db/migration/data/v320/announce_global_permission.php index fe30a1c1b8..7afecb884b 100644 --- a/phpBB/phpbb/db/migration/data/v320/announce_global_permission.php +++ b/phpBB/phpbb/db/migration/data/v320/announce_global_permission.php @@ -29,7 +29,9 @@ class announce_global_permission extends \phpbb\db\migration\migration static public function depends_on() { - return array('\phpbb\db\migration\data\v310\rc2'); + return array( + '\phpbb\db\migration\data\v320\dev', + ); } public function update_data() diff --git a/phpBB/phpbb/db/migration/data/v320/dev.php b/phpBB/phpbb/db/migration/data/v320/dev.php new file mode 100644 index 0000000000..ad2da3c1f4 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v320/dev.php @@ -0,0 +1,36 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v320; + +class dev extends \phpbb\db\migration\container_aware_migration +{ + public function effectively_installed() + { + return version_compare($this->config['version'], '3.2.0-dev', '>='); + } + + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v31x\v316', + ); + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.2.0-dev')), + ); + } +} diff --git a/phpBB/phpbb/db/migration/data/v320/font_awesome_update.php b/phpBB/phpbb/db/migration/data/v320/font_awesome_update.php index 6ffaf18b4a..817b638037 100644 --- a/phpBB/phpbb/db/migration/data/v320/font_awesome_update.php +++ b/phpBB/phpbb/db/migration/data/v320/font_awesome_update.php @@ -15,6 +15,13 @@ namespace phpbb\db\migration\data\v320; class font_awesome_update extends \phpbb\db\migration\migration { + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v320\dev', + ); + } + public function effectively_installed() { return isset($this->config['load_font_awesome_url']); diff --git a/phpBB/phpbb/db/migration/data/v320/icons_alt.php b/phpBB/phpbb/db/migration/data/v320/icons_alt.php index 7071ae78db..80132e579e 100644 --- a/phpBB/phpbb/db/migration/data/v320/icons_alt.php +++ b/phpBB/phpbb/db/migration/data/v320/icons_alt.php @@ -17,7 +17,9 @@ class icons_alt extends \phpbb\db\migration\migration { static public function depends_on() { - return array('\phpbb\db\migration\data\v310\dev'); + return array( + '\phpbb\db\migration\data\v320\dev', + ); } public function update_schema() diff --git a/phpBB/phpbb/db/migration/data/v320/log_post_id.php b/phpBB/phpbb/db/migration/data/v320/log_post_id.php index 0f155d543c..ead53c8138 100644 --- a/phpBB/phpbb/db/migration/data/v320/log_post_id.php +++ b/phpBB/phpbb/db/migration/data/v320/log_post_id.php @@ -17,7 +17,9 @@ class log_post_id extends \phpbb\db\migration\migration { static public function depends_on() { - return array('\phpbb\db\migration\data\v310\dev'); + return array( + '\phpbb\db\migration\data\v320\dev', + ); } public function update_schema() diff --git a/phpBB/phpbb/db/migration/data/v320/notifications_board.php b/phpBB/phpbb/db/migration/data/v320/notifications_board.php index fd9f1a2ad6..8a76ebab58 100644 --- a/phpBB/phpbb/db/migration/data/v320/notifications_board.php +++ b/phpBB/phpbb/db/migration/data/v320/notifications_board.php @@ -17,7 +17,9 @@ class notifications_board extends \phpbb\db\migration\migration { static public function depends_on() { - return array('\phpbb\db\migration\data\v310\notifications'); + return array( + '\phpbb\db\migration\data\v320\dev', + ); } public function update_data() diff --git a/phpBB/phpbb/db/migration/data/v320/remove_outdated_media.php b/phpBB/phpbb/db/migration/data/v320/remove_outdated_media.php index 59208be4dc..c14d31f1c0 100644 --- a/phpBB/phpbb/db/migration/data/v320/remove_outdated_media.php +++ b/phpBB/phpbb/db/migration/data/v320/remove_outdated_media.php @@ -21,6 +21,13 @@ class remove_outdated_media extends \phpbb\db\migration\migration ATTACHMENT_CATEGORY_QUICKTIME, ); + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v320\dev', + ); + } + public function update_data() { return array( diff --git a/phpBB/phpbb/db/migration/data/v320/remove_profilefield_wlm.php b/phpBB/phpbb/db/migration/data/v320/remove_profilefield_wlm.php index 2898c708f8..1cb9070bf9 100644 --- a/phpBB/phpbb/db/migration/data/v320/remove_profilefield_wlm.php +++ b/phpBB/phpbb/db/migration/data/v320/remove_profilefield_wlm.php @@ -17,7 +17,9 @@ class remove_profilefield_wlm extends \phpbb\db\migration\migration { static public function depends_on() { - return array('\phpbb\db\migration\data\v310\profilefield_wlm'); + return array( + '\phpbb\db\migration\data\v320\dev', + ); } public function update_schema() diff --git a/phpBB/phpbb/db/migration/data/v320/v320a1.php b/phpBB/phpbb/db/migration/data/v320/v320a1.php new file mode 100644 index 0000000000..d7ecb36f90 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v320/v320a1.php @@ -0,0 +1,44 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v320; + +class v320a1 extends \phpbb\db\migration\container_aware_migration +{ + public function effectively_installed() + { + return version_compare($this->config['version'], '3.2.0-a1', '>='); + } + + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v320\dev', + '\phpbb\db\migration\data\v320\allowed_schemes_links', + '\phpbb\db\migration\data\v320\announce_global_permission', + '\phpbb\db\migration\data\v320\remove_profilefield_wlm', + '\phpbb\db\migration\data\v320\font_awesome_update', + '\phpbb\db\migration\data\v320\icons_alt', + '\phpbb\db\migration\data\v320\log_post_id', + '\phpbb\db\migration\data\v320\remove_outdated_media', + '\phpbb\db\migration\data\v320\notifications_board', + ); + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.2.0-dev')), + ); + } +} -- cgit v1.2.1 From 8daeb6962aa0f86798e40ae94c59fac9184155c0 Mon Sep 17 00:00:00 2001 From: Tristan Darricau Date: Mon, 14 Dec 2015 22:39:10 +0100 Subject: [prep-release-3.2.0-a2] Add migration for 3.2.0-a2 --- phpBB/phpbb/db/migration/data/v320/v320a2.php | 38 +++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v320/v320a2.php (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v320/v320a2.php b/phpBB/phpbb/db/migration/data/v320/v320a2.php new file mode 100644 index 0000000000..ae53a73210 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v320/v320a2.php @@ -0,0 +1,38 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v320; + +class v320a2 extends \phpbb\db\migration\container_aware_migration +{ + public function effectively_installed() + { + return version_compare($this->config['version'], '3.2.0-a2', '>='); + } + + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v31x\v317rc1', + '\phpbb\db\migration\data\v320\text_reparser', + '\phpbb\db\migration\data\v320\v320a1', + ); + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.2.0-a2')), + ); + } +} -- cgit v1.2.1 From 8ed59fb82a9381914a4ccce91c0c5fac44616556 Mon Sep 17 00:00:00 2001 From: Oliver Schramm Date: Fri, 23 Oct 2015 02:44:41 +0200 Subject: [ticket/14250] Change token_storage class to fit changed interface PHPBB3-14250 --- .../phpbb/db/migration/data/v320/oauth_states.php | 56 ++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v320/oauth_states.php (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v320/oauth_states.php b/phpBB/phpbb/db/migration/data/v320/oauth_states.php new file mode 100644 index 0000000000..22ab2dabb3 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v320/oauth_states.php @@ -0,0 +1,56 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v320; + +class oauth_states extends \phpbb\db\migration\migration +{ + static public function depends_on() + { + return array('\phpbb\db\migration\data\v310\auth_provider_oauth'); + } + + public function effectively_installed() + { + return $this->db_tools->sql_table_exists($this->table_prefix . 'oauth_states'); + } + + public function update_schema() + { + return array( + 'add_tables' => array( + $this->table_prefix . 'oauth_states' => array( + 'COLUMNS' => array( + 'user_id' => array('UINT', 0), + 'session_id' => array('CHAR:32', ''), + 'provider' => array('VCHAR', ''), + 'oauth_state' => array('VCHAR', ''), + ), + 'KEYS' => array( + 'user_id' => array('INDEX', 'user_id'), + 'provider' => array('INDEX', 'provider'), + ), + ), + ), + ); + } + + public function revert_schema() + { + return array( + 'drop_tables' => array( + $this->table_prefix . 'oauth_states', + ), + ); + } +} -- cgit v1.2.1 From 73e6e5b77faadbb7676961bf38122d669de111db Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Thu, 3 Dec 2015 17:50:29 +0100 Subject: [ticket/13454] Remove unused variables This is the first part of the changes. More to come. PHPBB3-13454 --- phpBB/phpbb/db/migration/data/v30x/release_3_0_5_rc1.php | 2 +- phpBB/phpbb/db/migration/data/v31x/update_custom_bbcodes_with_idn.php | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_5_rc1.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_5_rc1.php index 9f6e3efb91..084d00a13a 100644 --- a/phpBB/phpbb/db/migration/data/v30x/release_3_0_5_rc1.php +++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_5_rc1.php @@ -118,7 +118,7 @@ class release_3_0_5_rc1 extends container_aware_migration $result = $this->db->sql_query($sql); // Skip first row, this is our original auth option we want to preserve - $row = $this->db->sql_fetchrow($result); + $this->db->sql_fetchrow($result); while ($row = $this->db->sql_fetchrow($result)) { diff --git a/phpBB/phpbb/db/migration/data/v31x/update_custom_bbcodes_with_idn.php b/phpBB/phpbb/db/migration/data/v31x/update_custom_bbcodes_with_idn.php index 854ed1f568..14b7b7b0f6 100644 --- a/phpBB/phpbb/db/migration/data/v31x/update_custom_bbcodes_with_idn.php +++ b/phpBB/phpbb/db/migration/data/v31x/update_custom_bbcodes_with_idn.php @@ -45,7 +45,6 @@ class update_custom_bbcodes_with_idn extends \phpbb\db\migration\migration $sql_ary = array(); while ($row = $this->db->sql_fetchrow($result)) { - $data = array(); if (preg_match('/(URL|LOCAL_URL|RELATIVE_URL)/', $row['bbcode_match'])) { $data = $bbcodes->build_regexp($row['bbcode_match'], $row['bbcode_tpl']); -- cgit v1.2.1 From 31607771e1cbb17d4bf841fd93e7f699427b8814 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Wed, 13 Jan 2016 17:02:42 +0100 Subject: [ticket/11875] Add migration file PHPBB3-11875 --- .../migration/data/v320/default_data_type_ids.php | 252 +++++++++++++++++++++ 1 file changed, 252 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v320/default_data_type_ids.php (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v320/default_data_type_ids.php b/phpBB/phpbb/db/migration/data/v320/default_data_type_ids.php new file mode 100644 index 0000000000..5fbf343bfb --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v320/default_data_type_ids.php @@ -0,0 +1,252 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v320; + +class default_data_type_ids extends \phpbb\db\migration\migration +{ + static public function depends_on() + { + return array('\phpbb\db\migration\data\v320\v320a2'); + } + + public function update_schema() + { + return array( + 'change_columns' => array( + $this->table_prefix . 'attachments' => array( + 'topic_id' => array('ULINT', 0), + ), + $this->table_prefix . 'acl_users' => array( + 'user_id' => array('ULINT', 0), + ), + $this->table_prefix . 'bookmarks' => array( + 'topic_id' => array('ULINT', 0), + 'user_id' => array('ULINT', 0), + ), + $this->table_prefix . 'bots' => array( + 'user_id' => array('ULINT', 0), + ), + $this->table_prefix . 'drafts' => array( + 'topic_id' => array('ULINT', 0), + ), + $this->table_prefix . 'forums_access' => array( + 'user_id' => array('ULINT', 0), + ), + $this->table_prefix . 'forums_track' => array( + 'user_id' => array('ULINT', 0), + ), + $this->table_prefix . 'forums_watch' => array( + 'user_id' => array('ULINT', 0), + ), + $this->table_prefix . 'log' => array( + 'user_id' => array('ULINT', 0), + 'topic_id' => array('ULINT', 0), + ), + $this->table_prefix . 'login_attempts' => array( + 'user_id' => array('ULINT', 0), + ), + $this->table_prefix . 'moderator_cache' => array( + 'user_id' => array('ULINT', 0), + ), + $this->table_prefix . 'notifications' => array( + 'user_id' => array('ULINT', 0), + ), + $this->table_prefix . 'oauth_accounts' => array( + 'user_id' => array('ULINT', 0), + ), + $this->table_prefix . 'oauth_tokens' => array( + 'user_id' => array('ULINT', 0), + ), + $this->table_prefix . 'poll_options' => array( + 'topic_id' => array('ULINT', 0), + ), + $this->table_prefix . 'poll_votes' => array( + 'topicr_id' => array('ULINT', 0), + ), + $this->table_prefix . 'posts' => array( + 'post_id' => array('ULINT', null, 'auto_increment'), + 'topic_id' => array('ULINT', 0), + ), + $this->table_prefix . 'privmsgs_folder' => array( + 'user_id' => array('ULINT', 0), + ), + $this->table_prefix . 'privmsgs_rules' => array( + 'user_id' => array('ULINT', 0), + ), + $this->table_prefix . 'privmsgs_to' => array( + 'user_id' => array('ULINT', 0), + ), + $this->table_prefix . 'profile_fields_data' => array( + 'user_id' => array('ULINT', 0), + ), + $this->table_prefix . 'reports' => array( + 'post_id' => array('ULINT', 0), + 'user_id' => array('ULINT', 0), + ), + $this->table_prefix . 'search_wordmatch' => array( + 'post_id' => array('ULINT', 0), + ), + $this->table_prefix . 'sessions_keys' => array( + 'user_id' => array('ULINT', 0), + ), + $this->table_prefix . 'topics' => array( + 'topic_id' => array('ULINT', null, 'auto_increment'), + ), + $this->table_prefix . 'topics_track' => array( + 'user_id' => array('ULINT', 0), + 'topic_id' => array('ULINT', 0), + ), + $this->table_prefix . 'topics_posted' => array( + 'user_id' => array('ULINT', 0), + 'topic_id' => array('ULINT', 0), + ), + $this->table_prefix . 'topics_watch' => array( + 'user_id' => array('ULINT', 0), + 'topic_id' => array('ULINT', 0), + ), + $this->table_prefix . 'user_notifications' => array( + 'user_id' => array('ULINT', 0), + ), + $this->table_prefix . 'user_group' => array( + 'user_id' => array('ULINT', 0), + ), + $this->table_prefix . 'users' => array( + 'user_id' => array('ULINT', null, 'auto_increment'), + ), + $this->table_prefix . 'warnings' => array( + 'user_id' => array('ULINT', 0), + 'post_Id' => array('ULINT', 0), + ), + $this->table_prefix . 'zebra' => array( + 'user_id' => array('ULINT', 0), + ), + ), + ); + } + + public function revert_schema() + { + return array( + 'change_columns' => array( + $this->table_prefix . 'attachments' => array( + 'topic_id' => array('UINT', 0), + ), + $this->table_prefix . 'acl_users' => array( + 'user_id' => array('UINT', 0), + ), + $this->table_prefix . 'bookmarks' => array( + 'topic_id' => array('UINT', 0), + 'user_id' => array('UINT', 0), + ), + $this->table_prefix . 'bots' => array( + 'user_id' => array('UINT', 0), + ), + $this->table_prefix . 'drafts' => array( + 'topic_id' => array('UINT', 0), + ), + $this->table_prefix . 'forums_access' => array( + 'user_id' => array('UINT', 0), + ), + $this->table_prefix . 'forums_track' => array( + 'user_id' => array('UINT', 0), + ), + $this->table_prefix . 'forums_watch' => array( + 'user_id' => array('UINT', 0), + ), + $this->table_prefix . 'log' => array( + 'user_id' => array('UINT', 0), + 'topic_id' => array('UINT', 0), + ), + $this->table_prefix . 'login_attempts' => array( + 'user_id' => array('UINT', 0), + ), + $this->table_prefix . 'moderator_cache' => array( + 'user_id' => array('UINT', 0), + ), + $this->table_prefix . 'notifications' => array( + 'user_id' => array('UINT', 0), + ), + $this->table_prefix . 'oauth_accounts' => array( + 'user_id' => array('UINT', 0), + ), + $this->table_prefix . 'oauth_tokens' => array( + 'user_id' => array('UINT', 0), + ), + $this->table_prefix . 'poll_options' => array( + 'topic_id' => array('UINT', 0), + ), + $this->table_prefix . 'poll_votes' => array( + 'topicr_id' => array('UINT', 0), + ), + $this->table_prefix . 'posts' => array( + 'post_id' => array('UINT', null, 'auto_increment'), + 'topic_id' => array('UINT', 0), + ), + $this->table_prefix . 'privmsgs_folder' => array( + 'user_id' => array('UINT', 0), + ), + $this->table_prefix . 'privmsgs_rules' => array( + 'user_id' => array('UINT', 0), + ), + $this->table_prefix . 'privmsgs_to' => array( + 'user_id' => array('UINT', 0), + ), + $this->table_prefix . 'profile_fields_data' => array( + 'user_id' => array('UINT', 0), + ), + $this->table_prefix . 'reports' => array( + 'post_id' => array('UINT', 0), + 'user_id' => array('UINT', 0), + ), + $this->table_prefix . 'search_wordmatch' => array( + 'post_id' => array('UINT', 0), + ), + $this->table_prefix . 'sessions_keys' => array( + 'user_id' => array('UINT', 0), + ), + $this->table_prefix . 'topics' => array( + 'topic_id' => array('UINT', null, 'auto_increment'), + ), + $this->table_prefix . 'topics_track' => array( + 'user_id' => array('UINT', 0), + 'topic_id' => array('UINT', 0), + ), + $this->table_prefix . 'topics_posted' => array( + 'user_id' => array('UINT', 0), + 'topic_id' => array('UINT', 0), + ), + $this->table_prefix . 'topics_watch' => array( + 'user_id' => array('UINT', 0), + 'topic_id' => array('UINT', 0), + ), + $this->table_prefix . 'user_notifications' => array( + 'user_id' => array('UINT', 0), + ), + $this->table_prefix . 'user_group' => array( + 'user_id' => array('UINT', 0), + ), + $this->table_prefix . 'users' => array( + 'user_id' => array('UINT', null, 'auto_increment'), + ), + $this->table_prefix . 'warnings' => array( + 'user_id' => array('UINT', 0), + 'post_Id' => array('UINT', 0), + ), + $this->table_prefix . 'zebra' => array( + 'user_id' => array('UINT', 0), + ), + ), + ); + } +} -- cgit v1.2.1 From 7cd7bb3c015be1355ab634d3cb704c1d764bf8b0 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Wed, 13 Jan 2016 19:35:04 +0100 Subject: [ticket/11875] Change more columns to use UINT and add missings ones PHPBB3-11875 --- .../migration/data/v320/default_data_type_ids.php | 134 ++++++++++++++++++--- 1 file changed, 120 insertions(+), 14 deletions(-) (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v320/default_data_type_ids.php b/phpBB/phpbb/db/migration/data/v320/default_data_type_ids.php index 5fbf343bfb..ecee09ce77 100644 --- a/phpBB/phpbb/db/migration/data/v320/default_data_type_ids.php +++ b/phpBB/phpbb/db/migration/data/v320/default_data_type_ids.php @@ -24,22 +24,36 @@ class default_data_type_ids extends \phpbb\db\migration\migration { return array( 'change_columns' => array( + $this->table_prefix . 'acl_users' => array( + 'user_id' => array('ULINT', 0), + ), $this->table_prefix . 'attachments' => array( + 'attach_id' => array('ULINT', null, 'auto_increment'), + 'post_msg_id' => array('ULINT', 0), + 'poster_id' => array('ULINT', 0), 'topic_id' => array('ULINT', 0), ), - $this->table_prefix . 'acl_users' => array( - 'user_id' => array('ULINT', 0), + $this->table_prefix . 'banlist' => array( + 'ban_id' => array('ULINT', null, 'auto_increment'), + 'ban_userid' => array('ULINT', 0), ), $this->table_prefix . 'bookmarks' => array( 'topic_id' => array('ULINT', 0), 'user_id' => array('ULINT', 0), ), $this->table_prefix . 'bots' => array( + 'bot_id' => array('ULINT', null, 'auto_increment'), 'user_id' => array('ULINT', 0), ), $this->table_prefix . 'drafts' => array( + 'draft_id' => array('ULINT', null, 'auto_increment'), + 'user_id' => array('ULINT', 0), 'topic_id' => array('ULINT', 0), ), + $this->table_prefix . 'forums' => array( + 'forum_last_post_id' => array('ULINT', 0), + 'forum_last_poster_id' => array('ULINT', 0), + ), $this->table_prefix . 'forums_access' => array( 'user_id' => array('ULINT', 0), ), @@ -50,6 +64,9 @@ class default_data_type_ids extends \phpbb\db\migration\migration 'user_id' => array('ULINT', 0), ), $this->table_prefix . 'log' => array( + 'log_id' => array('ULINT', null, 'auto_increment'), + 'post_id' => array('ULINT', 0), + 'reportee_id' => array('ULINT', 0), 'user_id' => array('ULINT', 0), 'topic_id' => array('ULINT', 0), ), @@ -65,6 +82,9 @@ class default_data_type_ids extends \phpbb\db\migration\migration $this->table_prefix . 'oauth_accounts' => array( 'user_id' => array('ULINT', 0), ), + $this->table_prefix . 'oauth_states' => array( + 'user_id' => array('ULINT', 0), + ), $this->table_prefix . 'oauth_tokens' => array( 'user_id' => array('ULINT', 0), ), @@ -72,36 +92,63 @@ class default_data_type_ids extends \phpbb\db\migration\migration 'topic_id' => array('ULINT', 0), ), $this->table_prefix . 'poll_votes' => array( - 'topicr_id' => array('ULINT', 0), + 'topic_id' => array('ULINT', 0), + 'vote_user_id' => array('ULINT', 0), ), $this->table_prefix . 'posts' => array( - 'post_id' => array('ULINT', null, 'auto_increment'), - 'topic_id' => array('ULINT', 0), + 'post_id' => array('ULINT', null, 'auto_increment'), + 'poster_id' => array('ULINT', 0), + 'post_delete_user' => array('ULINT', 0), + 'post_edit_user' => array('ULINT', 0), + 'topic_id' => array('ULINT', 0), + ), + $this->table_prefix . 'privmsgs' => array( + 'author_id' => array('ULINT', 0), + 'message_edit_user' => array('ULINT', 0), + 'msg_id' => array('ULINT', null, 'auto_increment'), ), $this->table_prefix . 'privmsgs_folder' => array( 'user_id' => array('ULINT', 0), ), $this->table_prefix . 'privmsgs_rules' => array( + 'rule_user_id' => array('ULINT', 0), 'user_id' => array('ULINT', 0), ), $this->table_prefix . 'privmsgs_to' => array( + 'author_id' => array('ULINT', 0), + 'msg_id' => array('ULINT', 0), 'user_id' => array('ULINT', 0), ), $this->table_prefix . 'profile_fields_data' => array( 'user_id' => array('ULINT', 0), ), $this->table_prefix . 'reports' => array( + 'report_id' => array('ULINT', 0), + 'pm_id' => array('ULINT', 0), 'post_id' => array('ULINT', 0), 'user_id' => array('ULINT', 0), ), + $this->table_prefix . 'search_wordlist' => array( + 'word_id' => array('ULINT', null, 'auto_increment'), + ), $this->table_prefix . 'search_wordmatch' => array( 'post_id' => array('ULINT', 0), + 'word_id' => array('ULINT', 0), + ), + $this->table_prefix . 'sessions' => array( + 'session_user_id' => array('ULINT', 0), ), $this->table_prefix . 'sessions_keys' => array( 'user_id' => array('ULINT', 0), ), $this->table_prefix . 'topics' => array( - 'topic_id' => array('ULINT', null, 'auto_increment'), + 'topic_id' => array('ULINT', null, 'auto_increment'), + 'topic_poster' => array('ULINT', 0), + 'topic_first_post_id' => array('ULINT', 0), + 'topic_last_post_id' => array('ULINT', 0), + 'topic_last_poster_id' => array('ULINT', 0), + 'topic_moved_id' => array('ULINT', 0), + 'topic_delete_user' => array('ULINT', 0), ), $this->table_prefix . 'topics_track' => array( 'user_id' => array('ULINT', 0), @@ -116,6 +163,7 @@ class default_data_type_ids extends \phpbb\db\migration\migration 'topic_id' => array('ULINT', 0), ), $this->table_prefix . 'user_notifications' => array( + 'item_id' => array('ULINT', 0), 'user_id' => array('ULINT', 0), ), $this->table_prefix . 'user_group' => array( @@ -125,11 +173,16 @@ class default_data_type_ids extends \phpbb\db\migration\migration 'user_id' => array('ULINT', null, 'auto_increment'), ), $this->table_prefix . 'warnings' => array( + 'log_id' => array('ULINT', 0), 'user_id' => array('ULINT', 0), - 'post_Id' => array('ULINT', 0), + 'post_id' => array('ULINT', 0), + ), + $this->table_prefix . 'words' => array( + 'word_id' => array('ULINT', null, 'auto_increment'), ), $this->table_prefix . 'zebra' => array( 'user_id' => array('ULINT', 0), + 'zebra_id' => array('ULINT', 0), ), ), ); @@ -139,22 +192,36 @@ class default_data_type_ids extends \phpbb\db\migration\migration { return array( 'change_columns' => array( + $this->table_prefix . 'acl_users' => array( + 'user_id' => array('UINT', 0), + ), $this->table_prefix . 'attachments' => array( + 'attach_id' => array('UINT', null, 'auto_increment'), + 'post_msg_id' => array('UINT', 0), + 'poster_id' => array('UINT', 0), 'topic_id' => array('UINT', 0), ), - $this->table_prefix . 'acl_users' => array( - 'user_id' => array('UINT', 0), + $this->table_prefix . 'banlist' => array( + 'ban_id' => array('UINT', null, 'auto_increment'), + 'ban_userid' => array('UINT', 0), ), $this->table_prefix . 'bookmarks' => array( 'topic_id' => array('UINT', 0), 'user_id' => array('UINT', 0), ), $this->table_prefix . 'bots' => array( + 'bot_id' => array('UINT', null, 'auto_increment'), 'user_id' => array('UINT', 0), ), $this->table_prefix . 'drafts' => array( + 'draft_id' => array('UINT', null, 'auto_increment'), + 'user_id' => array('UINT', 0), 'topic_id' => array('UINT', 0), ), + $this->table_prefix . 'forums' => array( + 'forum_last_post_id' => array('UINT', 0), + 'forum_last_poster_id' => array('UINT', 0), + ), $this->table_prefix . 'forums_access' => array( 'user_id' => array('UINT', 0), ), @@ -165,6 +232,9 @@ class default_data_type_ids extends \phpbb\db\migration\migration 'user_id' => array('UINT', 0), ), $this->table_prefix . 'log' => array( + 'log_id' => array('UINT', null, 'auto_increment'), + 'post_id' => array('UINT', 0), + 'reportee_id' => array('UINT', 0), 'user_id' => array('UINT', 0), 'topic_id' => array('UINT', 0), ), @@ -180,6 +250,9 @@ class default_data_type_ids extends \phpbb\db\migration\migration $this->table_prefix . 'oauth_accounts' => array( 'user_id' => array('UINT', 0), ), + $this->table_prefix . 'oauth_states' => array( + 'user_id' => array('UINT', 0), + ), $this->table_prefix . 'oauth_tokens' => array( 'user_id' => array('UINT', 0), ), @@ -187,36 +260,63 @@ class default_data_type_ids extends \phpbb\db\migration\migration 'topic_id' => array('UINT', 0), ), $this->table_prefix . 'poll_votes' => array( - 'topicr_id' => array('UINT', 0), + 'topic_id' => array('UINT', 0), + 'vote_user_id' => array('UINT', 0), ), $this->table_prefix . 'posts' => array( - 'post_id' => array('UINT', null, 'auto_increment'), - 'topic_id' => array('UINT', 0), + 'post_id' => array('UINT', null, 'auto_increment'), + 'poster_id' => array('UINT', 0), + 'post_delete_user' => array('UINT', 0), + 'post_edit_user' => array('UINT', 0), + 'topic_id' => array('UINT', 0), + ), + $this->table_prefix . 'privmsgs' => array( + 'author_id' => array('UINT', 0), + 'message_edit_user' => array('UINT', 0), + 'msg_id' => array('UINT', null, 'auto_increment'), ), $this->table_prefix . 'privmsgs_folder' => array( 'user_id' => array('UINT', 0), ), $this->table_prefix . 'privmsgs_rules' => array( + 'rule_user_id' => array('UINT', 0), 'user_id' => array('UINT', 0), ), $this->table_prefix . 'privmsgs_to' => array( + 'author_id' => array('UINT', 0), + 'msg_id' => array('UINT', 0), 'user_id' => array('UINT', 0), ), $this->table_prefix . 'profile_fields_data' => array( 'user_id' => array('UINT', 0), ), $this->table_prefix . 'reports' => array( + 'report_id' => array('UINT', 0), + 'pm_id' => array('UINT', 0), 'post_id' => array('UINT', 0), 'user_id' => array('UINT', 0), ), + $this->table_prefix . 'search_wordlist' => array( + 'word_id' => array('UINT', null, 'auto_increment'), + ), $this->table_prefix . 'search_wordmatch' => array( 'post_id' => array('UINT', 0), + 'word_id' => array('UINT', 0), + ), + $this->table_prefix . 'sessions' => array( + 'session_user_id' => array('UINT', 0), ), $this->table_prefix . 'sessions_keys' => array( 'user_id' => array('UINT', 0), ), $this->table_prefix . 'topics' => array( - 'topic_id' => array('UINT', null, 'auto_increment'), + 'topic_id' => array('UINT', null, 'auto_increment'), + 'topic_poster' => array('UINT', 0), + 'topic_first_post_id' => array('UINT', 0), + 'topic_last_post_id' => array('UINT', 0), + 'topic_last_poster_id' => array('UINT', 0), + 'topic_moved_id' => array('UINT', 0), + 'topic_delete_user' => array('UINT', 0), ), $this->table_prefix . 'topics_track' => array( 'user_id' => array('UINT', 0), @@ -231,6 +331,7 @@ class default_data_type_ids extends \phpbb\db\migration\migration 'topic_id' => array('UINT', 0), ), $this->table_prefix . 'user_notifications' => array( + 'item_id' => array('UINT', 0), 'user_id' => array('UINT', 0), ), $this->table_prefix . 'user_group' => array( @@ -240,11 +341,16 @@ class default_data_type_ids extends \phpbb\db\migration\migration 'user_id' => array('UINT', null, 'auto_increment'), ), $this->table_prefix . 'warnings' => array( + 'log_id' => array('UINT', 0), 'user_id' => array('UINT', 0), - 'post_Id' => array('UINT', 0), + 'post_id' => array('UINT', 0), + ), + $this->table_prefix . 'words' => array( + 'word_id' => array('UINT', null, 'auto_increment'), ), $this->table_prefix . 'zebra' => array( 'user_id' => array('UINT', 0), + 'zebra_id' => array('UINT', 0), ), ), ); -- cgit v1.2.1 From e954b0b82b9fe873211bdd8885aefb78284f0893 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Mon, 18 Jan 2016 14:54:54 +0100 Subject: [ticket/13733] Use interface for migratinos PHPBB3-13733 --- phpBB/phpbb/db/migration/migration.php | 34 +++--------- phpBB/phpbb/db/migration/migration_interface.php | 70 ++++++++++++++++++++++++ 2 files changed, 77 insertions(+), 27 deletions(-) create mode 100644 phpBB/phpbb/db/migration/migration_interface.php (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/migration.php b/phpBB/phpbb/db/migration/migration.php index 2304c8e44c..4e218344f4 100644 --- a/phpBB/phpbb/db/migration/migration.php +++ b/phpBB/phpbb/db/migration/migration.php @@ -20,7 +20,7 @@ namespace phpbb\db\migration; * in a subclass. This class provides various utility methods to simplify editing * a phpBB. */ -abstract class migration +abstract class migration implements migration_interface { /** @var \phpbb\config\config */ protected $config; @@ -70,9 +70,7 @@ abstract class migration } /** - * Defines other migrations to be applied first - * - * @return array An array of migration class names + * {@inheritdoc} */ static public function depends_on() { @@ -80,14 +78,7 @@ abstract class migration } /** - * Allows you to check if the migration is effectively installed (entirely optional) - * - * This is checked when a migration is installed. If true is returned, the migration will be set as - * installed without performing the database changes. - * This function is intended to help moving to migrations from a previous database updater, where some - * migrations may have been installed already even though they are not yet listed in the migrations table. - * - * @return bool True if this migration is installed, False if this migration is not installed (checked on install) + * {@inheritdoc} */ public function effectively_installed() { @@ -95,9 +86,7 @@ abstract class migration } /** - * Updates the database schema by providing a set of change instructions - * - * @return array Array of schema changes (compatible with db_tools->perform_schema_changes()) + * {@inheritdoc} */ public function update_schema() { @@ -105,9 +94,7 @@ abstract class migration } /** - * Reverts the database schema by providing a set of change instructions - * - * @return array Array of schema changes (compatible with db_tools->perform_schema_changes()) + * {@inheritdoc} */ public function revert_schema() { @@ -115,9 +102,7 @@ abstract class migration } /** - * Updates data by returning a list of instructions to be executed - * - * @return array Array of data update instructions + * {@inheritdoc} */ public function update_data() { @@ -125,12 +110,7 @@ abstract class migration } /** - * Reverts data by returning a list of instructions to be executed - * - * @return array Array of data instructions that will be performed on revert - * NOTE: calls to tools (such as config.add) are automatically reverted when - * possible, so you should not attempt to revert those, this is mostly for - * otherwise unrevertable calls (custom functions for example) + * {@inheritdoc} */ public function revert_data() { diff --git a/phpBB/phpbb/db/migration/migration_interface.php b/phpBB/phpbb/db/migration/migration_interface.php new file mode 100644 index 0000000000..2aba5ec608 --- /dev/null +++ b/phpBB/phpbb/db/migration/migration_interface.php @@ -0,0 +1,70 @@ + + * @license GNU General Public License, version 2 (GPL-2.0) + * + * For full copyright and license information, please see + * the docs/CREDITS.txt file. + * + */ + +namespace phpbb\db\migration; + +/** + * Base class interface for database migrations + */ +interface migration_interface +{ + /** + * Defines other migrations to be applied first + * + * @return array An array of migration class names + */ + static public function depends_on(); + + /** + * Allows you to check if the migration is effectively installed (entirely optional) + * + * This is checked when a migration is installed. If true is returned, the migration will be set as + * installed without performing the database changes. + * This function is intended to help moving to migrations from a previous database updater, where some + * migrations may have been installed already even though they are not yet listed in the migrations table. + * + * @return bool True if this migration is installed, False if this migration is not installed (checked on install) + */ + public function effectively_installed(); + + /** + * Updates the database schema by providing a set of change instructions + * + * @return array Array of schema changes (compatible with db_tools->perform_schema_changes()) + */ + public function update_schema(); + + /** + * Reverts the database schema by providing a set of change instructions + * + * @return array Array of schema changes (compatible with db_tools->perform_schema_changes()) + */ + public function revert_schema(); + + /** + * Updates data by returning a list of instructions to be executed + * + * @return array Array of data update instructions + */ + public function update_data(); + + /** + * Reverts data by returning a list of instructions to be executed + * + * @return array Array of data instructions that will be performed on revert + * NOTE: calls to tools (such as config.add) are automatically reverted when + * possible, so you should not attempt to revert those, this is mostly for + * otherwise unrevertable calls (custom functions for example) + */ + public function revert_data(); +} -- cgit v1.2.1 From 7d2a58e27100e5c776b44223e2cc6837c293db02 Mon Sep 17 00:00:00 2001 From: Matt Friedman Date: Tue, 26 Jan 2016 11:45:06 -0800 Subject: [ticket/14434] Schema generator should ignore migration helpers PHPBB3-14434 --- phpBB/phpbb/db/migration/schema_generator.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/schema_generator.php b/phpBB/phpbb/db/migration/schema_generator.php index 7003844bc4..55ab4452ed 100644 --- a/phpBB/phpbb/db/migration/schema_generator.php +++ b/phpBB/phpbb/db/migration/schema_generator.php @@ -77,8 +77,18 @@ class schema_generator $check_dependencies = true; while (!empty($migrations)) { - foreach ($migrations as $migration_class) + foreach ($migrations as $key => $migration_class) { + if (class_exists($migration_class)) + { + $reflector = new \ReflectionClass($migration_class); + if (!$reflector->implementsInterface('\phpbb\db\migration\migration_interface') || !$reflector->isInstantiable()) + { + unset($migrations[$key]); + continue; + } + } + $open_dependencies = array_diff($migration_class::depends_on(), $tree); if (empty($open_dependencies)) -- cgit v1.2.1 From daa92f7996f7026a12a5224a89297c9716d658a4 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Wed, 27 Jan 2016 16:51:34 +0100 Subject: [ticket/14436] Add dependency on oauth_states migration PHPBB3-14436 --- phpBB/phpbb/db/migration/data/v320/default_data_type_ids.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v320/default_data_type_ids.php b/phpBB/phpbb/db/migration/data/v320/default_data_type_ids.php index ecee09ce77..65e5b3fa73 100644 --- a/phpBB/phpbb/db/migration/data/v320/default_data_type_ids.php +++ b/phpBB/phpbb/db/migration/data/v320/default_data_type_ids.php @@ -17,7 +17,10 @@ class default_data_type_ids extends \phpbb\db\migration\migration { static public function depends_on() { - return array('\phpbb\db\migration\data\v320\v320a2'); + return array( + '\phpbb\db\migration\data\v320\v320a2', + '\phpbb\db\migration\data\v320\oauth_states', + ); } public function update_schema() -- cgit v1.2.1 From 47d8aeebde6f763ec7247daf0df16dd2388b25b6 Mon Sep 17 00:00:00 2001 From: Matt Friedman Date: Wed, 27 Jan 2016 10:50:22 -0800 Subject: [ticket/14434] Extract migration check to a reusable method PHPBB3-14434 --- phpBB/phpbb/db/migration/schema_generator.php | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/schema_generator.php b/phpBB/phpbb/db/migration/schema_generator.php index 55ab4452ed..dc685bb161 100644 --- a/phpBB/phpbb/db/migration/schema_generator.php +++ b/phpBB/phpbb/db/migration/schema_generator.php @@ -79,14 +79,12 @@ class schema_generator { foreach ($migrations as $key => $migration_class) { - if (class_exists($migration_class)) + // Unset classes that do not exist or do not extend the + // abstract class phpbb\db\migration\migration + if (\phpbb\db\migrator::is_migration($migration_class) === false) { - $reflector = new \ReflectionClass($migration_class); - if (!$reflector->implementsInterface('\phpbb\db\migration\migration_interface') || !$reflector->isInstantiable()) - { - unset($migrations[$key]); - continue; - } + unset($migrations[$key]); + continue; } $open_dependencies = array_diff($migration_class::depends_on(), $tree); -- cgit v1.2.1 From 3bd8a2ba196f240c5b982271af1ee8b2a2f8332b Mon Sep 17 00:00:00 2001 From: Matt Friedman Date: Wed, 27 Jan 2016 11:46:04 -0800 Subject: [ticket/14434] Remove recursion to simplify is_migration method PHPBB3-14434 --- phpBB/phpbb/db/migration/schema_generator.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/schema_generator.php b/phpBB/phpbb/db/migration/schema_generator.php index dc685bb161..c579e25824 100644 --- a/phpBB/phpbb/db/migration/schema_generator.php +++ b/phpBB/phpbb/db/migration/schema_generator.php @@ -79,8 +79,7 @@ class schema_generator { foreach ($migrations as $key => $migration_class) { - // Unset classes that do not exist or do not extend the - // abstract class phpbb\db\migration\migration + // Unset classes that are not a valid migration if (\phpbb\db\migrator::is_migration($migration_class) === false) { unset($migrations[$key]); -- cgit v1.2.1 From fd9c05309d186332728b533467aaecad5c543c52 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Thu, 4 Feb 2016 17:10:59 +0100 Subject: [ticket/14448] Let user decide if remote upload certs should be checked Also fixed some minor issues like coding style. PHPBB3-14448 --- .../data/v320/remote_upload_validation.php | 31 ++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v320/remote_upload_validation.php (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v320/remote_upload_validation.php b/phpBB/phpbb/db/migration/data/v320/remote_upload_validation.php new file mode 100644 index 0000000000..d61f6b96fd --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v320/remote_upload_validation.php @@ -0,0 +1,31 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v320; + +class remote_upload_validation extends \phpbb\db\migration\migration +{ + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v320\v320a2', + ); + } + + public function update_data() + { + return array( + array('config.add', array('remote_upload_verify', '0')), + ); + } +} -- cgit v1.2.1 From 379634a102877ceebadf18b16d449899ddb9aa73 Mon Sep 17 00:00:00 2001 From: Tristan Darricau Date: Wed, 3 Feb 2016 22:22:30 +0100 Subject: [prep-release-3.2.0-b1] Add migration for 3.2.0-b1 --- phpBB/phpbb/db/migration/data/v320/v320b1.php | 39 +++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v320/v320b1.php (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v320/v320b1.php b/phpBB/phpbb/db/migration/data/v320/v320b1.php new file mode 100644 index 0000000000..5c3a3797cd --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v320/v320b1.php @@ -0,0 +1,39 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v320; + +class v320b1 extends \phpbb\db\migration\container_aware_migration +{ + public function effectively_installed() + { + return version_compare($this->config['version'], '3.2.0-b1', '>='); + } + + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v31x\v317pl1', + '\phpbb\db\migration\data\v320\v320a2', + '\phpbb\db\migration\data\v31x\increase_size_of_dateformat', + '\phpbb\db\migration\data\v320\default_data_type_ids', + ); + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.2.0-b1')), + ); + } +} -- cgit v1.2.1 From b40f9ce6e1df58f80d5e8878c9ff47178862d443 Mon Sep 17 00:00:00 2001 From: Tristan Darricau Date: Fri, 5 Feb 2016 11:58:51 +0100 Subject: [ticket/14453] Add missing dependency in the text_reparser migration PHPBB3-14453 --- phpBB/phpbb/db/migration/data/v320/text_reparser.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v320/text_reparser.php b/phpBB/phpbb/db/migration/data/v320/text_reparser.php index 1d73b74a76..8673a3488a 100644 --- a/phpBB/phpbb/db/migration/data/v320/text_reparser.php +++ b/phpBB/phpbb/db/migration/data/v320/text_reparser.php @@ -17,7 +17,10 @@ class text_reparser extends \phpbb\db\migration\container_aware_migration { static public function depends_on() { - return array('\phpbb\db\migration\data\v310\contact_admin_form'); + return array( + '\phpbb\db\migration\data\v310\contact_admin_form', + '\phpbb\db\migration\data\v320\allowed_schemes_links', + ); } public function effectively_installed() -- cgit v1.2.1 From da08a6e3cbda3cb51052bd9c8b7ac697fba2305d Mon Sep 17 00:00:00 2001 From: Oliver Schramm Date: Sat, 6 Feb 2016 14:43:14 +0100 Subject: [ticket/14461] Correctly count up $processed_records PHPBB3-14461 --- phpBB/phpbb/db/migration/data/v320/text_reparser.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v320/text_reparser.php b/phpBB/phpbb/db/migration/data/v320/text_reparser.php index 8673a3488a..ea614feb40 100644 --- a/phpBB/phpbb/db/migration/data/v320/text_reparser.php +++ b/phpBB/phpbb/db/migration/data/v320/text_reparser.php @@ -81,7 +81,7 @@ class text_reparser extends \phpbb\db\migration\container_aware_migration $end = max(1, $resume_data['current']); $reparser->reparse_range($start, $end); - $processed_records = $end - $start + 1; + $processed_records += $end - $start + 1; $resume_data['current'] = $start - 1; if ($start === 1) -- cgit v1.2.1 From 517c1f88259e0d30ed787bd762dcbab0c3e692f2 Mon Sep 17 00:00:00 2001 From: Tristan Darricau Date: Wed, 2 Mar 2016 22:19:25 +0100 Subject: [prep-release-3.2.0-b2] Add migration for 3.2.0-b2 --- phpBB/phpbb/db/migration/data/v320/v320b2.php | 40 +++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v320/v320b2.php (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v320/v320b2.php b/phpBB/phpbb/db/migration/data/v320/v320b2.php new file mode 100644 index 0000000000..007f7588e6 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v320/v320b2.php @@ -0,0 +1,40 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v320; + +use phpbb\db\migration\migration; + +class v320b2 extends migration +{ + public function effectively_installed() + { + return version_compare($this->config['version'], '3.2.0-b2', '>='); + } + + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v31x\v318', + '\phpbb\db\migration\data\v320\v320b1', + '\phpbb\db\migration\data\v320\remote_upload_validation', + ); + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.2.0-b2')), + ); + } +} -- cgit v1.2.1 From 933938a1d8452f2aa1ac833ab00db58aac67a8e6 Mon Sep 17 00:00:00 2001 From: Jakub Senko Date: Fri, 18 Mar 2016 10:34:32 +0100 Subject: [ticket/14318] Fix SQL error in Notifications Board migration PHPBB3-14318 --- phpBB/phpbb/db/migration/data/v320/notifications_board.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v320/notifications_board.php b/phpBB/phpbb/db/migration/data/v320/notifications_board.php index 8a76ebab58..ac1b3a0f2c 100644 --- a/phpBB/phpbb/db/migration/data/v320/notifications_board.php +++ b/phpBB/phpbb/db/migration/data/v320/notifications_board.php @@ -34,7 +34,7 @@ class notifications_board extends \phpbb\db\migration\migration public function update_module() { $sql = 'UPDATE ' . MODULES_TABLE . " - SET auth = 'cfg_allow_board_notifications' + SET module_auth = 'cfg_allow_board_notifications' WHERE module_basename = 'ucp_notifications' AND module_mode = 'notification_list'"; $this->sql_query($sql); -- cgit v1.2.1 From 6eda942a7f3b605b41d3a8809939ff28abdc18b1 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sun, 1 May 2016 17:29:10 +0200 Subject: [ticket/14607] Add missing auto_increment to report_id PHPBB3-14607 --- .../data/v320/report_id_auto_increment.php | 45 ++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v320/report_id_auto_increment.php (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v320/report_id_auto_increment.php b/phpBB/phpbb/db/migration/data/v320/report_id_auto_increment.php new file mode 100644 index 0000000000..c40504051e --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v320/report_id_auto_increment.php @@ -0,0 +1,45 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v320; + +class report_id_auto_increment extends \phpbb\db\migration\migration +{ + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v320\default_data_type_ids', + ); + } + + public function update_schema() + { + return array( + 'change_columns' => array( + $this->table_prefix . 'reports' => array( + 'report_id' => array('ULINT', null, 'auto_increment'), + ), + ), + ); + } + + public function revert_schema() + { + return array( + 'change_columns' => array( + $this->table_prefix . 'reports' => array( + 'report_id' => array('ULINT', 0), 0), + ), + ); + } +} -- cgit v1.2.1 From a90d8fa8d475010c45b1bca1fd9c279a9eb42fac Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Wed, 8 Jun 2016 08:38:55 +0200 Subject: [ticket/14665] Remove invalid syntax in report_id_auto_increment migration PHPBB3-14665 --- phpBB/phpbb/db/migration/data/v320/report_id_auto_increment.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v320/report_id_auto_increment.php b/phpBB/phpbb/db/migration/data/v320/report_id_auto_increment.php index c40504051e..6e81baefb9 100644 --- a/phpBB/phpbb/db/migration/data/v320/report_id_auto_increment.php +++ b/phpBB/phpbb/db/migration/data/v320/report_id_auto_increment.php @@ -38,8 +38,9 @@ class report_id_auto_increment extends \phpbb\db\migration\migration return array( 'change_columns' => array( $this->table_prefix . 'reports' => array( - 'report_id' => array('ULINT', 0), 0), + 'report_id' => array('ULINT', 0), ), + ), ); } } -- cgit v1.2.1 From 7cbb049572de066a8d9214b78a8c523f50d7014c Mon Sep 17 00:00:00 2001 From: Tristan Darricau Date: Fri, 29 Apr 2016 20:25:19 +0200 Subject: [prep-release-3.2.0-RC1] Add migration --- phpBB/phpbb/db/migration/data/v320/v320rc1.php | 40 ++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v320/v320rc1.php (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v320/v320rc1.php b/phpBB/phpbb/db/migration/data/v320/v320rc1.php new file mode 100644 index 0000000000..a04a2abb19 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v320/v320rc1.php @@ -0,0 +1,40 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v320; + +use phpbb\db\migration\migration; + +class v320rc1 extends migration +{ + public function effectively_installed() + { + return version_compare($this->config['version'], '3.2.0-RC1', '>='); + } + + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v31x\v319', + '\phpbb\db\migration\data\v320\report_id_auto_increment', + '\phpbb\db\migration\data\v320\v320b2', + ); + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.2.0-RC1')), + ); + } +} -- cgit v1.2.1 From 35c62d1e74adc445e65a21f3aa317925bd258893 Mon Sep 17 00:00:00 2001 From: rxu Date: Thu, 22 Sep 2016 22:29:18 +0700 Subject: [ticket/14793] Fix "A non-numeric value encountered" PHP warning on PHP 7.1+ PHPBB3-14793 --- phpBB/phpbb/db/migration/data/v310/timezone.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v310/timezone.php b/phpBB/phpbb/db/migration/data/v310/timezone.php index 1f6b47ad50..03a8d1ab34 100644 --- a/phpBB/phpbb/db/migration/data/v310/timezone.php +++ b/phpBB/phpbb/db/migration/data/v310/timezone.php @@ -103,7 +103,7 @@ class timezone extends \phpbb\db\migration\migration */ public function convert_phpbb30_timezone($timezone, $dst) { - $offset = $timezone + $dst; + $offset = (float) $timezone + (int) $dst; switch ($timezone) { -- cgit v1.2.1 From d90afa67d866e1be44d3a69c97497c8412695f8d Mon Sep 17 00:00:00 2001 From: Tristan Darricau Date: Sun, 9 Oct 2016 21:37:30 +0200 Subject: [ticket/14814] Fix reparser cron PHPBB3-14814 --- phpBB/phpbb/db/migration/data/v320/text_reparser.php | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v320/text_reparser.php b/phpBB/phpbb/db/migration/data/v320/text_reparser.php index ea614feb40..03c5d39fe4 100644 --- a/phpBB/phpbb/db/migration/data/v320/text_reparser.php +++ b/phpBB/phpbb/db/migration/data/v320/text_reparser.php @@ -13,6 +13,9 @@ namespace phpbb\db\migration\data\v320; +use phpbb\textreparser\manager; +use phpbb\textreparser\reparser_interface; + class text_reparser extends \phpbb\db\migration\container_aware_migration { static public function depends_on() @@ -48,7 +51,19 @@ class text_reparser extends \phpbb\db\migration\container_aware_migration public function reparse($resume_data) { - // Somtimes a cron job is too much + /** @var manager $reparser_manager */ + $reparser_manager = $this->container->get('text_reparser.manager'); + + /** @var reparser_interface[] $reparsers */ + $reparsers = $this->container->get('text_reparser_collection'); + + // Initialize all reparsers + foreach ($reparsers as $name => $reparser) + { + $reparser_manager->update_resume_data($name, 1, $reparser->get_max_id(), 100); + } + + // Sometimes a cron job is too much $limit = 100; $fast_reparsers = array( 'text_reparser.contact_admin_info', @@ -65,7 +80,7 @@ class text_reparser extends \phpbb\db\migration\container_aware_migration ); } - $fast_reparsers_size = sizeof($fast_reparsers); + $fast_reparsers_size = count($fast_reparsers); $processed_records = 0; while ($processed_records < $limit && $resume_data['reparser'] < $fast_reparsers_size) { @@ -87,7 +102,6 @@ class text_reparser extends \phpbb\db\migration\container_aware_migration if ($start === 1) { // Prevent CLI command from running these reparsers again - $reparser_manager = $this->container->get('text_reparser.manager'); $reparser_manager->update_resume_data($fast_reparsers[$resume_data['reparser']], 1, 0, $limit); $resume_data['reparser']++; -- cgit v1.2.1 From 78c2e31ec2cab20f5fc0555706b27b63ad7d9437 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sun, 13 Nov 2016 11:45:42 +0100 Subject: [ticket/security-181] Add .htaccess to 3.2.x migrations SECURITY-181 --- phpBB/phpbb/db/migration/data/v320/.htaccess | 33 ++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v320/.htaccess (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v320/.htaccess b/phpBB/phpbb/db/migration/data/v320/.htaccess new file mode 100644 index 0000000000..44242b5418 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v320/.htaccess @@ -0,0 +1,33 @@ +# With Apache 2.4 the "Order, Deny" syntax has been deprecated and moved from +# module mod_authz_host to a new module called mod_access_compat (which may be +# disabled) and a new "Require" syntax has been introduced to mod_authz_host. +# We could just conditionally provide both versions, but unfortunately Apache +# does not explicitly tell us its version if the module mod_version is not +# available. In this case, we check for the availability of module +# mod_authz_core (which should be on 2.4 or higher only) as a best guess. + + + + Order Allow,Deny + Deny from All + + + = 2.4> + + Require all denied + + + + + + + Order Allow,Deny + Deny from All + + + + + Require all denied + + + -- cgit v1.2.1 From c1035c98e455548fe14fbf5443bb98137d4e3d5d Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sun, 31 Jan 2016 23:49:17 +0100 Subject: [ticket/14492] Rename files to help_phpbb and fix css tabbing PHPBB3-14492 --- .../db/migration/data/v320/add_help_phpbb.php | 49 ++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v320/add_help_phpbb.php (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v320/add_help_phpbb.php b/phpBB/phpbb/db/migration/data/v320/add_help_phpbb.php new file mode 100644 index 0000000000..4274f53520 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v320/add_help_phpbb.php @@ -0,0 +1,49 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v320; + +class add_help_phpbb extends \phpbb\db\migration\migration +{ + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v320\v320a2', + ); + } + + public function effectively_installed() + { + return isset($this->config['help_send_statistics']); + } + + public function update_data() + { + return array( + array('config.add', array('help_send_statistics', true)), + array('module.remove', array( + 'acp', + false, + 'ACP_SEND_STATISTICS', + )), + array('module.add', array( + 'acp', + 'ACP_SERVER_CONFIGURATION', + array( + 'module_basename' => 'acp_help_phpbb', + 'modes' => array('help_phpbb'), + ), + )), + ); + } +} -- cgit v1.2.1 From 89fef2ce13a183c7b963032274f455a09a05f325 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sun, 21 Feb 2016 22:14:58 +0100 Subject: [ticket/14492] Send statistics via ajax request Flooding ajax requests will try to be prevented and sending stats without JS will also properly work. PHPBB3-14492 --- phpBB/phpbb/db/migration/data/v320/add_help_phpbb.php | 1 + 1 file changed, 1 insertion(+) (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v320/add_help_phpbb.php b/phpBB/phpbb/db/migration/data/v320/add_help_phpbb.php index 4274f53520..2634cee643 100644 --- a/phpBB/phpbb/db/migration/data/v320/add_help_phpbb.php +++ b/phpBB/phpbb/db/migration/data/v320/add_help_phpbb.php @@ -31,6 +31,7 @@ class add_help_phpbb extends \phpbb\db\migration\migration { return array( array('config.add', array('help_send_statistics', true)), + array('config.add', array('help_send_statistics_time', 0)), array('module.remove', array( 'acp', false, -- cgit v1.2.1 From c54838b25f50dca71a2f516175621a7ccd39a071 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Fri, 9 Sep 2016 22:59:58 +0200 Subject: [ticket/14492] Update versions in files PHPBB3-14492 --- phpBB/phpbb/db/migration/data/v320/add_help_phpbb.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v320/add_help_phpbb.php b/phpBB/phpbb/db/migration/data/v320/add_help_phpbb.php index 2634cee643..afa67fbc58 100644 --- a/phpBB/phpbb/db/migration/data/v320/add_help_phpbb.php +++ b/phpBB/phpbb/db/migration/data/v320/add_help_phpbb.php @@ -18,7 +18,7 @@ class add_help_phpbb extends \phpbb\db\migration\migration static public function depends_on() { return array( - '\phpbb\db\migration\data\v320\v320a2', + '\phpbb\db\migration\data\v320\v320rc1', ); } -- cgit v1.2.1 From a35c8a924ee824a10468e75df375c870b550d550 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Tue, 6 Dec 2016 15:41:58 +0100 Subject: [prep-release-3.2.0-RC2] Add migration file for 3.2.0-RC2 --- phpBB/phpbb/db/migration/data/v320/v320rc2.php | 40 ++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v320/v320rc2.php (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v320/v320rc2.php b/phpBB/phpbb/db/migration/data/v320/v320rc2.php new file mode 100644 index 0000000000..ec9bb62732 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v320/v320rc2.php @@ -0,0 +1,40 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v320; + +use phpbb\db\migration\migration; + +class v320rc2 extends migration +{ + public function effectively_installed() + { + return version_compare($this->config['version'], '3.2.0-RC2', '>='); + } + + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v31x\remove_duplicate_migrations', + '\phpbb\db\migration\data\v31x\add_log_time_index', + '\phpbb\db\migration\data\v320\add_help_phpbb', + ); + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.2.0-RC2')), + ); + } +} -- cgit v1.2.1 From e0eeea800cb51217e4511c3bcfcba6406d89f314 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Fri, 6 Jan 2017 00:57:12 +0100 Subject: [ticket/14961] Add cookie notice as enablable feature Uses Insites cookieconsent v3.0.3: https://cookieconsent.insites.com PHPBB3-14961 --- .../phpbb/db/migration/data/v320/cookie_notice.php | 31 ++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v320/cookie_notice.php (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v320/cookie_notice.php b/phpBB/phpbb/db/migration/data/v320/cookie_notice.php new file mode 100644 index 0000000000..75cb03b3ef --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v320/cookie_notice.php @@ -0,0 +1,31 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v320; + +class cookie_notice extends \phpbb\db\migration\migration +{ + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v320\v320rc2', + ); + } + + public function update_data() + { + return array( + array('config.add', array('cookie_notice', false)), + ); + } +} -- cgit v1.2.1 From da8ec61ab2dba1c8bb770932a6983cddbbb1251c Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sat, 7 Jan 2017 11:48:15 +0100 Subject: [prep-release-3.2.0] Update version numbers and add 3.2.0 migration --- phpBB/phpbb/db/migration/data/v320/v320.php | 40 +++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v320/v320.php (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v320/v320.php b/phpBB/phpbb/db/migration/data/v320/v320.php new file mode 100644 index 0000000000..20e741cb8b --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v320/v320.php @@ -0,0 +1,40 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v320; + +use phpbb\db\migration\migration; + +class v320 extends migration +{ + public function effectively_installed() + { + return version_compare($this->config['version'], '3.2.0', '>='); + } + + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v31x\increase_size_of_emotion', + '\phpbb\db\migration\data\v320\cookie_notice', + ); + + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.2.0')), + ); + } +} -- cgit v1.2.1 From 40985de245d7eb5426f8379d93283331d1eab65a Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sun, 8 Jan 2017 10:48:30 +0100 Subject: [ticket/14967] Add cookie notice migration fixing invalid previous one PHPBB3-14967 --- .../db/migration/data/v32x/cookie_notice_p2.php | 36 ++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v32x/cookie_notice_p2.php (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v32x/cookie_notice_p2.php b/phpBB/phpbb/db/migration/data/v32x/cookie_notice_p2.php new file mode 100644 index 0000000000..1a83175705 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v32x/cookie_notice_p2.php @@ -0,0 +1,36 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v32x; + +class cookie_notice_p2 extends \phpbb\db\migration\migration +{ + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v320\v320', + ); + } + + public function effectively_installed() + { + return isset($this->config['cookie_notice']); + } + + public function update_data() + { + return array( + array('config.add', array('cookie_notice', '0')), + ); + } +} -- cgit v1.2.1 From e5eb7025141238a3486a0395c42c55411dafb259 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Col=C3=B3n?= Date: Mon, 13 Feb 2017 14:03:54 -0500 Subject: [ticket/14992] Add indexes to user_notifications table [ticket/14992] Change how index length is checked [ticket/14992] Remove duplicates from user_notifications table [ticket/14992] Add unique index to user_notifications table [ticket/14992] Shorten unique index name [ticket/14992] Shorten another index for user notifications --- .../data/v32x/user_notifications_table_indexes.php | 50 ++++++++++++++++++++ .../user_notifications_table_remove_duplicates.php | 55 ++++++++++++++++++++++ .../v32x/user_notifications_table_unique_index.php | 46 ++++++++++++++++++ 3 files changed, 151 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v32x/user_notifications_table_indexes.php create mode 100644 phpBB/phpbb/db/migration/data/v32x/user_notifications_table_remove_duplicates.php create mode 100644 phpBB/phpbb/db/migration/data/v32x/user_notifications_table_unique_index.php (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v32x/user_notifications_table_indexes.php b/phpBB/phpbb/db/migration/data/v32x/user_notifications_table_indexes.php new file mode 100644 index 0000000000..86a3891b46 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v32x/user_notifications_table_indexes.php @@ -0,0 +1,50 @@ + + * @license GNU General Public License, version 2 (GPL-2.0) + * + * For full copyright and license information, please see + * the docs/CREDITS.txt file. + * + */ + +namespace phpbb\db\migration\data\v32x; + +class user_notifications_table_indexes extends \phpbb\db\migration\migration +{ + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v32x\cookie_notice_p2', + ); + } + + public function update_schema() + { + return array( + 'add_index' => array( + $this->table_prefix . 'user_notifications' => array( + 'user_id' => array('user_id'), + 'user_id_item_id' => array('user_id', 'item_id'), + 'user_itm_type_id' => array('user_id', 'item_type', 'item_id'), + ), + ), + ); + } + + public function revert_schema() + { + return array( + 'drop_keys' => array( + $this->table_prefix . 'user_notifications' => array( + 'user_id', + 'user_id_item_id', + 'user_itm_type_id', + ), + ), + ); + } +} diff --git a/phpBB/phpbb/db/migration/data/v32x/user_notifications_table_remove_duplicates.php b/phpBB/phpbb/db/migration/data/v32x/user_notifications_table_remove_duplicates.php new file mode 100644 index 0000000000..f5f0305fda --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v32x/user_notifications_table_remove_duplicates.php @@ -0,0 +1,55 @@ + + * @license GNU General Public License, version 2 (GPL-2.0) + * + * For full copyright and license information, please see + * the docs/CREDITS.txt file. + * + */ + +namespace phpbb\db\migration\data\v32x; + +class user_notifications_table_remove_duplicates extends \phpbb\db\migration\migration +{ + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v32x\user_notifications_table_indexes', + ); + } + + public function update_data() + { + return array( + array('custom', array(array($this, 'remove_duplicates'))), + ); + } + + public function remove_duplicates() + { + $insert_buffer = new \phpbb\db\sql_insert_buffer($this->db, $this->table_prefix . 'user_notifications'); + + $sql = "SELECT item_type, item_id, user_id, method, MAX(notify) AS notify + FROM {$this->table_prefix}user_notifications + GROUP BY item_type, item_id, user_id, method + HAVING COUNT(item_type) > 1"; + + $result = $this->sql_query($sql); + while ($row = $this->db->sql_fetchrow($result)) + { + // Delete the duplicate entries + $this->sql_query("DELETE FROM {$this->table_prefix}user_notifications + WHERE user_id = {$row['user_id']} + AND item_type = '{$row['item_type']}' + AND method = '{$row['method']}'"); + + // And re-insert as a single one + $insert_buffer->insert($row); + } + $this->db->sql_freeresult($result); + } +} diff --git a/phpBB/phpbb/db/migration/data/v32x/user_notifications_table_unique_index.php b/phpBB/phpbb/db/migration/data/v32x/user_notifications_table_unique_index.php new file mode 100644 index 0000000000..925197a02b --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v32x/user_notifications_table_unique_index.php @@ -0,0 +1,46 @@ + + * @license GNU General Public License, version 2 (GPL-2.0) + * + * For full copyright and license information, please see + * the docs/CREDITS.txt file. + * + */ + +namespace phpbb\db\migration\data\v32x; + +class user_notifications_table_unique_index extends \phpbb\db\migration\migration +{ + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v32x\user_notifications_table_remove_duplicates', + ); + } + + public function update_schema() + { + return array( + 'add_unique_index' => array( + $this->table_prefix . 'user_notifications' => array( + 'itm_usr_mthd' => array('item_type', 'item_id', 'user_id', 'method'), + ), + ), + ); + } + + public function revert_schema() + { + return array( + 'drop_keys' => array( + $this->table_prefix . 'user_notifications' => array( + 'itm_usr_mthd', + ), + ), + ); + } +} -- cgit v1.2.1 From 59ac4a71b6dc53f2edf8bb5c669b14df9ce5544a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Col=C3=B3n?= Date: Wed, 1 Mar 2017 22:55:13 -0500 Subject: [ticket/14992] Check index name length in a more proper way [ticket/14992] Add indexes to user_notifications table --- .../v32x/user_notifications_table_index_p1.php | 46 ++++++++++++++++++++ .../v32x/user_notifications_table_index_p2.php | 46 ++++++++++++++++++++ .../v32x/user_notifications_table_index_p3.php | 46 ++++++++++++++++++++ .../data/v32x/user_notifications_table_indexes.php | 50 ---------------------- .../user_notifications_table_remove_duplicates.php | 2 +- .../v32x/user_notifications_table_temp_index.php | 46 ++++++++++++++++++++ .../v32x/user_notifications_table_unique_index.php | 7 ++- 7 files changed, 191 insertions(+), 52 deletions(-) create mode 100644 phpBB/phpbb/db/migration/data/v32x/user_notifications_table_index_p1.php create mode 100644 phpBB/phpbb/db/migration/data/v32x/user_notifications_table_index_p2.php create mode 100644 phpBB/phpbb/db/migration/data/v32x/user_notifications_table_index_p3.php delete mode 100644 phpBB/phpbb/db/migration/data/v32x/user_notifications_table_indexes.php create mode 100644 phpBB/phpbb/db/migration/data/v32x/user_notifications_table_temp_index.php (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v32x/user_notifications_table_index_p1.php b/phpBB/phpbb/db/migration/data/v32x/user_notifications_table_index_p1.php new file mode 100644 index 0000000000..93ff31ec6c --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v32x/user_notifications_table_index_p1.php @@ -0,0 +1,46 @@ + + * @license GNU General Public License, version 2 (GPL-2.0) + * + * For full copyright and license information, please see + * the docs/CREDITS.txt file. + * + */ + +namespace phpbb\db\migration\data\v32x; + +class user_notifications_table_index_p1 extends \phpbb\db\migration\migration +{ + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v32x\cookie_notice_p2', + ); + } + + public function update_schema() + { + return array( + 'add_index' => array( + $this->table_prefix . 'user_notifications' => array( + 'user_id' => array('user_id'), + ), + ), + ); + } + + public function revert_schema() + { + return array( + 'drop_keys' => array( + $this->table_prefix . 'user_notifications' => array( + 'user_id', + ), + ), + ); + } +} diff --git a/phpBB/phpbb/db/migration/data/v32x/user_notifications_table_index_p2.php b/phpBB/phpbb/db/migration/data/v32x/user_notifications_table_index_p2.php new file mode 100644 index 0000000000..e492b4e1f8 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v32x/user_notifications_table_index_p2.php @@ -0,0 +1,46 @@ + + * @license GNU General Public License, version 2 (GPL-2.0) + * + * For full copyright and license information, please see + * the docs/CREDITS.txt file. + * + */ + +namespace phpbb\db\migration\data\v32x; + +class user_notifications_table_index_p2 extends \phpbb\db\migration\migration +{ + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v32x\user_notifications_table_index_p1', + ); + } + + public function update_schema() + { + return array( + 'add_index' => array( + $this->table_prefix . 'user_notifications' => array( + 'usr_id_itm_id' => array('user_id', 'item_id'), + ), + ), + ); + } + + public function revert_schema() + { + return array( + 'drop_keys' => array( + $this->table_prefix . 'user_notifications' => array( + 'usr_id_itm_id', + ), + ), + ); + } +} diff --git a/phpBB/phpbb/db/migration/data/v32x/user_notifications_table_index_p3.php b/phpBB/phpbb/db/migration/data/v32x/user_notifications_table_index_p3.php new file mode 100644 index 0000000000..1636b3024a --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v32x/user_notifications_table_index_p3.php @@ -0,0 +1,46 @@ + + * @license GNU General Public License, version 2 (GPL-2.0) + * + * For full copyright and license information, please see + * the docs/CREDITS.txt file. + * + */ + +namespace phpbb\db\migration\data\v32x; + +class user_notifications_table_index_p3 extends \phpbb\db\migration\migration +{ + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v32x\user_notifications_table_index_p2', + ); + } + + public function update_schema() + { + return array( + 'add_index' => array( + $this->table_prefix . 'user_notifications' => array( + 'usr_itm_tpe' => array('user_id', 'item_type', 'item_id'), + ), + ), + ); + } + + public function revert_schema() + { + return array( + 'drop_keys' => array( + $this->table_prefix . 'user_notifications' => array( + 'usr_itm_tpe', + ), + ), + ); + } +} diff --git a/phpBB/phpbb/db/migration/data/v32x/user_notifications_table_indexes.php b/phpBB/phpbb/db/migration/data/v32x/user_notifications_table_indexes.php deleted file mode 100644 index 86a3891b46..0000000000 --- a/phpBB/phpbb/db/migration/data/v32x/user_notifications_table_indexes.php +++ /dev/null @@ -1,50 +0,0 @@ - - * @license GNU General Public License, version 2 (GPL-2.0) - * - * For full copyright and license information, please see - * the docs/CREDITS.txt file. - * - */ - -namespace phpbb\db\migration\data\v32x; - -class user_notifications_table_indexes extends \phpbb\db\migration\migration -{ - static public function depends_on() - { - return array( - '\phpbb\db\migration\data\v32x\cookie_notice_p2', - ); - } - - public function update_schema() - { - return array( - 'add_index' => array( - $this->table_prefix . 'user_notifications' => array( - 'user_id' => array('user_id'), - 'user_id_item_id' => array('user_id', 'item_id'), - 'user_itm_type_id' => array('user_id', 'item_type', 'item_id'), - ), - ), - ); - } - - public function revert_schema() - { - return array( - 'drop_keys' => array( - $this->table_prefix . 'user_notifications' => array( - 'user_id', - 'user_id_item_id', - 'user_itm_type_id', - ), - ), - ); - } -} diff --git a/phpBB/phpbb/db/migration/data/v32x/user_notifications_table_remove_duplicates.php b/phpBB/phpbb/db/migration/data/v32x/user_notifications_table_remove_duplicates.php index f5f0305fda..50d0642056 100644 --- a/phpBB/phpbb/db/migration/data/v32x/user_notifications_table_remove_duplicates.php +++ b/phpBB/phpbb/db/migration/data/v32x/user_notifications_table_remove_duplicates.php @@ -18,7 +18,7 @@ class user_notifications_table_remove_duplicates extends \phpbb\db\migration\mig static public function depends_on() { return array( - '\phpbb\db\migration\data\v32x\user_notifications_table_indexes', + '\phpbb\db\migration\data\v32x\user_notifications_table_temp_index', ); } diff --git a/phpBB/phpbb/db/migration/data/v32x/user_notifications_table_temp_index.php b/phpBB/phpbb/db/migration/data/v32x/user_notifications_table_temp_index.php new file mode 100644 index 0000000000..eea44e168c --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v32x/user_notifications_table_temp_index.php @@ -0,0 +1,46 @@ + + * @license GNU General Public License, version 2 (GPL-2.0) + * + * For full copyright and license information, please see + * the docs/CREDITS.txt file. + * + */ + +namespace phpbb\db\migration\data\v32x; + +class user_notifications_table_temp_index extends \phpbb\db\migration\migration +{ + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v32x\user_notifications_table_index_p3', + ); + } + + public function update_schema() + { + return array( + 'add_index' => array( + $this->table_prefix . 'user_notifications' => array( + 'itm_usr_mthd' => array('item_type', 'item_id', 'user_id', 'method'), + ), + ), + ); + } + + public function revert_schema() + { + return array( + 'drop_keys' => array( + $this->table_prefix . 'user_notifications' => array( + 'itm_usr_mthd', + ), + ), + ); + } +} diff --git a/phpBB/phpbb/db/migration/data/v32x/user_notifications_table_unique_index.php b/phpBB/phpbb/db/migration/data/v32x/user_notifications_table_unique_index.php index 925197a02b..51cf90c8a0 100644 --- a/phpBB/phpbb/db/migration/data/v32x/user_notifications_table_unique_index.php +++ b/phpBB/phpbb/db/migration/data/v32x/user_notifications_table_unique_index.php @@ -25,7 +25,12 @@ class user_notifications_table_unique_index extends \phpbb\db\migration\migratio public function update_schema() { return array( - 'add_unique_index' => array( + 'drop_keys' => array( + $this->table_prefix . 'user_notifications' => array( + 'itm_usr_mthd', + ), + ), + 'add_unique_index' => array( $this->table_prefix . 'user_notifications' => array( 'itm_usr_mthd' => array('item_type', 'item_id', 'user_id', 'method'), ), -- cgit v1.2.1 From e7dfdbffb50d8f88d9a5a4c064a853f50d92acf0 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sat, 15 Apr 2017 12:06:03 +0200 Subject: [ticket/15090] Ensure send stats module exists before removing PHPBB3-15090 --- phpBB/phpbb/db/migration/data/v320/add_help_phpbb.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v320/add_help_phpbb.php b/phpBB/phpbb/db/migration/data/v320/add_help_phpbb.php index afa67fbc58..8fadb4bde4 100644 --- a/phpBB/phpbb/db/migration/data/v320/add_help_phpbb.php +++ b/phpBB/phpbb/db/migration/data/v320/add_help_phpbb.php @@ -32,10 +32,9 @@ class add_help_phpbb extends \phpbb\db\migration\migration return array( array('config.add', array('help_send_statistics', true)), array('config.add', array('help_send_statistics_time', 0)), - array('module.remove', array( - 'acp', - false, - 'ACP_SEND_STATISTICS', + array('if', array( + array('module.exists', array('acp', false, 'ACP_SEND_STATISTICS')), + array('module.remove', array('acp', false, 'ACP_SEND_STATISTICS')), )), array('module.add', array( 'acp', -- cgit v1.2.1 From aa37e9b7fc60bd443c6abbcdc3adbf28ae010f32 Mon Sep 17 00:00:00 2001 From: lr94 Date: Sun, 16 Apr 2017 16:28:38 +0200 Subject: [ticket/15176] Add setting for user activity display limit. Up to phpBB 3.2 the maximum number of posts a user must have to have his activity shown is 5000. This limit is hardcoded in functions_display.php. It would be useful if board administrators could choose to disable the limit or to set an higher value. PHPBB3-15176 --- .../data/v32x/load_user_activity_limit.php | 36 ++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v32x/load_user_activity_limit.php (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v32x/load_user_activity_limit.php b/phpBB/phpbb/db/migration/data/v32x/load_user_activity_limit.php new file mode 100644 index 0000000000..71bb6c00bf --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v32x/load_user_activity_limit.php @@ -0,0 +1,36 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v32x; + +class load_user_activity_limit extends \phpbb\db\migration\migration +{ + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v320\v320', + ); + } + + public function effectively_installed() + { + return isset($this->config['load_user_activity_limit']); + } + + public function update_data() + { + return array( + array('config.add', array('load_user_activity_limit', '5000')), + ); + } +} -- cgit v1.2.1 From 11f968e774fed238030f851c4ad90facf86e583f Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sun, 21 May 2017 14:18:10 +0200 Subject: [ticket/14992] Shorten index name for user_id and item_id PHPBB3-14992 --- .../db/migration/data/v32x/user_notifications_table_index_p2.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v32x/user_notifications_table_index_p2.php b/phpBB/phpbb/db/migration/data/v32x/user_notifications_table_index_p2.php index e492b4e1f8..0a471766a0 100644 --- a/phpBB/phpbb/db/migration/data/v32x/user_notifications_table_index_p2.php +++ b/phpBB/phpbb/db/migration/data/v32x/user_notifications_table_index_p2.php @@ -27,7 +27,7 @@ class user_notifications_table_index_p2 extends \phpbb\db\migration\migration return array( 'add_index' => array( $this->table_prefix . 'user_notifications' => array( - 'usr_id_itm_id' => array('user_id', 'item_id'), + 'uid_itm_id' => array('user_id', 'item_id'), ), ), ); @@ -38,7 +38,7 @@ class user_notifications_table_index_p2 extends \phpbb\db\migration\migration return array( 'drop_keys' => array( $this->table_prefix . 'user_notifications' => array( - 'usr_id_itm_id', + 'uid_itm_id', ), ), ); -- cgit v1.2.1 From f3c782b3584c1c006e5d3da602ff953381f3e6b9 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sun, 21 May 2017 16:14:11 +0200 Subject: [ticket/14992] Make unit tests run more verbose PHPBB3-14992 --- .../db/migration/data/v32x/user_notifications_table_temp_index.php | 2 +- .../db/migration/data/v32x/user_notifications_table_unique_index.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v32x/user_notifications_table_temp_index.php b/phpBB/phpbb/db/migration/data/v32x/user_notifications_table_temp_index.php index eea44e168c..a6a321dbde 100644 --- a/phpBB/phpbb/db/migration/data/v32x/user_notifications_table_temp_index.php +++ b/phpBB/phpbb/db/migration/data/v32x/user_notifications_table_temp_index.php @@ -27,7 +27,7 @@ class user_notifications_table_temp_index extends \phpbb\db\migration\migration return array( 'add_index' => array( $this->table_prefix . 'user_notifications' => array( - 'itm_usr_mthd' => array('item_type', 'item_id', 'user_id', 'method'), + 'itm_usr_mthd' => array('item_type', 'item_id', 'user_id'), ), ), ); diff --git a/phpBB/phpbb/db/migration/data/v32x/user_notifications_table_unique_index.php b/phpBB/phpbb/db/migration/data/v32x/user_notifications_table_unique_index.php index 51cf90c8a0..d279af7fec 100644 --- a/phpBB/phpbb/db/migration/data/v32x/user_notifications_table_unique_index.php +++ b/phpBB/phpbb/db/migration/data/v32x/user_notifications_table_unique_index.php @@ -32,7 +32,7 @@ class user_notifications_table_unique_index extends \phpbb\db\migration\migratio ), 'add_unique_index' => array( $this->table_prefix . 'user_notifications' => array( - 'itm_usr_mthd' => array('item_type', 'item_id', 'user_id', 'method'), + 'itm_usr_mthd' => array('item_type', 'item_id', 'user_id'), ), ), ); -- cgit v1.2.1 From c2711fb6c46b47a4004319b6887d07487baef0dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Col=C3=B3n?= Date: Tue, 23 May 2017 13:57:28 -0400 Subject: [ticket/14992] Remove temp index migration --- .../user_notifications_table_remove_duplicates.php | 2 +- .../v32x/user_notifications_table_temp_index.php | 46 ---------------------- .../v32x/user_notifications_table_unique_index.php | 5 --- 3 files changed, 1 insertion(+), 52 deletions(-) delete mode 100644 phpBB/phpbb/db/migration/data/v32x/user_notifications_table_temp_index.php (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v32x/user_notifications_table_remove_duplicates.php b/phpBB/phpbb/db/migration/data/v32x/user_notifications_table_remove_duplicates.php index 50d0642056..371cdf9b3a 100644 --- a/phpBB/phpbb/db/migration/data/v32x/user_notifications_table_remove_duplicates.php +++ b/phpBB/phpbb/db/migration/data/v32x/user_notifications_table_remove_duplicates.php @@ -18,7 +18,7 @@ class user_notifications_table_remove_duplicates extends \phpbb\db\migration\mig static public function depends_on() { return array( - '\phpbb\db\migration\data\v32x\user_notifications_table_temp_index', + '\phpbb\db\migration\data\v32x\user_notifications_table_index_p3', ); } diff --git a/phpBB/phpbb/db/migration/data/v32x/user_notifications_table_temp_index.php b/phpBB/phpbb/db/migration/data/v32x/user_notifications_table_temp_index.php deleted file mode 100644 index a6a321dbde..0000000000 --- a/phpBB/phpbb/db/migration/data/v32x/user_notifications_table_temp_index.php +++ /dev/null @@ -1,46 +0,0 @@ - - * @license GNU General Public License, version 2 (GPL-2.0) - * - * For full copyright and license information, please see - * the docs/CREDITS.txt file. - * - */ - -namespace phpbb\db\migration\data\v32x; - -class user_notifications_table_temp_index extends \phpbb\db\migration\migration -{ - static public function depends_on() - { - return array( - '\phpbb\db\migration\data\v32x\user_notifications_table_index_p3', - ); - } - - public function update_schema() - { - return array( - 'add_index' => array( - $this->table_prefix . 'user_notifications' => array( - 'itm_usr_mthd' => array('item_type', 'item_id', 'user_id'), - ), - ), - ); - } - - public function revert_schema() - { - return array( - 'drop_keys' => array( - $this->table_prefix . 'user_notifications' => array( - 'itm_usr_mthd', - ), - ), - ); - } -} diff --git a/phpBB/phpbb/db/migration/data/v32x/user_notifications_table_unique_index.php b/phpBB/phpbb/db/migration/data/v32x/user_notifications_table_unique_index.php index d279af7fec..3145b634c8 100644 --- a/phpBB/phpbb/db/migration/data/v32x/user_notifications_table_unique_index.php +++ b/phpBB/phpbb/db/migration/data/v32x/user_notifications_table_unique_index.php @@ -25,11 +25,6 @@ class user_notifications_table_unique_index extends \phpbb\db\migration\migratio public function update_schema() { return array( - 'drop_keys' => array( - $this->table_prefix . 'user_notifications' => array( - 'itm_usr_mthd', - ), - ), 'add_unique_index' => array( $this->table_prefix . 'user_notifications' => array( 'itm_usr_mthd' => array('item_type', 'item_id', 'user_id'), -- cgit v1.2.1 From 4c67f65d5db539ffc94259549d1cbf270703d7be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Col=C3=B3n?= Date: Wed, 24 May 2017 16:56:24 -0400 Subject: [ticket/14992] 'method' is needed for the unique index --- .../db/migration/data/v32x/user_notifications_table_unique_index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v32x/user_notifications_table_unique_index.php b/phpBB/phpbb/db/migration/data/v32x/user_notifications_table_unique_index.php index 3145b634c8..157a12472b 100644 --- a/phpBB/phpbb/db/migration/data/v32x/user_notifications_table_unique_index.php +++ b/phpBB/phpbb/db/migration/data/v32x/user_notifications_table_unique_index.php @@ -27,7 +27,7 @@ class user_notifications_table_unique_index extends \phpbb\db\migration\migratio return array( 'add_unique_index' => array( $this->table_prefix . 'user_notifications' => array( - 'itm_usr_mthd' => array('item_type', 'item_id', 'user_id'), + 'itm_usr_mthd' => array('item_type', 'item_id', 'user_id', 'method'), ), ), ); -- cgit v1.2.1 From a6317dc52dded6eeb3adb174b5d843673b7dbc15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Col=C3=B3n?= Date: Wed, 24 May 2017 17:34:17 -0400 Subject: [ticket/14992] Reduce notification table col sizes --- ...ser_notifications_table_reduce_column_sizes.php | 48 ++++++++++++++++++++++ .../v32x/user_notifications_table_unique_index.php | 2 +- 2 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 phpBB/phpbb/db/migration/data/v32x/user_notifications_table_reduce_column_sizes.php (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v32x/user_notifications_table_reduce_column_sizes.php b/phpBB/phpbb/db/migration/data/v32x/user_notifications_table_reduce_column_sizes.php new file mode 100644 index 0000000000..c2efb8fd4f --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v32x/user_notifications_table_reduce_column_sizes.php @@ -0,0 +1,48 @@ + + * @license GNU General Public License, version 2 (GPL-2.0) + * + * For full copyright and license information, please see + * the docs/CREDITS.txt file. + * + */ + +namespace phpbb\db\migration\data\v32x; + +class user_notifications_table_reduce_column_sizes extends \phpbb\db\migration\migration +{ + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v32x\user_notifications_table_remove_duplicates', + ); + } + + public function update_schema() + { + return array( + 'change_columns' => array( + $this->table_prefix . 'user_notifications' => array( + 'item_type' => array('VCHAR:165', ''), + 'method' => array('VCHAR:165', ''), + ), + ), + ); + } + + public function revert_schema() + { + return array( + 'change_columns' => array( + $this->table_prefix . 'user_notifications' => array( + 'item_type' => array('VCHAR:255', ''), + 'method' => array('VCHAR:255', ''), + ), + ), + ); + } +} diff --git a/phpBB/phpbb/db/migration/data/v32x/user_notifications_table_unique_index.php b/phpBB/phpbb/db/migration/data/v32x/user_notifications_table_unique_index.php index 157a12472b..e46c231b7b 100644 --- a/phpBB/phpbb/db/migration/data/v32x/user_notifications_table_unique_index.php +++ b/phpBB/phpbb/db/migration/data/v32x/user_notifications_table_unique_index.php @@ -18,7 +18,7 @@ class user_notifications_table_unique_index extends \phpbb\db\migration\migratio static public function depends_on() { return array( - '\phpbb\db\migration\data\v32x\user_notifications_table_remove_duplicates', + '\phpbb\db\migration\data\v32x\user_notifications_table_reduce_column_sizes', ); } -- cgit v1.2.1 From 9029a925aaf56427748cd119749f97ac77932b21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Col=C3=B3n?= Date: Thu, 25 May 2017 14:06:10 -0400 Subject: [ticket/14992] Add temp index migration for removing duplicates --- ...ser_notifications_table_reduce_column_sizes.php | 2 +- .../user_notifications_table_remove_duplicates.php | 2 +- .../v32x/user_notifications_table_temp_index.php | 46 ++++++++++++++++++++++ .../v32x/user_notifications_table_unique_index.php | 7 +++- 4 files changed, 54 insertions(+), 3 deletions(-) create mode 100644 phpBB/phpbb/db/migration/data/v32x/user_notifications_table_temp_index.php (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v32x/user_notifications_table_reduce_column_sizes.php b/phpBB/phpbb/db/migration/data/v32x/user_notifications_table_reduce_column_sizes.php index c2efb8fd4f..e0a107782e 100644 --- a/phpBB/phpbb/db/migration/data/v32x/user_notifications_table_reduce_column_sizes.php +++ b/phpBB/phpbb/db/migration/data/v32x/user_notifications_table_reduce_column_sizes.php @@ -18,7 +18,7 @@ class user_notifications_table_reduce_column_sizes extends \phpbb\db\migration\m static public function depends_on() { return array( - '\phpbb\db\migration\data\v32x\user_notifications_table_remove_duplicates', + '\phpbb\db\migration\data\v32x\user_notifications_table_index_p3', ); } diff --git a/phpBB/phpbb/db/migration/data/v32x/user_notifications_table_remove_duplicates.php b/phpBB/phpbb/db/migration/data/v32x/user_notifications_table_remove_duplicates.php index 371cdf9b3a..50d0642056 100644 --- a/phpBB/phpbb/db/migration/data/v32x/user_notifications_table_remove_duplicates.php +++ b/phpBB/phpbb/db/migration/data/v32x/user_notifications_table_remove_duplicates.php @@ -18,7 +18,7 @@ class user_notifications_table_remove_duplicates extends \phpbb\db\migration\mig static public function depends_on() { return array( - '\phpbb\db\migration\data\v32x\user_notifications_table_index_p3', + '\phpbb\db\migration\data\v32x\user_notifications_table_temp_index', ); } diff --git a/phpBB/phpbb/db/migration/data/v32x/user_notifications_table_temp_index.php b/phpBB/phpbb/db/migration/data/v32x/user_notifications_table_temp_index.php new file mode 100644 index 0000000000..80256a0e0a --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v32x/user_notifications_table_temp_index.php @@ -0,0 +1,46 @@ + + * @license GNU General Public License, version 2 (GPL-2.0) + * + * For full copyright and license information, please see + * the docs/CREDITS.txt file. + * + */ + +namespace phpbb\db\migration\data\v32x; + +class user_notifications_table_temp_index extends \phpbb\db\migration\migration +{ + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v32x\user_notifications_table_reduce_column_sizes', + ); + } + + public function update_schema() + { + return array( + 'add_index' => array( + $this->table_prefix . 'user_notifications' => array( + 'itm_usr_mthd' => array('item_type', 'item_id', 'user_id', 'method'), + ), + ), + ); + } + + public function revert_schema() + { + return array( + 'drop_keys' => array( + $this->table_prefix . 'user_notifications' => array( + 'itm_usr_mthd', + ), + ), + ); + } +} diff --git a/phpBB/phpbb/db/migration/data/v32x/user_notifications_table_unique_index.php b/phpBB/phpbb/db/migration/data/v32x/user_notifications_table_unique_index.php index e46c231b7b..51cf90c8a0 100644 --- a/phpBB/phpbb/db/migration/data/v32x/user_notifications_table_unique_index.php +++ b/phpBB/phpbb/db/migration/data/v32x/user_notifications_table_unique_index.php @@ -18,13 +18,18 @@ class user_notifications_table_unique_index extends \phpbb\db\migration\migratio static public function depends_on() { return array( - '\phpbb\db\migration\data\v32x\user_notifications_table_reduce_column_sizes', + '\phpbb\db\migration\data\v32x\user_notifications_table_remove_duplicates', ); } public function update_schema() { return array( + 'drop_keys' => array( + $this->table_prefix . 'user_notifications' => array( + 'itm_usr_mthd', + ), + ), 'add_unique_index' => array( $this->table_prefix . 'user_notifications' => array( 'itm_usr_mthd' => array('item_type', 'item_id', 'user_id', 'method'), -- cgit v1.2.1 From 03cd4658d08caa062509fdf0e6ee7d6d296b67c0 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sun, 25 Jun 2017 21:59:14 +0200 Subject: [prep-release-3.2.1] Add migration for 3.2.1-RC1 --- phpBB/phpbb/db/migration/data/v32x/v321rc1.php | 39 ++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v32x/v321rc1.php (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v32x/v321rc1.php b/phpBB/phpbb/db/migration/data/v32x/v321rc1.php new file mode 100644 index 0000000000..653a16f327 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v32x/v321rc1.php @@ -0,0 +1,39 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v32x; + +class v321rc1 extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return phpbb_version_compare($this->config['version'], '3.2.1-RC1', '>='); + } + + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v320\v320', + '\phpbb\db\migration\data\v31x\v3111rc1', + '\phpbb\db\migration\data\v32x\load_user_activity_limit', + '\phpbb\db\migration\data\v32x\user_notifications_table_unique_index', + ); + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.2.1-RC1')), + ); + } +} -- cgit v1.2.1 From 4b733426698760801ff2b8ce3ce077c16732d4ef Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sun, 16 Jul 2017 17:12:01 +0200 Subject: [prep-release-3.2.1] Add migration for 3.2.1 --- phpBB/phpbb/db/migration/data/v32x/v321.php | 37 +++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v32x/v321.php (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v32x/v321.php b/phpBB/phpbb/db/migration/data/v32x/v321.php new file mode 100644 index 0000000000..268f978b4b --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v32x/v321.php @@ -0,0 +1,37 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v32x; + +class v321 extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return phpbb_version_compare($this->config['version'], '3.2.1', '>='); + } + + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v32x\v321rc1', + ); + + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.2.1')), + ); + } +} -- cgit v1.2.1 From 5216bf44838f8395d27b3df4ec1641a6407cb466 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sun, 16 Jul 2017 20:07:13 +0200 Subject: [prep-release-3.2.1] Add missing .htaccess file --- phpBB/phpbb/db/migration/data/v32x/.htaccess | 33 ++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v32x/.htaccess (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v32x/.htaccess b/phpBB/phpbb/db/migration/data/v32x/.htaccess new file mode 100644 index 0000000000..44242b5418 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v32x/.htaccess @@ -0,0 +1,33 @@ +# With Apache 2.4 the "Order, Deny" syntax has been deprecated and moved from +# module mod_authz_host to a new module called mod_access_compat (which may be +# disabled) and a new "Require" syntax has been introduced to mod_authz_host. +# We could just conditionally provide both versions, but unfortunately Apache +# does not explicitly tell us its version if the module mod_version is not +# available. In this case, we check for the availability of module +# mod_authz_core (which should be on 2.4 or higher only) as a best guess. + + + + Order Allow,Deny + Deny from All + + + = 2.4> + + Require all denied + + + + + + + Order Allow,Deny + Deny from All + + + + + Require all denied + + + -- cgit v1.2.1 From 4719f94cecd8a3f585c9ca1c75336aa109849844 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Calvo?= Date: Fri, 28 Apr 2017 22:41:07 +0200 Subject: [ticket/15201] Remove wrong user style check PHPBB3-15201 --- phpBB/phpbb/db/migration/data/v310/style_update_p1.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v310/style_update_p1.php b/phpBB/phpbb/db/migration/data/v310/style_update_p1.php index 2c7b7edf2e..dcf031a7a7 100644 --- a/phpBB/phpbb/db/migration/data/v310/style_update_p1.php +++ b/phpBB/phpbb/db/migration/data/v310/style_update_p1.php @@ -165,7 +165,7 @@ class style_update_p1 extends \phpbb\db\migration\migration $this->config->set('default_style', $default_style); - $sql = 'UPDATE ' . USERS_TABLE . ' SET user_style = 0'; + $sql = 'UPDATE ' . USERS_TABLE . ' SET user_style = ' . $default_style; $this->sql_query($sql); } else @@ -183,9 +183,9 @@ class style_update_p1 extends \phpbb\db\migration\migration } // Reset styles for users - $this->sql_query('UPDATE ' . USERS_TABLE . ' - SET user_style = 0 - WHERE ' . $this->db->sql_in_set('user_style', $valid_styles, true)); + $this->sql_query('UPDATE ' . USERS_TABLE . " + SET user_style = '" . $valid_styles[0] . "' + WHERE " . $this->db->sql_in_set('user_style', $valid_styles, true)); } } } -- cgit v1.2.1 From 13b0f399612bf3c3f6ce04bda46429dab572e590 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Calvo?= Date: Sat, 29 Apr 2017 09:47:48 +0200 Subject: [ticket/15201] Migration to fix current invalid styles PHPBB3-15201 --- .../db/migration/data/v32x/fix_user_styles.php | 50 ++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v32x/fix_user_styles.php (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v32x/fix_user_styles.php b/phpBB/phpbb/db/migration/data/v32x/fix_user_styles.php new file mode 100644 index 0000000000..e0caae812a --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v32x/fix_user_styles.php @@ -0,0 +1,50 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v32x; + +class fix_user_styles extends \phpbb\db\migration\migration +{ + + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v320\v320', + ); + } + + public function update_data() + { + return array( + array('custom', array(array($this, 'styles_fix'))), + ); + } + + public function styles_fix() + { + $default_style = (int) $this->config['default_style']; + + // Get enabled styles + $sql = 'SELECT style_id + FROM ' . STYLES_TABLE . ' + WHERE style_active = 1'; + $result = $this->db->sql_query($sql); + $enabled_styles = $result->fetch_array(); + $this->db->sql_freeresult($result); + + // Set the default style to users who have an invalid style + $this->sql_query('UPDATE ' . USERS_TABLE . " + SET user_style = $default_style + WHERE " . $this->db->sql_in_set('user_style', $enabled_styles, true)); + } +} -- cgit v1.2.1 From 4b1ec6abb7b2d2daa320ac5e2872e055bc5b07d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Calvo?= Date: Fri, 8 Sep 2017 10:59:47 +0200 Subject: [ticket/15201] Fix tests PHPBB3-15201 --- phpBB/phpbb/db/migration/data/v310/style_update_p1.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v310/style_update_p1.php b/phpBB/phpbb/db/migration/data/v310/style_update_p1.php index dcf031a7a7..3e28e8747d 100644 --- a/phpBB/phpbb/db/migration/data/v310/style_update_p1.php +++ b/phpBB/phpbb/db/migration/data/v310/style_update_p1.php @@ -160,7 +160,7 @@ class style_update_p1 extends \phpbb\db\migration\migration FROM ' . STYLES_TABLE . " WHERE style_name = 'prosilver'"; $result = $this->sql_query($sql); - $default_style = $this->db->sql_fetchfield('style_id'); + $default_style = (int) $this->db->sql_fetchfield('style_id'); $this->db->sql_freeresult($result); $this->config->set('default_style', $default_style); @@ -184,7 +184,7 @@ class style_update_p1 extends \phpbb\db\migration\migration // Reset styles for users $this->sql_query('UPDATE ' . USERS_TABLE . " - SET user_style = '" . $valid_styles[0] . "' + SET user_style = '" . (int) $valid_styles[0] . "' WHERE " . $this->db->sql_in_set('user_style', $valid_styles, true)); } } -- cgit v1.2.1 From bace8dd31f0a5c2f95ae612e7e1b2e6d3083613b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Calvo?= Date: Fri, 8 Sep 2017 15:02:29 +0200 Subject: [ticket/15201] Add casting PHPBB3-15201 --- phpBB/phpbb/db/migration/data/v310/style_update_p1.php | 2 +- phpBB/phpbb/db/migration/data/v32x/fix_user_styles.php | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v310/style_update_p1.php b/phpBB/phpbb/db/migration/data/v310/style_update_p1.php index 3e28e8747d..f50ab33830 100644 --- a/phpBB/phpbb/db/migration/data/v310/style_update_p1.php +++ b/phpBB/phpbb/db/migration/data/v310/style_update_p1.php @@ -165,7 +165,7 @@ class style_update_p1 extends \phpbb\db\migration\migration $this->config->set('default_style', $default_style); - $sql = 'UPDATE ' . USERS_TABLE . ' SET user_style = ' . $default_style; + $sql = 'UPDATE ' . USERS_TABLE . ' SET user_style = ' . (int) $default_style; $this->sql_query($sql); } else diff --git a/phpBB/phpbb/db/migration/data/v32x/fix_user_styles.php b/phpBB/phpbb/db/migration/data/v32x/fix_user_styles.php index e0caae812a..282c6bef2f 100644 --- a/phpBB/phpbb/db/migration/data/v32x/fix_user_styles.php +++ b/phpBB/phpbb/db/migration/data/v32x/fix_user_styles.php @@ -43,8 +43,8 @@ class fix_user_styles extends \phpbb\db\migration\migration $this->db->sql_freeresult($result); // Set the default style to users who have an invalid style - $this->sql_query('UPDATE ' . USERS_TABLE . " - SET user_style = $default_style - WHERE " . $this->db->sql_in_set('user_style', $enabled_styles, true)); + $this->sql_query('UPDATE ' . USERS_TABLE . ' + SET user_style = ' . (int) $default_style . ' + WHERE ' . $this->db->sql_in_set('user_style', $enabled_styles, true)); } } -- cgit v1.2.1 From 2592d597652242cc5e1299e3dcde53d31f35c4f1 Mon Sep 17 00:00:00 2001 From: Oliver Schramm Date: Fri, 22 Sep 2017 14:34:38 +0200 Subject: [ticket/15339] Use manual method when adding modules This will fix cases where the module is deleted in later versions and the migrator thus cannot retrieve the info. PHPBB3-15339 --- .../db/migration/data/v30x/release_3_0_6_rc1.php | 41 +++++++++++++++++++--- .../db/migration/data/v30x/release_3_0_8_rc1.php | 4 ++- .../db/migration/data/v310/auth_provider_oauth.php | 4 ++- .../data/v310/contact_admin_acp_module.php | 4 ++- phpBB/phpbb/db/migration/data/v310/dev.php | 25 ++++++++++--- phpBB/phpbb/db/migration/data/v310/extensions.php | 4 ++- .../phpbb/db/migration/data/v310/notifications.php | 7 ++-- .../migration/data/v310/softdelete_mcp_modules.php | 8 +++-- .../db/migration/data/v320/add_help_phpbb.php | 4 ++- 9 files changed, 83 insertions(+), 18 deletions(-) (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_6_rc1.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_6_rc1.php index faef68121d..08b8979e00 100644 --- a/phpBB/phpbb/db/migration/data/v30x/release_3_0_6_rc1.php +++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_6_rc1.php @@ -153,7 +153,9 @@ class release_3_0_6_rc1 extends \phpbb\db\migration\migration 'ACP_BOARD_CONFIGURATION', array( 'module_basename' => 'acp_board', - 'modes' => array('feed'), + 'module_langname' => 'ACP_FEED_SETTINGS', + 'module_mode' => 'feed', + 'module_auth' => 'acl_a_board', ), )), array('module.add', array( @@ -161,7 +163,10 @@ class release_3_0_6_rc1 extends \phpbb\db\migration\migration 'ACP_CAT_USERS', array( 'module_basename' => 'acp_users', - 'modes' => array('warnings'), + 'module_langname' => 'ACP_USER_WARNINGS', + 'module_mode' => 'warnings', + 'module_auth' => 'acl_a_user', + 'module_display' => false, ), )), array('module.add', array( @@ -169,7 +174,9 @@ class release_3_0_6_rc1 extends \phpbb\db\migration\migration 'ACP_SERVER_CONFIGURATION', array( 'module_basename' => 'acp_send_statistics', - 'modes' => array('send_statistics'), + 'module_langname' => 'ACP_SEND_STATISTICS', + 'module_mode' => 'send_statistics', + 'module_auth' => 'acl_a_server', ), )), array('module.add', array( @@ -177,7 +184,9 @@ class release_3_0_6_rc1 extends \phpbb\db\migration\migration 'ACP_FORUM_BASED_PERMISSIONS', array( 'module_basename' => 'acp_permissions', - 'modes' => array('setting_forum_copy'), + 'module_langname' => 'ACP_FORUM_PERMISSIONS_COPY', + 'module_mode' => 'setting_forum_copy', + 'module_auth' => 'acl_a_fauth && acl_a_authusers && acl_a_authgroups && acl_a_mauth', ), )), array('module.add', array( @@ -185,7 +194,29 @@ class release_3_0_6_rc1 extends \phpbb\db\migration\migration 'MCP_REPORTS', array( 'module_basename' => 'mcp_pm_reports', - 'modes' => array('pm_reports','pm_reports_closed','pm_report_details'), + 'module_langname' => 'MCP_PM_REPORTS_OPEN', + 'module_mode' => 'pm_reports', + 'module_auth' => 'acl_m_pm_report', + ), + )), + array('module.add', array( + 'mcp', + 'MCP_REPORTS', + array( + 'module_basename' => 'mcp_pm_reports', + 'module_langname' => 'MCP_PM_REPORTS_CLOSED', + 'module_mode' => 'pm_reports_closed', + 'module_auth' => 'acl_m_pm_report', + ), + )), + array('module.add', array( + 'mcp', + 'MCP_REPORTS', + array( + 'module_basename' => 'mcp_pm_reports', + 'module_langname' => 'MCP_PM_REPORT_DETAILS', + 'module_mode' => 'pm_report_details', + 'module_auth' => 'acl_m_pm_report', ), )), array('custom', array(array(&$this, 'add_newly_registered_group'))), diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_8_rc1.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_8_rc1.php index 22fd51543b..0190eeb1af 100644 --- a/phpBB/phpbb/db/migration/data/v30x/release_3_0_8_rc1.php +++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_8_rc1.php @@ -36,7 +36,9 @@ class release_3_0_8_rc1 extends \phpbb\db\migration\migration 'ACP_MESSAGES', array( 'module_basename' => 'acp_board', - 'modes' => array('post'), + 'module_langname' => 'ACP_POST_SETTINGS', + 'module_mode' => 'post', + 'module_auth' => 'acl_a_board', ), )), array('config.add', array('load_unreads_search', 1)), diff --git a/phpBB/phpbb/db/migration/data/v310/auth_provider_oauth.php b/phpBB/phpbb/db/migration/data/v310/auth_provider_oauth.php index 2d51bd53e4..508a31fba9 100644 --- a/phpBB/phpbb/db/migration/data/v310/auth_provider_oauth.php +++ b/phpBB/phpbb/db/migration/data/v310/auth_provider_oauth.php @@ -69,7 +69,9 @@ class auth_provider_oauth extends \phpbb\db\migration\migration 'UCP_PROFILE', array( 'module_basename' => 'ucp_auth_link', - 'modes' => array('auth_link'), + 'module_langname' => 'UCP_AUTH_LINK_MANAGE', + 'module_mode' => 'auth_link', + 'module_auth' => 'authmethod_oauth', ), )), ); diff --git a/phpBB/phpbb/db/migration/data/v310/contact_admin_acp_module.php b/phpBB/phpbb/db/migration/data/v310/contact_admin_acp_module.php index 20bd547ac3..e48a9a1d3d 100644 --- a/phpBB/phpbb/db/migration/data/v310/contact_admin_acp_module.php +++ b/phpBB/phpbb/db/migration/data/v310/contact_admin_acp_module.php @@ -23,7 +23,9 @@ class contact_admin_acp_module extends \phpbb\db\migration\migration 'ACP_BOARD_CONFIGURATION', array( 'module_basename' => 'acp_contact', - 'modes' => array('contact'), + 'module_langname' => 'ACP_CONTACT_SETTINGS', + 'module_mode' => 'contact', + 'module_auth' => 'acl_a_board', ), )), ); diff --git a/phpBB/phpbb/db/migration/data/v310/dev.php b/phpBB/phpbb/db/migration/data/v310/dev.php index 250258eea7..9cc953ad8d 100644 --- a/phpBB/phpbb/db/migration/data/v310/dev.php +++ b/phpBB/phpbb/db/migration/data/v310/dev.php @@ -125,7 +125,9 @@ class dev extends \phpbb\db\migration\container_aware_migration 'ACP_GROUPS', array( 'module_basename' => 'acp_groups', - 'modes' => array('position'), + 'module_langname' => 'ACP_GROUPS_POSITION', + 'module_mode' => 'position', + 'module_auth' => 'acl_a_group', ), )), array('module.add', array( @@ -133,7 +135,9 @@ class dev extends \phpbb\db\migration\container_aware_migration 'ACP_ATTACHMENTS', array( 'module_basename' => 'acp_attachments', - 'modes' => array('manage'), + 'module_langname' => 'ACP_MANAGE_ATTACHMENTS', + 'module_mode' => 'manage', + 'module_auth' => 'acl_a_attach', ), )), array('module.add', array( @@ -141,7 +145,19 @@ class dev extends \phpbb\db\migration\container_aware_migration 'ACP_STYLE_MANAGEMENT', array( 'module_basename' => 'acp_styles', - 'modes' => array('install', 'cache'), + 'module_langname' => 'ACP_STYLES_INSTALL', + 'module_mode' => 'install', + 'module_auth' => 'acl_a_styles', + ), + )), + array('module.add', array( + 'acp', + 'ACP_STYLE_MANAGEMENT', + array( + 'module_basename' => 'acp_styles', + 'module_langname' => 'ACP_STYLES_CACHE', + 'module_mode' => 'cache', + 'module_auth' => 'acl_a_styles', ), )), array('module.add', array( @@ -149,7 +165,8 @@ class dev extends \phpbb\db\migration\container_aware_migration 'UCP_PROFILE', array( 'module_basename' => 'ucp_profile', - 'modes' => array('autologin_keys'), + 'module_langname' => 'UCP_PROFILE_AUTOLOGIN_KEYS', + 'module_mode' => 'autologin_keys', ), )), // Module will be renamed later diff --git a/phpBB/phpbb/db/migration/data/v310/extensions.php b/phpBB/phpbb/db/migration/data/v310/extensions.php index 3171435482..2e7c5c5316 100644 --- a/phpBB/phpbb/db/migration/data/v310/extensions.php +++ b/phpBB/phpbb/db/migration/data/v310/extensions.php @@ -66,7 +66,9 @@ class extensions extends \phpbb\db\migration\migration 'ACP_EXTENSION_MANAGEMENT', array( 'module_basename' => 'acp_extensions', - 'modes' => array('main'), + 'module_langname' => 'ACP_EXTENSIONS', + 'module_mode' => 'main', + 'module_auth' => 'acl_a_extensions', ), )), array('permission.add', array('a_extensions', true, 'a_styles')), diff --git a/phpBB/phpbb/db/migration/data/v310/notifications.php b/phpBB/phpbb/db/migration/data/v310/notifications.php index f4d012b5ac..789aaa3ba9 100644 --- a/phpBB/phpbb/db/migration/data/v310/notifications.php +++ b/phpBB/phpbb/db/migration/data/v310/notifications.php @@ -85,7 +85,9 @@ class notifications extends \phpbb\db\migration\migration 'UCP_MAIN', array( 'module_basename' => 'ucp_notifications', - 'modes' => array('notification_list'), + 'module_langname' => 'UCP_NOTIFICATION_LIST', + 'module_mode' => 'notification_list', + 'module_auth' => 'cfg_allow_board_notifications', ), )), array('module.add', array( @@ -93,7 +95,8 @@ class notifications extends \phpbb\db\migration\migration 'UCP_PREFS', array( 'module_basename' => 'ucp_notifications', - 'modes' => array('notification_options'), + 'module_langname' => 'UCP_NOTIFICATION_OPTIONS', + 'module_mode' => 'notification_options', ), )), array('config.add', array('load_notifications', 1)), diff --git a/phpBB/phpbb/db/migration/data/v310/softdelete_mcp_modules.php b/phpBB/phpbb/db/migration/data/v310/softdelete_mcp_modules.php index 5e68db5889..90dab991e1 100644 --- a/phpBB/phpbb/db/migration/data/v310/softdelete_mcp_modules.php +++ b/phpBB/phpbb/db/migration/data/v310/softdelete_mcp_modules.php @@ -45,7 +45,9 @@ class softdelete_mcp_modules extends \phpbb\db\migration\migration 'MCP_QUEUE', array( 'module_basename' => 'mcp_queue', - 'modes' => array('deleted_topics'), + 'module_langname' => 'MCP_QUEUE_DELETED_TOPICS', + 'module_mode' => 'deleted_topics', + 'module_auth' => 'aclf_m_approve', ), )), array('module.add', array( @@ -53,7 +55,9 @@ class softdelete_mcp_modules extends \phpbb\db\migration\migration 'MCP_QUEUE', array( 'module_basename' => 'mcp_queue', - 'modes' => array('deleted_posts'), + 'module_langname' => 'MCP_QUEUE_DELETED_POSTS', + 'module_mode' => 'deleted_posts', + 'module_auth' => 'aclf_m_approve', ), )), ); diff --git a/phpBB/phpbb/db/migration/data/v320/add_help_phpbb.php b/phpBB/phpbb/db/migration/data/v320/add_help_phpbb.php index 8fadb4bde4..a52067f484 100644 --- a/phpBB/phpbb/db/migration/data/v320/add_help_phpbb.php +++ b/phpBB/phpbb/db/migration/data/v320/add_help_phpbb.php @@ -41,7 +41,9 @@ class add_help_phpbb extends \phpbb\db\migration\migration 'ACP_SERVER_CONFIGURATION', array( 'module_basename' => 'acp_help_phpbb', - 'modes' => array('help_phpbb'), + 'module_langname' => 'ACP_HELP_PHPBB', + 'module_mode' => 'help_phpbb', + 'module_auth' => 'acl_a_server', ), )), ); -- cgit v1.2.1 From e41819e37a8b25121e20ecde6435deeb58155688 Mon Sep 17 00:00:00 2001 From: Oliver Schramm Date: Mon, 25 Sep 2017 17:48:37 +0200 Subject: [ticket/15379] Only initialize reparsers on first call in migration PHPBB3-15379 --- phpBB/phpbb/db/migration/data/v320/text_reparser.php | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v320/text_reparser.php b/phpBB/phpbb/db/migration/data/v320/text_reparser.php index 03c5d39fe4..6b8cf93cc9 100644 --- a/phpBB/phpbb/db/migration/data/v320/text_reparser.php +++ b/phpBB/phpbb/db/migration/data/v320/text_reparser.php @@ -54,13 +54,16 @@ class text_reparser extends \phpbb\db\migration\container_aware_migration /** @var manager $reparser_manager */ $reparser_manager = $this->container->get('text_reparser.manager'); - /** @var reparser_interface[] $reparsers */ - $reparsers = $this->container->get('text_reparser_collection'); - - // Initialize all reparsers - foreach ($reparsers as $name => $reparser) + if (!is_array($resume_data)) { - $reparser_manager->update_resume_data($name, 1, $reparser->get_max_id(), 100); + /** @var reparser_interface[] $reparsers */ + $reparsers = $this->container->get('text_reparser_collection'); + + // Initialize all reparsers + foreach ($reparsers as $name => $reparser) + { + $reparser_manager->update_resume_data($name, 1, $reparser->get_max_id(), 100); + } } // Sometimes a cron job is too much -- cgit v1.2.1 From e55480385b5c7d49030d3f380bf2c1349695033b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Col=C3=B3n?= Date: Sun, 24 Sep 2017 21:32:53 -0400 Subject: [ticket/15372] Migration for adding f_list_topic permission --- .../data/v32x/f_list_topics_permission_add.php | 38 ++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v32x/f_list_topics_permission_add.php (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v32x/f_list_topics_permission_add.php b/phpBB/phpbb/db/migration/data/v32x/f_list_topics_permission_add.php new file mode 100644 index 0000000000..175c27da03 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v32x/f_list_topics_permission_add.php @@ -0,0 +1,38 @@ + + * @license GNU General Public License, version 2 (GPL-2.0) + * + * For full copyright and license information, please see + * the docs/CREDITS.txt file. + * + */ + +namespace phpbb\db\migration\data\v32x; + +class f_list_topics_permission_add extends \phpbb\db\migration\migration +{ + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v32x\v321', + ); + } + + public function update_data() + { + return array( + array('permission.add', array('f_list_topics', false)), + ); + } + + public function revert_data() + { + return array( + array('permission.remove', array('f_list_topics', false)), + ); + } +} -- cgit v1.2.1 From 4ae7cb89ff55902ab50393e1f7aa81b4b055f511 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Col=C3=B3n?= Date: Sun, 24 Sep 2017 22:48:51 -0400 Subject: [ticket/15372] Remove revert_data from migration --- .../phpbb/db/migration/data/v32x/f_list_topics_permission_add.php | 7 ------- 1 file changed, 7 deletions(-) (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v32x/f_list_topics_permission_add.php b/phpBB/phpbb/db/migration/data/v32x/f_list_topics_permission_add.php index 175c27da03..e4b77d0f0f 100644 --- a/phpBB/phpbb/db/migration/data/v32x/f_list_topics_permission_add.php +++ b/phpBB/phpbb/db/migration/data/v32x/f_list_topics_permission_add.php @@ -28,11 +28,4 @@ class f_list_topics_permission_add extends \phpbb\db\migration\migration array('permission.add', array('f_list_topics', false)), ); } - - public function revert_data() - { - return array( - array('permission.remove', array('f_list_topics', false)), - ); - } } -- cgit v1.2.1 From 33ceceda021160b73fe9d7333e9e950308da5569 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Col=C3=B3n?= Date: Thu, 26 Oct 2017 16:21:50 -0400 Subject: [ticket/15372] Add permission to schema and copy from f_read --- phpBB/phpbb/db/migration/data/v32x/f_list_topics_permission_add.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v32x/f_list_topics_permission_add.php b/phpBB/phpbb/db/migration/data/v32x/f_list_topics_permission_add.php index e4b77d0f0f..49727e5a62 100644 --- a/phpBB/phpbb/db/migration/data/v32x/f_list_topics_permission_add.php +++ b/phpBB/phpbb/db/migration/data/v32x/f_list_topics_permission_add.php @@ -25,7 +25,7 @@ class f_list_topics_permission_add extends \phpbb\db\migration\migration public function update_data() { return array( - array('permission.add', array('f_list_topics', false)), + array('permission.add', array('f_list_topics', false, 'f_read')), ); } } -- cgit v1.2.1 From 4bf0f4a50f34e00fb80299119f98c23ee426dc4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Calvo?= Date: Tue, 31 Oct 2017 14:37:36 +0100 Subject: [ticket/15171] Add migration PHPBB3-15171 --- .../data/v32x/update_prosilver_bitfield.php | 39 ++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v32x/update_prosilver_bitfield.php (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v32x/update_prosilver_bitfield.php b/phpBB/phpbb/db/migration/data/v32x/update_prosilver_bitfield.php new file mode 100644 index 0000000000..6e51a01834 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v32x/update_prosilver_bitfield.php @@ -0,0 +1,39 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v32x; + +class update_prosilver_bitfield extends \phpbb\db\migration\migration +{ + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v32x\v321', + ); + } + + public function update_data() + { + return array( + array('custom', array(array($this, 'update_bbcode_bitfield'))), + ); + } + + public function update_bbcode_bitfield() + { + $sql = 'UPDATE ' . STYLES_TABLE . " + SET bbcode_bitfield = '//g=' + WHERE style_path = 'prosilver'"; + $this->sql_query($sql); + } +} -- cgit v1.2.1 From aa961991fdafc8a0371d22c7e42f2424ee1b8898 Mon Sep 17 00:00:00 2001 From: Oliver Schramm Date: Fri, 17 Nov 2017 01:29:38 +0100 Subject: [ticket/15339] Allow a module to have multiple parents Also restore old behaviour from Olympus regarding re-sorting modules PHPBB3-15339 --- .../db/migration/data/v30x/release_3_0_6_rc1.php | 3 + .../db/migration/data/v30x/release_3_0_8_rc1.php | 1 + phpBB/phpbb/db/migration/tool/module.php | 255 +++++++++++---------- 3 files changed, 136 insertions(+), 123 deletions(-) (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_6_rc1.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_6_rc1.php index 08b8979e00..40bb58c10d 100644 --- a/phpBB/phpbb/db/migration/data/v30x/release_3_0_6_rc1.php +++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_6_rc1.php @@ -156,6 +156,7 @@ class release_3_0_6_rc1 extends \phpbb\db\migration\migration 'module_langname' => 'ACP_FEED_SETTINGS', 'module_mode' => 'feed', 'module_auth' => 'acl_a_board', + 'after' => array('signature', 'ACP_SIGNATURE_SETTINGS'), ), )), array('module.add', array( @@ -167,6 +168,7 @@ class release_3_0_6_rc1 extends \phpbb\db\migration\migration 'module_mode' => 'warnings', 'module_auth' => 'acl_a_user', 'module_display' => false, + 'after' => array('feedback', 'ACP_USER_FEEDBACK'), ), )), array('module.add', array( @@ -187,6 +189,7 @@ class release_3_0_6_rc1 extends \phpbb\db\migration\migration 'module_langname' => 'ACP_FORUM_PERMISSIONS_COPY', 'module_mode' => 'setting_forum_copy', 'module_auth' => 'acl_a_fauth && acl_a_authusers && acl_a_authgroups && acl_a_mauth', + 'after' => array('setting_forum_local', 'ACP_FORUM_PERMISSIONS'), ), )), array('module.add', array( diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_8_rc1.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_8_rc1.php index 0190eeb1af..c018adab46 100644 --- a/phpBB/phpbb/db/migration/data/v30x/release_3_0_8_rc1.php +++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_8_rc1.php @@ -39,6 +39,7 @@ class release_3_0_8_rc1 extends \phpbb\db\migration\migration 'module_langname' => 'ACP_POST_SETTINGS', 'module_mode' => 'post', 'module_auth' => 'acl_a_board', + 'after' => array('message', 'ACP_MESSAGE_SETTINGS'), ), )), array('config.add', array('load_unreads_search', 1)), diff --git a/phpBB/phpbb/db/migration/tool/module.php b/phpBB/phpbb/db/migration/tool/module.php index b47c426110..3b4728c9d7 100644 --- a/phpBB/phpbb/db/migration/tool/module.php +++ b/phpBB/phpbb/db/migration/tool/module.php @@ -84,9 +84,11 @@ class module implements \phpbb\db\migration\tool\tool_interface * Use false to ignore the parent check and check class wide. * @param int|string $module The module_id|module_langname you would like to * check for to see if it exists - * @return bool true/false if module exists + * @param bool $lazy Checks lazily if the module exists. Returns true if it exists in at + * least one given parent. + * @return bool true if module exists in *all* given parents, false if not */ - public function exists($class, $parent, $module) + public function exists($class, $parent, $module, $lazy = false) { // the main root directory should return true if (!$module) @@ -94,33 +96,44 @@ class module implements \phpbb\db\migration\tool\tool_interface return true; } - $parent_sql = ''; + $parent_sqls = []; if ($parent !== false) { - $parent = $this->get_parent_module_id($parent, $module, false); - if ($parent === false) + $parents = $this->get_parent_module_id($parent, $module, false); + if ($parents === false) { return false; } - $parent_sql = 'AND parent_id = ' . (int) $parent; + foreach ((array) $parents as $parent_id) + { + $parent_sqls[] = 'AND parent_id = ' . (int) $parent_id; + } } - $sql = 'SELECT module_id - FROM ' . $this->modules_table . " - WHERE module_class = '" . $this->db->sql_escape($class) . "' - $parent_sql - AND " . ((is_numeric($module)) ? 'module_id = ' . (int) $module : "module_langname = '" . $this->db->sql_escape($module) . "'"); - $result = $this->db->sql_query($sql); - $module_id = $this->db->sql_fetchfield('module_id'); - $this->db->sql_freeresult($result); - - if ($module_id) + foreach ($parent_sqls as $parent_sql) { - return true; + $sql = 'SELECT module_id + FROM ' . $this->modules_table . " + WHERE module_class = '" . $this->db->sql_escape($class) . "' + $parent_sql + AND " . ((is_numeric($module)) ? 'module_id = ' . (int) $module : "module_langname = '" . $this->db->sql_escape($module) . "'"); + $result = $this->db->sql_query($sql); + $module_id = $this->db->sql_fetchfield('module_id'); + $this->db->sql_freeresult($result); + + if (!$lazy && !$module_id) + { + return false; + } + else if ($lazy && $module_id) + { + return true; + } } - return false; + // Returns true, if modules exist in all parents and false otherwise + return !$lazy; } /** @@ -172,7 +185,7 @@ class module implements \phpbb\db\migration\tool\tool_interface $data = array('module_langname' => $data); } - $parent = $data['parent_id'] = $this->get_parent_module_id($parent, $data); + $parents = (array) $this->get_parent_module_id($parent, $data); if (!isset($data['module_langname'])) { @@ -195,95 +208,129 @@ class module implements \phpbb\db\migration\tool\tool_interface ); // Run the "manual" way with the data we've collected. - $this->add($class, $parent, $new_module); + foreach ($parents as $parent) + { + $this->add($class, $parent, $new_module); + } } } return; } - // The "manual" way - if (!$this->exists($class, false, $parent)) + foreach ($parents as $parent) { - throw new \phpbb\db\migration\exception('MODULE_NOT_EXIST', $parent); - } + $data['parent_id'] = $parent; - if ($this->exists($class, $parent, $data['module_langname'])) - { - throw new \phpbb\db\migration\exception('MODULE_EXISTS', $data['module_langname']); - } - - $module_data = array( - 'module_enabled' => (isset($data['module_enabled'])) ? $data['module_enabled'] : 1, - 'module_display' => (isset($data['module_display'])) ? $data['module_display'] : 1, - 'module_basename' => (isset($data['module_basename'])) ? $data['module_basename'] : '', - 'module_class' => $class, - 'parent_id' => (int) $parent, - 'module_langname' => (isset($data['module_langname'])) ? $data['module_langname'] : '', - 'module_mode' => (isset($data['module_mode'])) ? $data['module_mode'] : '', - 'module_auth' => (isset($data['module_auth'])) ? $data['module_auth'] : '', - ); - - try - { - $this->module_manager->update_module_data($module_data); + // The "manual" way + if (!$this->exists($class, false, $parent)) + { + throw new \phpbb\db\migration\exception('MODULE_NOT_EXIST', $parent); + } - // Success - $module_log_name = ((isset($this->user->lang[$data['module_langname']])) ? $this->user->lang[$data['module_langname']] : $data['module_langname']); - $phpbb_log->add('admin', (isset($user->data['user_id'])) ? $user->data['user_id'] : ANONYMOUS, $user->ip, 'LOG_MODULE_ADD', false, array($module_log_name)); + if ($this->exists($class, $parent, $data['module_langname'])) + { + throw new \phpbb\db\migration\exception('MODULE_EXISTS', $data['module_langname']); + } - // Move the module if requested above/below an existing one - if (isset($data['before']) && $data['before']) + $module_data = array( + 'module_enabled' => (isset($data['module_enabled'])) ? $data['module_enabled'] : 1, + 'module_display' => (isset($data['module_display'])) ? $data['module_display'] : 1, + 'module_basename' => (isset($data['module_basename'])) ? $data['module_basename'] : '', + 'module_class' => $class, + 'parent_id' => (int) $parent, + 'module_langname' => (isset($data['module_langname'])) ? $data['module_langname'] : '', + 'module_mode' => (isset($data['module_mode'])) ? $data['module_mode'] : '', + 'module_auth' => (isset($data['module_auth'])) ? $data['module_auth'] : '', + ); + + try { - $sql = 'SELECT left_id + $this->module_manager->update_module_data($module_data); + + // Success + $module_log_name = ((isset($this->user->lang[$data['module_langname']])) ? $this->user->lang[$data['module_langname']] : $data['module_langname']); + $phpbb_log->add('admin', (isset($user->data['user_id'])) ? $user->data['user_id'] : ANONYMOUS, $user->ip, 'LOG_MODULE_ADD', false, array($module_log_name)); + + // Move the module if requested above/below an existing one + if (isset($data['before']) && $data['before']) + { + $before_mode = $before_langname = ''; + if (is_array($data['before'])) + { + // Restore legacy-legacy behaviour from phpBB 3.0 + list($before_mode, $before_langname) = $data['before']; + } + else + { + // Legacy behaviour from phpBB 3.1+ + $before_langname = $data['before']; + } + + $sql = 'SELECT left_id FROM ' . $this->modules_table . " WHERE module_class = '" . $this->db->sql_escape($class) . "' AND parent_id = " . (int) $parent . " - AND module_langname = '" . $this->db->sql_escape($data['before']) . "'"; - $this->db->sql_query($sql); - $to_left = (int) $this->db->sql_fetchfield('left_id'); + AND module_langname = '" . $this->db->sql_escape($before_langname) . "'" + . (($before_mode) ? " AND module_mode = '" . $this->db->sql_escape($before_mode) . "'" : ''); + $this->db->sql_query($sql); + $to_left = (int) $this->db->sql_fetchfield('left_id'); - $sql = 'UPDATE ' . $this->modules_table . " + $sql = 'UPDATE ' . $this->modules_table . " SET left_id = left_id + 2, right_id = right_id + 2 WHERE module_class = '" . $this->db->sql_escape($class) . "' AND left_id >= $to_left AND left_id < {$module_data['left_id']}"; - $this->db->sql_query($sql); + $this->db->sql_query($sql); - $sql = 'UPDATE ' . $this->modules_table . " + $sql = 'UPDATE ' . $this->modules_table . " SET left_id = $to_left, right_id = " . ($to_left + 1) . " WHERE module_class = '" . $this->db->sql_escape($class) . "' AND module_id = {$module_data['module_id']}"; - $this->db->sql_query($sql); - } - else if (isset($data['after']) && $data['after']) - { - $sql = 'SELECT right_id + $this->db->sql_query($sql); + } + else if (isset($data['after']) && $data['after']) + { + $after_mode = $after_langname = ''; + if (is_array($data['after'])) + { + // Restore legacy-legacy behaviour from phpBB 3.0 + list($after_mode, $after_langname) = $data['after']; + } + else + { + // Legacy behaviour from phpBB 3.1+ + $after_langname = $data['after']; + } + + $sql = 'SELECT right_id FROM ' . $this->modules_table . " WHERE module_class = '" . $this->db->sql_escape($class) . "' AND parent_id = " . (int) $parent . " - AND module_langname = '" . $this->db->sql_escape($data['after']) . "'"; - $this->db->sql_query($sql); - $to_right = (int) $this->db->sql_fetchfield('right_id'); + AND module_langname = '" . $this->db->sql_escape($after_langname) . "'" + . (($after_mode) ? " AND module_mode = '" . $this->db->sql_escape($after_mode) . "'" : ''); + $this->db->sql_query($sql); + $to_right = (int) $this->db->sql_fetchfield('right_id'); - $sql = 'UPDATE ' . $this->modules_table . " + $sql = 'UPDATE ' . $this->modules_table . " SET left_id = left_id + 2, right_id = right_id + 2 WHERE module_class = '" . $this->db->sql_escape($class) . "' AND left_id >= $to_right AND left_id < {$module_data['left_id']}"; - $this->db->sql_query($sql); + $this->db->sql_query($sql); - $sql = 'UPDATE ' . $this->modules_table . ' + $sql = 'UPDATE ' . $this->modules_table . ' SET left_id = ' . ($to_right + 1) . ', right_id = ' . ($to_right + 2) . " WHERE module_class = '" . $this->db->sql_escape($class) . "' AND module_id = {$module_data['module_id']}"; - $this->db->sql_query($sql); + $this->db->sql_query($sql); + } + } + catch (module_exception $e) + { + // Error + throw new \phpbb\db\migration\exception('MODULE_ERROR', $e->getMessage()); } - } - catch (module_exception $e) - { - // Error - throw new \phpbb\db\migration\exception('MODULE_ERROR', $e->getMessage()); } // Clear the Modules Cache @@ -334,7 +381,7 @@ class module implements \phpbb\db\migration\tool\tool_interface } else { - if (!$this->exists($class, $parent, $module)) + if (!$this->exists($class, $parent, $module, true)) { return; } @@ -342,8 +389,8 @@ class module implements \phpbb\db\migration\tool\tool_interface $parent_sql = ''; if ($parent !== false) { - $parent = $this->get_parent_module_id($parent, $module); - $parent_sql = 'AND parent_id = ' . (int) $parent; + $parents = (array)$this->get_parent_module_id($parent, $module); + $parent_sql = 'AND ' . $this->db->sql_in_set('parent_id', $parents); } $module_ids = array(); @@ -457,14 +504,11 @@ class module implements \phpbb\db\migration\tool\tool_interface * @param string|int $parent_id The parent module_id|module_langname * @param int|string|array $data The module_id, module_langname for existance checking or module data array for adding * @param bool $throw_exception The flag indicating if exception should be thrown on error - * @return mixed The int parent module_id or false + * @return mixed The int parent module_id, an array of int parent module_id values or false * @throws \phpbb\db\migration\exception */ public function get_parent_module_id($parent_id, $data = '', $throw_exception = true) { - // Initialize exception object placeholder - $exception = false; - // Allow '' to be sent as 0 $parent_id = $parent_id ?: 0; @@ -486,61 +530,26 @@ class module implements \phpbb\db\migration\tool\tool_interface { // No parent with the given module_langname exist case 0: - $exception = new \phpbb\db\migration\exception('MODULE_NOT_EXIST', $parent_id); + if ($throw_exception) + { + throw new \phpbb\db\migration\exception('MODULE_NOT_EXIST', $parent_id); + } + + return false; break; // Return the module id case 1: - $parent_id = (int) $ids[0]; + return (int) $ids[0]; break; - // Several modules with the given module_langname were found - // Try to determine the parent_id by the neighbour module parent default: - if (is_array($data) && (isset($data['before']) || isset($data['after']))) - { - $neighbour_module_langname = isset($data['before']) ? $data['before'] : $data['after']; - $sql = 'SELECT parent_id - FROM ' . $this->modules_table . " - WHERE module_langname = '" . $this->db->sql_escape($neighbour_module_langname) . "' - AND " . $this->db->sql_in_set('parent_id', $ids); - $result = $this->db->sql_query($sql); - $parent_id = (int) $this->db->sql_fetchfield('parent_id'); - if (!$parent_id) - { - $exception = new \phpbb\db\migration\exception('PARENT_MODULE_FIND_ERROR', $data['parent_id']); - } - } - else if (!empty($data) && !is_array($data)) - { - // The module_langname is set, checking for the module existance - // As more than 1 parents were found already, there's no way for null parent_id here - $sql = 'SELECT m2.module_id as module_parent_id - FROM ' . $this->modules_table . ' m1, ' . $this->modules_table . " m2 - WHERE " . ((is_numeric($data)) ? 'm1.module_id = ' . (int) $data : "m1.module_langname = '" . $this->db->sql_escape($data)) . "' - AND m2.module_id = m1.parent_id - AND " . $this->db->sql_in_set('m2.module_id', $ids); - $result = $this->db->sql_query($sql); - $parent_id = (int) $this->db->sql_fetchfield('module_parent_id'); - } - else - { - //Unable to get the parent module id, throwing an exception - $exception = new \phpbb\db\migration\exception('MODULE_EXIST_MULTIPLE', $parent_id); - } + // This represents the old behaviour of phpBB 3.0 + return $ids; break; } } - if ($exception !== false) - { - if ($throw_exception) - { - throw $exception; - } - return false; - } - return $parent_id; } } -- cgit v1.2.1 From 719a49d38793f1490988ed0fa3fea84da17d3886 Mon Sep 17 00:00:00 2001 From: Oliver Schramm Date: Fri, 17 Nov 2017 01:31:31 +0100 Subject: [ticket/15339] Free sql results in migration module tool PHPBB3-15339 --- phpBB/phpbb/db/migration/tool/module.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/tool/module.php b/phpBB/phpbb/db/migration/tool/module.php index 3b4728c9d7..e1dfe40709 100644 --- a/phpBB/phpbb/db/migration/tool/module.php +++ b/phpBB/phpbb/db/migration/tool/module.php @@ -273,8 +273,9 @@ class module implements \phpbb\db\migration\tool\tool_interface AND parent_id = " . (int) $parent . " AND module_langname = '" . $this->db->sql_escape($before_langname) . "'" . (($before_mode) ? " AND module_mode = '" . $this->db->sql_escape($before_mode) . "'" : ''); - $this->db->sql_query($sql); + $result = $this->db->sql_query($sql); $to_left = (int) $this->db->sql_fetchfield('left_id'); + $this->db->sql_freeresult($result); $sql = 'UPDATE ' . $this->modules_table . " SET left_id = left_id + 2, right_id = right_id + 2 @@ -309,8 +310,9 @@ class module implements \phpbb\db\migration\tool\tool_interface AND parent_id = " . (int) $parent . " AND module_langname = '" . $this->db->sql_escape($after_langname) . "'" . (($after_mode) ? " AND module_mode = '" . $this->db->sql_escape($after_mode) . "'" : ''); - $this->db->sql_query($sql); + $result = $this->db->sql_query($sql); $to_right = (int) $this->db->sql_fetchfield('right_id'); + $this->db->sql_freeresult($result); $sql = 'UPDATE ' . $this->modules_table . " SET left_id = left_id + 2, right_id = right_id + 2 -- cgit v1.2.1 From 485a4a75b21578cc1d2bd46b0562d704ac4ebbdb Mon Sep 17 00:00:00 2001 From: JoshyPHP Date: Tue, 28 Nov 2017 02:09:50 +0100 Subject: [ticket/15444] Add a migration to merge duplicate BBCodes PHPBB3-15444 --- .../data/v32x/merge_duplicate_bbcodes.php | 75 ++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v32x/merge_duplicate_bbcodes.php (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v32x/merge_duplicate_bbcodes.php b/phpBB/phpbb/db/migration/data/v32x/merge_duplicate_bbcodes.php new file mode 100644 index 0000000000..3bf442bab5 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v32x/merge_duplicate_bbcodes.php @@ -0,0 +1,75 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v32x; + +class merge_duplicate_bbcodes extends \phpbb\db\migration\migration +{ + public function update_data() + { + return [ + ['custom', [[$this, 'update_bbcodes_table']]], + ]; + } + + public function update_bbcodes_table() + { + $sql = 'SELECT bbcode_id, bbcode_tag, bbcode_helpline, bbcode_match, bbcode_tpl FROM ' . BBCODES_TABLE; + $result = $this->sql_query($sql); + $bbcodes = []; + while ($row = $this->db->sql_fetchrow($result)) + { + $variant = (substr($row['bbcode_tag'], -1) === '=') ? 'with': 'without'; + $bbcode_name = rtrim($row['bbcode_tag'], '='); + $bbcodes[$bbcode_name][$variant] = $row; + } + $this->db->sql_freeresult($result); + + foreach ($bbcodes as $bbcode_name => $variants) + { + if (count($variants) === 2) + { + $this->merge_bbcodes($variants['without'], $variants['with']); + } + } + } + + protected function merge_bbcodes(array $without, array $with) + { + $merged = $this->container->get('text_formatter.s9e.bbcode_merger')->merge_bbcodes( + [ + 'usage' => $without['bbcode_match'], + 'template' => $without['bbcode_tpl'] + ], + [ + 'usage' => $with['bbcode_match'], + 'template' => $with['bbcode_tpl'] + ] + ); + $bbcode_data = [ + 'bbcode_tag' => $without['bbcode_tag'], + 'bbcode_helpline' => $without['bbcode_helpline'] . ' | ' . $with['bbcode_helpline'], + 'bbcode_match' => $merged['usage'], + 'bbcode_tpl' => $merged['template'] + ]; + + $sql = 'UPDATE ' . BBCODES_TABLE . ' + SET ' . $this->db->sql_build_array('UPDATE', $bbcode_data) . ' + WHERE bbcode_id = ' . $without['bbcode_id']; + $this->sql_query($sql); + + $sql = 'DELETE FROM ' . BBCODES_TABLE . ' + WHERE bbcode_id = ' . $with['bbcode_id']; + $this->sql_query($sql); + } +} -- cgit v1.2.1 From 9f055e1af39f36ff18cc278093000cb30c858885 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Mon, 11 Dec 2017 21:56:21 +0100 Subject: [ticket/15322] Add config setting for -f parameter & remove mail function name The -f parameter can now be added via configuration in the ACP. Addtionally, the config setting for the mail function name has been removed. PHPBB3-15322 --- .../migration/data/v32x/email_envelope_sender.php | 37 ++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v32x/email_envelope_sender.php (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v32x/email_envelope_sender.php b/phpBB/phpbb/db/migration/data/v32x/email_envelope_sender.php new file mode 100644 index 0000000000..2ba83f40df --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v32x/email_envelope_sender.php @@ -0,0 +1,37 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v32x; + +class email_envelope_sender extends \phpbb\db\migration\migration +{ + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v32x\v321', + ); + } + + public function effectively_installed() + { + return isset($this->config['email_envelope_sender']); + } + + public function update_data() + { + return array( + array('config.add', array('email_envelope_sender', '0')), + array('config.remove', array('email_function_name')), + ); + } +} -- cgit v1.2.1 From 4e045ed767603547d6aa9126d22a42bd690a1dd1 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Wed, 13 Dec 2017 21:31:07 +0100 Subject: [ticket/15322] Try to make new email setting more readable PHPBB3-15322 --- .../migration/data/v32x/email_envelope_sender.php | 37 ---------------------- .../db/migration/data/v32x/email_force_sender.php | 37 ++++++++++++++++++++++ 2 files changed, 37 insertions(+), 37 deletions(-) delete mode 100644 phpBB/phpbb/db/migration/data/v32x/email_envelope_sender.php create mode 100644 phpBB/phpbb/db/migration/data/v32x/email_force_sender.php (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v32x/email_envelope_sender.php b/phpBB/phpbb/db/migration/data/v32x/email_envelope_sender.php deleted file mode 100644 index 2ba83f40df..0000000000 --- a/phpBB/phpbb/db/migration/data/v32x/email_envelope_sender.php +++ /dev/null @@ -1,37 +0,0 @@ - -* @license GNU General Public License, version 2 (GPL-2.0) -* -* For full copyright and license information, please see -* the docs/CREDITS.txt file. -* -*/ - -namespace phpbb\db\migration\data\v32x; - -class email_envelope_sender extends \phpbb\db\migration\migration -{ - static public function depends_on() - { - return array( - '\phpbb\db\migration\data\v32x\v321', - ); - } - - public function effectively_installed() - { - return isset($this->config['email_envelope_sender']); - } - - public function update_data() - { - return array( - array('config.add', array('email_envelope_sender', '0')), - array('config.remove', array('email_function_name')), - ); - } -} diff --git a/phpBB/phpbb/db/migration/data/v32x/email_force_sender.php b/phpBB/phpbb/db/migration/data/v32x/email_force_sender.php new file mode 100644 index 0000000000..5319b7f76e --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v32x/email_force_sender.php @@ -0,0 +1,37 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v32x; + +class email_force_sender extends \phpbb\db\migration\migration +{ + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v32x\v321', + ); + } + + public function effectively_installed() + { + return isset($this->config['email_force_sender']); + } + + public function update_data() + { + return array( + array('config.add', array('email_force_sender', '0')), + array('config.remove', array('email_function_name')), + ); + } +} -- cgit v1.2.1 From 2b16b7cada85492b6312d126afa71a8a2e50a2a3 Mon Sep 17 00:00:00 2001 From: Oliver Schramm Date: Sun, 24 Dec 2017 19:55:03 +0100 Subject: [ticket/15339] Fix tests PHPBB3-15339 --- phpBB/phpbb/db/migration/tool/module.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/tool/module.php b/phpBB/phpbb/db/migration/tool/module.php index e1dfe40709..238e063a87 100644 --- a/phpBB/phpbb/db/migration/tool/module.php +++ b/phpBB/phpbb/db/migration/tool/module.php @@ -391,7 +391,7 @@ class module implements \phpbb\db\migration\tool\tool_interface $parent_sql = ''; if ($parent !== false) { - $parents = (array)$this->get_parent_module_id($parent, $module); + $parents = (array) $this->get_parent_module_id($parent, $module); $parent_sql = 'AND ' . $this->db->sql_in_set('parent_id', $parents); } -- cgit v1.2.1 From bd52c64e68f4fa5ae1a6292c61b272b6a04d2e7f Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Thu, 28 Dec 2017 15:02:37 +0100 Subject: [prep-release-3.2.2] Add migration for 3.2.2-RC1 --- phpBB/phpbb/db/migration/data/v32x/v321.php | 1 + phpBB/phpbb/db/migration/data/v32x/v322rc1.php | 40 ++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v32x/v322rc1.php (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v32x/v321.php b/phpBB/phpbb/db/migration/data/v32x/v321.php index 268f978b4b..fdbb5cff19 100644 --- a/phpBB/phpbb/db/migration/data/v32x/v321.php +++ b/phpBB/phpbb/db/migration/data/v32x/v321.php @@ -23,6 +23,7 @@ class v321 extends \phpbb\db\migration\migration static public function depends_on() { return array( + '\phpbb\db\migration\data\v31x\v3111', '\phpbb\db\migration\data\v32x\v321rc1', ); diff --git a/phpBB/phpbb/db/migration/data/v32x/v322rc1.php b/phpBB/phpbb/db/migration/data/v32x/v322rc1.php new file mode 100644 index 0000000000..51e9f5fcaa --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v32x/v322rc1.php @@ -0,0 +1,40 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v32x; + +class v322rc1 extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return phpbb_version_compare($this->config['version'], '3.2.2-RC1', '>='); + } + + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v32x\fix_user_styles', + '\phpbb\db\migration\data\v32x\update_prosilver_bitfield', + '\phpbb\db\migration\data\v32x\email_force_sender', + '\phpbb\db\migration\data\v32x\f_list_topics_permission_add', + '\phpbb\db\migration\data\v32x\merge_duplicate_bbcodes', + ); + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.2.2-RC1')), + ); + } +} -- cgit v1.2.1 From 5def7e255ec46175b74a31523f89309136e78869 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sun, 31 Dec 2017 16:39:02 +0100 Subject: [prep-release-3.1.12] Add migration for 3.1.12 --- phpBB/phpbb/db/migration/data/v31x/v3112.php | 36 ++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v31x/v3112.php (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v31x/v3112.php b/phpBB/phpbb/db/migration/data/v31x/v3112.php new file mode 100644 index 0000000000..0d75d35184 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v31x/v3112.php @@ -0,0 +1,36 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v31x; + +class v3112 extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return phpbb_version_compare($this->config['version'], '3.1.12', '>='); + } + + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v31x\v3111', + ); + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.1.12')), + ); + } +} -- cgit v1.2.1 From dec06d10fedb43bc948fe438b6f581ac7caa1916 Mon Sep 17 00:00:00 2001 From: rxu Date: Sun, 7 May 2017 02:10:37 +0700 Subject: [ticket/14972] Fix use of deprecated media attachment constants PHPBB3-14972 --- .../phpbb/db/migration/data/v320/remove_outdated_media.php | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v320/remove_outdated_media.php b/phpBB/phpbb/db/migration/data/v320/remove_outdated_media.php index c14d31f1c0..98b1c2d039 100644 --- a/phpBB/phpbb/db/migration/data/v320/remove_outdated_media.php +++ b/phpBB/phpbb/db/migration/data/v320/remove_outdated_media.php @@ -15,10 +15,17 @@ namespace phpbb\db\migration\data\v320; class remove_outdated_media extends \phpbb\db\migration\migration { + // Following constants were deprecated in 3.2 + // and moved from constants.php to compatibility_globals.php, + // thus define them as class constants + const ATTACHMENT_CATEGORY_WM = 2; + const ATTACHMENT_CATEGORY_RM = 3; + const ATTACHMENT_CATEGORY_QUICKTIME = 6; + protected $cat_id = array( - ATTACHMENT_CATEGORY_WM, - ATTACHMENT_CATEGORY_RM, - ATTACHMENT_CATEGORY_QUICKTIME, + self::ATTACHMENT_CATEGORY_WM, + self::ATTACHMENT_CATEGORY_RM, + self::ATTACHMENT_CATEGORY_QUICKTIME, ); static public function depends_on() -- cgit v1.2.1 From f8fbe3793680af1dae2db2829cfc84068831c52f Mon Sep 17 00:00:00 2001 From: rxu Date: Wed, 28 Jun 2017 00:58:03 +0700 Subject: [ticket/14972] replace all occurrences of sizeof() with the count() PHPBB3-14972 --- phpBB/phpbb/db/migration/data/v310/style_update_p1.php | 2 +- phpBB/phpbb/db/migration/data/v310/teampage.php | 4 ++-- phpBB/phpbb/db/migration/tool/config.php | 2 +- phpBB/phpbb/db/migration/tool/config_text.php | 2 +- phpBB/phpbb/db/migration/tool/module.php | 4 ++-- phpBB/phpbb/db/migration/tool/permission.php | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v310/style_update_p1.php b/phpBB/phpbb/db/migration/data/v310/style_update_p1.php index f50ab33830..a7e30a9cb7 100644 --- a/phpBB/phpbb/db/migration/data/v310/style_update_p1.php +++ b/phpBB/phpbb/db/migration/data/v310/style_update_p1.php @@ -133,7 +133,7 @@ class style_update_p1 extends \phpbb\db\migration\migration } // Remove old entries from styles table - if (!sizeof($valid_styles)) + if (!count($valid_styles)) { // No valid styles: remove everything and add prosilver $this->sql_query('DELETE FROM ' . STYLES_TABLE); diff --git a/phpBB/phpbb/db/migration/data/v310/teampage.php b/phpBB/phpbb/db/migration/data/v310/teampage.php index f8edbc3492..3a37b17e97 100644 --- a/phpBB/phpbb/db/migration/data/v310/teampage.php +++ b/phpBB/phpbb/db/migration/data/v310/teampage.php @@ -93,13 +93,13 @@ class teampage extends \phpbb\db\migration\migration $teampage_entries[] = array( 'group_id' => (int) $row['group_id'], 'teampage_name' => '', - 'teampage_position' => sizeof($teampage_entries) + 1, + 'teampage_position' => count($teampage_entries) + 1, 'teampage_parent' => 0, ); } $this->db->sql_freeresult($result); - if (sizeof($teampage_entries)) + if (count($teampage_entries)) { $this->db->sql_multi_insert(TEAMPAGE_TABLE, $teampage_entries); } diff --git a/phpBB/phpbb/db/migration/tool/config.php b/phpBB/phpbb/db/migration/tool/config.php index 33aa8ff026..a351c4858e 100644 --- a/phpBB/phpbb/db/migration/tool/config.php +++ b/phpBB/phpbb/db/migration/tool/config.php @@ -134,7 +134,7 @@ class config implements \phpbb\db\migration\tool\tool_interface case 'remove': $call = 'add'; - if (sizeof($arguments) == 1) + if (count($arguments) == 1) { $arguments[] = ''; } diff --git a/phpBB/phpbb/db/migration/tool/config_text.php b/phpBB/phpbb/db/migration/tool/config_text.php index 54b45f6f6d..5fe9a25b70 100644 --- a/phpBB/phpbb/db/migration/tool/config_text.php +++ b/phpBB/phpbb/db/migration/tool/config_text.php @@ -110,7 +110,7 @@ class config_text implements \phpbb\db\migration\tool\tool_interface case 'remove': $call = 'add'; - if (sizeof($arguments) == 1) + if (count($arguments) == 1) { $arguments[] = ''; } diff --git a/phpBB/phpbb/db/migration/tool/module.php b/phpBB/phpbb/db/migration/tool/module.php index 238e063a87..7d2720c861 100644 --- a/phpBB/phpbb/db/migration/tool/module.php +++ b/phpBB/phpbb/db/migration/tool/module.php @@ -515,7 +515,7 @@ class module implements \phpbb\db\migration\tool\tool_interface $parent_id = $parent_id ?: 0; // If automatic adding is in action, convert array back to string to simplify things - if (is_array($data) && sizeof($data) == 1) + if (is_array($data) && count($data) == 1) { $data = $data['module_langname']; } @@ -528,7 +528,7 @@ class module implements \phpbb\db\migration\tool\tool_interface // Search for the parent module_langname $ids = array_keys($this->module_categories, $parent_id); - switch (sizeof($ids)) + switch (count($ids)) { // No parent with the given module_langname exist case 0: diff --git a/phpBB/phpbb/db/migration/tool/permission.php b/phpBB/phpbb/db/migration/tool/permission.php index 9688420025..4b53aa32a7 100644 --- a/phpBB/phpbb/db/migration/tool/permission.php +++ b/phpBB/phpbb/db/migration/tool/permission.php @@ -442,7 +442,7 @@ class permission implements \phpbb\db\migration\tool\tool_interface } ); - if (sizeof($auth_option)) + if (count($auth_option)) { return $this->permission_set($role_name, $auth_option, 'role', $has_permission); } -- cgit v1.2.1 From f8180ca97bf6d9e92a0a080e2af8af2f0654bfbe Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sun, 7 Jan 2018 11:45:49 +0100 Subject: [prep-release-3.2.2] Add migration for 3.2.2 --- phpBB/phpbb/db/migration/data/v32x/v322.php | 37 +++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v32x/v322.php (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v32x/v322.php b/phpBB/phpbb/db/migration/data/v32x/v322.php new file mode 100644 index 0000000000..7ecbbb3e79 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v32x/v322.php @@ -0,0 +1,37 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v32x; + +class v322 extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return phpbb_version_compare($this->config['version'], '3.2.2', '>='); + } + + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v31x\v3112', + '\phpbb\db\migration\data\v32x\v322rc1', + ); + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.2.2')), + ); + } +} -- cgit v1.2.1 From 0391b48d7e95aca38be7c7ce7f1cbbba6c9fc5ab Mon Sep 17 00:00:00 2001 From: rxu Date: Mon, 8 Jan 2018 23:21:17 +0700 Subject: [ticket/15502] Fix migrations PHPBB3-15502 --- phpBB/phpbb/db/migration/data/v32x/fix_user_styles.php | 6 +++++- phpBB/phpbb/db/migration/data/v32x/merge_duplicate_bbcodes.php | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v32x/fix_user_styles.php b/phpBB/phpbb/db/migration/data/v32x/fix_user_styles.php index 282c6bef2f..16fbdbc77b 100644 --- a/phpBB/phpbb/db/migration/data/v32x/fix_user_styles.php +++ b/phpBB/phpbb/db/migration/data/v32x/fix_user_styles.php @@ -33,13 +33,17 @@ class fix_user_styles extends \phpbb\db\migration\migration public function styles_fix() { $default_style = (int) $this->config['default_style']; + $enabled_styles = array(); // Get enabled styles $sql = 'SELECT style_id FROM ' . STYLES_TABLE . ' WHERE style_active = 1'; $result = $this->db->sql_query($sql); - $enabled_styles = $result->fetch_array(); + while ($row = $this->db->sql_fetchrow($result)) + { + $enabled_styles[] = (int) $row['style_id']; + } $this->db->sql_freeresult($result); // Set the default style to users who have an invalid style diff --git a/phpBB/phpbb/db/migration/data/v32x/merge_duplicate_bbcodes.php b/phpBB/phpbb/db/migration/data/v32x/merge_duplicate_bbcodes.php index 3bf442bab5..08609b571b 100644 --- a/phpBB/phpbb/db/migration/data/v32x/merge_duplicate_bbcodes.php +++ b/phpBB/phpbb/db/migration/data/v32x/merge_duplicate_bbcodes.php @@ -13,7 +13,7 @@ namespace phpbb\db\migration\data\v32x; -class merge_duplicate_bbcodes extends \phpbb\db\migration\migration +class merge_duplicate_bbcodes extends \phpbb\db\migration\container_aware_migration { public function update_data() { @@ -30,7 +30,7 @@ class merge_duplicate_bbcodes extends \phpbb\db\migration\migration while ($row = $this->db->sql_fetchrow($result)) { $variant = (substr($row['bbcode_tag'], -1) === '=') ? 'with': 'without'; - $bbcode_name = rtrim($row['bbcode_tag'], '='); + $bbcode_name = strtolower(rtrim($row['bbcode_tag'], '=')); $bbcodes[$bbcode_name][$variant] = $row; } $this->db->sql_freeresult($result); -- cgit v1.2.1 From f01e29effe5bf053ac5205e47f8e0e90a262315a Mon Sep 17 00:00:00 2001 From: JoshyPHP Date: Wed, 17 Jan 2018 00:16:26 +0100 Subject: [ticket/15518] Add a setting to toggle permission checks for pms in viewtopic PHPBB3-15518 --- .../data/v32x/enable_accurate_pm_button.php | 36 ++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v32x/enable_accurate_pm_button.php (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v32x/enable_accurate_pm_button.php b/phpBB/phpbb/db/migration/data/v32x/enable_accurate_pm_button.php new file mode 100644 index 0000000000..a7b99606f7 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v32x/enable_accurate_pm_button.php @@ -0,0 +1,36 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v32x; + +class enable_accurate_pm_button extends \phpbb\db\migration\migration +{ + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v32x\v322', + ); + } + + public function effectively_installed() + { + return isset($this->config['enable_accurate_pm_button']); + } + + public function update_data() + { + return array( + array('config.add', array('enable_accurate_pm_button', '1')), + ); + } +} -- cgit v1.2.1 From f08887e2774c480daf6b0d29dc949d2590472ee3 Mon Sep 17 00:00:00 2001 From: Matt Friedman Date: Sat, 20 Jan 2018 09:48:00 -0800 Subject: [ticket/15526] Cast bbcode id to INT in merge bbcodes migration PHPBB3-15526 --- phpBB/phpbb/db/migration/data/v32x/merge_duplicate_bbcodes.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v32x/merge_duplicate_bbcodes.php b/phpBB/phpbb/db/migration/data/v32x/merge_duplicate_bbcodes.php index 08609b571b..b1ee241f44 100644 --- a/phpBB/phpbb/db/migration/data/v32x/merge_duplicate_bbcodes.php +++ b/phpBB/phpbb/db/migration/data/v32x/merge_duplicate_bbcodes.php @@ -65,11 +65,11 @@ class merge_duplicate_bbcodes extends \phpbb\db\migration\container_aware_migrat $sql = 'UPDATE ' . BBCODES_TABLE . ' SET ' . $this->db->sql_build_array('UPDATE', $bbcode_data) . ' - WHERE bbcode_id = ' . $without['bbcode_id']; + WHERE bbcode_id = ' . (int) $without['bbcode_id']; $this->sql_query($sql); $sql = 'DELETE FROM ' . BBCODES_TABLE . ' - WHERE bbcode_id = ' . $with['bbcode_id']; + WHERE bbcode_id = ' . (int) $with['bbcode_id']; $this->sql_query($sql); } } -- cgit v1.2.1 From 5c8a667db2e47313e687fd8afe3c4fa7c73abeb9 Mon Sep 17 00:00:00 2001 From: JoshyPHP Date: Mon, 22 Jan 2018 02:37:47 +0100 Subject: [ticket/15527] Skip malformed BBCodes during merge_duplicate_bbcodes migration PHPBB3-15527 --- .../data/v32x/merge_duplicate_bbcodes.php | 31 +++++++++++++++------- 1 file changed, 21 insertions(+), 10 deletions(-) (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v32x/merge_duplicate_bbcodes.php b/phpBB/phpbb/db/migration/data/v32x/merge_duplicate_bbcodes.php index 08609b571b..6457a84adb 100644 --- a/phpBB/phpbb/db/migration/data/v32x/merge_duplicate_bbcodes.php +++ b/phpBB/phpbb/db/migration/data/v32x/merge_duplicate_bbcodes.php @@ -13,6 +13,8 @@ namespace phpbb\db\migration\data\v32x; +use Exception; + class merge_duplicate_bbcodes extends \phpbb\db\migration\container_aware_migration { public function update_data() @@ -46,16 +48,25 @@ class merge_duplicate_bbcodes extends \phpbb\db\migration\container_aware_migrat protected function merge_bbcodes(array $without, array $with) { - $merged = $this->container->get('text_formatter.s9e.bbcode_merger')->merge_bbcodes( - [ - 'usage' => $without['bbcode_match'], - 'template' => $without['bbcode_tpl'] - ], - [ - 'usage' => $with['bbcode_match'], - 'template' => $with['bbcode_tpl'] - ] - ); + try + { + $merged = $this->container->get('text_formatter.s9e.bbcode_merger')->merge_bbcodes( + [ + 'usage' => $without['bbcode_match'], + 'template' => $without['bbcode_tpl'] + ], + [ + 'usage' => $with['bbcode_match'], + 'template' => $with['bbcode_tpl'] + ] + ); + } + catch (Exception $e) + { + // Ignore the pair and move on. The BBCodes would have to be fixed manually + return; + } + $bbcode_data = [ 'bbcode_tag' => $without['bbcode_tag'], 'bbcode_helpline' => $without['bbcode_helpline'] . ' | ' . $with['bbcode_helpline'], -- cgit v1.2.1 From 532afbf83a509b25c5042f5bb374657417ca3e5d Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Wed, 24 Jan 2018 18:47:40 +0100 Subject: [ticket/15527] Remove "use" and specify full class name for exception PHPBB3-15527 --- phpBB/phpbb/db/migration/data/v32x/merge_duplicate_bbcodes.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v32x/merge_duplicate_bbcodes.php b/phpBB/phpbb/db/migration/data/v32x/merge_duplicate_bbcodes.php index 6457a84adb..ad50089d4e 100644 --- a/phpBB/phpbb/db/migration/data/v32x/merge_duplicate_bbcodes.php +++ b/phpBB/phpbb/db/migration/data/v32x/merge_duplicate_bbcodes.php @@ -13,8 +13,6 @@ namespace phpbb\db\migration\data\v32x; -use Exception; - class merge_duplicate_bbcodes extends \phpbb\db\migration\container_aware_migration { public function update_data() @@ -61,7 +59,7 @@ class merge_duplicate_bbcodes extends \phpbb\db\migration\container_aware_migrat ] ); } - catch (Exception $e) + catch (\Exception $e) { // Ignore the pair and move on. The BBCodes would have to be fixed manually return; -- cgit v1.2.1 From 747ed95678a0063d3197eed49e6d3e2e78dde385 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Wed, 28 Feb 2018 21:32:52 +0100 Subject: [prep-release-3.2.3] Add migration for 3.2.3-RC1 --- phpBB/phpbb/db/migration/data/v32x/v323rc1.php | 36 ++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v32x/v323rc1.php (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v32x/v323rc1.php b/phpBB/phpbb/db/migration/data/v32x/v323rc1.php new file mode 100644 index 0000000000..0ff20d5074 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v32x/v323rc1.php @@ -0,0 +1,36 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v32x; + +class v323rc1 extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return phpbb_version_compare($this->config['version'], '3.2.3-RC1', '>='); + } + + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v32x\enable_accurate_pm_button', + ); + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.2.3-RC1')), + ); + } +} -- cgit v1.2.1 From 2d5fe90ed5735c44ae733959c96da3a67a5d2647 Mon Sep 17 00:00:00 2001 From: kasimi Date: Sun, 11 Mar 2018 15:24:29 +0100 Subject: [ticket/15586] Fixed adding module the automatic way without specifying modes PHPBB3-15586 --- phpBB/phpbb/db/migration/tool/module.php | 6 ------ 1 file changed, 6 deletions(-) (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/tool/module.php b/phpBB/phpbb/db/migration/tool/module.php index 7d2720c861..8a48efb19c 100644 --- a/phpBB/phpbb/db/migration/tool/module.php +++ b/phpBB/phpbb/db/migration/tool/module.php @@ -514,12 +514,6 @@ class module implements \phpbb\db\migration\tool\tool_interface // Allow '' to be sent as 0 $parent_id = $parent_id ?: 0; - // If automatic adding is in action, convert array back to string to simplify things - if (is_array($data) && count($data) == 1) - { - $data = $data['module_langname']; - } - if (!is_numeric($parent_id)) { // Refresh the $module_categories array -- cgit v1.2.1 From d7db5d366b9a326237efc7576d7db3215a51bc81 Mon Sep 17 00:00:00 2001 From: Matt Friedman Date: Mon, 19 Mar 2018 16:42:53 -0700 Subject: [ticket/15595] Fix module exists tool when parent is false PHPBB3-15595 --- phpBB/phpbb/db/migration/tool/module.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/tool/module.php b/phpBB/phpbb/db/migration/tool/module.php index 7d2720c861..e24c78e228 100644 --- a/phpBB/phpbb/db/migration/tool/module.php +++ b/phpBB/phpbb/db/migration/tool/module.php @@ -86,7 +86,8 @@ class module implements \phpbb\db\migration\tool\tool_interface * check for to see if it exists * @param bool $lazy Checks lazily if the module exists. Returns true if it exists in at * least one given parent. - * @return bool true if module exists in *all* given parents, false if not + * @return bool true if module exists in *all* given parents, false if not in any given parent; + * true if ignoring parent check and module exists class wide, false if not found at all. */ public function exists($class, $parent, $module, $lazy = false) { @@ -110,6 +111,10 @@ class module implements \phpbb\db\migration\tool\tool_interface $parent_sqls[] = 'AND parent_id = ' . (int) $parent_id; } } + else + { + $parent_sqls[] = ''; + } foreach ($parent_sqls as $parent_sql) { @@ -126,7 +131,7 @@ class module implements \phpbb\db\migration\tool\tool_interface { return false; } - else if ($lazy && $module_id) + if ($lazy && $module_id) { return true; } -- cgit v1.2.1 From 6fdb7486ad0a95a3f80ddc88e6e53c058a9863ec Mon Sep 17 00:00:00 2001 From: Jakub Senko Date: Mon, 18 Jun 2018 13:42:42 +0200 Subject: [ticket/15651] Remove unnecessary condition module.remove internally check if the module exists PHPBB3-15651 --- phpBB/phpbb/db/migration/data/v320/add_help_phpbb.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v320/add_help_phpbb.php b/phpBB/phpbb/db/migration/data/v320/add_help_phpbb.php index a52067f484..804adc4490 100644 --- a/phpBB/phpbb/db/migration/data/v320/add_help_phpbb.php +++ b/phpBB/phpbb/db/migration/data/v320/add_help_phpbb.php @@ -32,10 +32,7 @@ class add_help_phpbb extends \phpbb\db\migration\migration return array( array('config.add', array('help_send_statistics', true)), array('config.add', array('help_send_statistics_time', 0)), - array('if', array( - array('module.exists', array('acp', false, 'ACP_SEND_STATISTICS')), - array('module.remove', array('acp', false, 'ACP_SEND_STATISTICS')), - )), + array('module.remove', array('acp', false, 'ACP_SEND_STATISTICS')), array('module.add', array( 'acp', 'ACP_SERVER_CONFIGURATION', -- cgit v1.2.1 From 8276b3d33732d120dc2556c917816c8407f9787a Mon Sep 17 00:00:00 2001 From: Jakub Senko Date: Thu, 26 Jul 2018 16:42:33 +0200 Subject: [ticket/11847] Add depends_on() to auth_provider_oauth PHPBB3-11847 --- phpBB/phpbb/db/migration/data/v310/auth_provider_oauth.php | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v310/auth_provider_oauth.php b/phpBB/phpbb/db/migration/data/v310/auth_provider_oauth.php index 508a31fba9..d41041af49 100644 --- a/phpBB/phpbb/db/migration/data/v310/auth_provider_oauth.php +++ b/phpBB/phpbb/db/migration/data/v310/auth_provider_oauth.php @@ -20,6 +20,11 @@ class auth_provider_oauth extends \phpbb\db\migration\migration return $this->db_tools->sql_table_exists($this->table_prefix . 'auth_provider_oauth'); } + static public function depends_on() + { + return array('\phpbb\db\migration\data\v30x\release_3_0_0'); + } + public function update_schema() { return array( -- cgit v1.2.1 From 75c082e60589bddc6e4acea687231367e0e3a05b Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Mon, 30 Jul 2018 21:29:19 +0200 Subject: [prep-release-3.2.3] Add migration for 3.2.3-RC2 --- phpBB/phpbb/db/migration/data/v32x/v323rc2.php | 36 ++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v32x/v323rc2.php (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v32x/v323rc2.php b/phpBB/phpbb/db/migration/data/v32x/v323rc2.php new file mode 100644 index 0000000000..32235ee067 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v32x/v323rc2.php @@ -0,0 +1,36 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v32x; + +class v323rc2 extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return phpbb_version_compare($this->config['version'], '3.2.3-RC2', '>='); + } + + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v32x\v323rc1', + ); + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.2.3-RC2')), + ); + } +} -- cgit v1.2.1 From ecfd067f37bbcf3ce86c85f75ca0442c18be0531 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sun, 26 Aug 2018 14:47:24 +0200 Subject: [prep-release-3.2.3] Add 3.2.3 migration --- phpBB/phpbb/db/migration/data/v32x/v323.php | 37 +++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v32x/v323.php (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v32x/v323.php b/phpBB/phpbb/db/migration/data/v32x/v323.php new file mode 100644 index 0000000000..1ec28ceb37 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v32x/v323.php @@ -0,0 +1,37 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v32x; + +class v323 extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return phpbb_version_compare($this->config['version'], '3.2.3', '>='); + } + + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v32x\v323rc2', + ); + + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.2.3')), + ); + } +} -- cgit v1.2.1 From b79aa3e147506f6e861bc777d40d758ee83d33c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Calvo?= Date: Thu, 30 Aug 2018 07:06:18 +0200 Subject: [ticket/15762] Update type for forum_topics_per_page PHPBB3-15762 --- .../data/v32x/forum_topics_per_page_type.php | 37 ++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v32x/forum_topics_per_page_type.php (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v32x/forum_topics_per_page_type.php b/phpBB/phpbb/db/migration/data/v32x/forum_topics_per_page_type.php new file mode 100644 index 0000000000..b9b88bac29 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v32x/forum_topics_per_page_type.php @@ -0,0 +1,37 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v32x; + +class forum_topics_per_page_type extends \phpbb\db\migration\migration +{ + + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v32x\v323rc2', + ); + } + + public function update_schema() + { + return array( + 'change_columns' => array( + $this->table_prefix . 'forums' => array( + 'forum_topics_per_page' => array('USINT', 0), + ), + ), + ); + } + +} -- cgit v1.2.1 From 9090ddcfb6dc4c50a2e7b0cc6a7d387a3fa17143 Mon Sep 17 00:00:00 2001 From: Oliver Schramm Date: Thu, 13 Sep 2018 15:18:29 +0200 Subject: [ticket/15767] Fix effictively_installed condition for oauth_tokens PHPBB3-15767 --- phpBB/phpbb/db/migration/data/v310/auth_provider_oauth.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v310/auth_provider_oauth.php b/phpBB/phpbb/db/migration/data/v310/auth_provider_oauth.php index d41041af49..1e2024a071 100644 --- a/phpBB/phpbb/db/migration/data/v310/auth_provider_oauth.php +++ b/phpBB/phpbb/db/migration/data/v310/auth_provider_oauth.php @@ -17,7 +17,7 @@ class auth_provider_oauth extends \phpbb\db\migration\migration { public function effectively_installed() { - return $this->db_tools->sql_table_exists($this->table_prefix . 'auth_provider_oauth'); + return $this->db_tools->sql_table_exists($this->table_prefix . 'oauth_tokens'); } static public function depends_on() -- cgit v1.2.1 From 271c9d34dc8a2556bb0fa164258d2264fb512aca Mon Sep 17 00:00:00 2001 From: Jakub Senko Date: Thu, 13 Sep 2018 17:49:24 +0200 Subject: [ticket/15744] Remove useless sql_freeresults PHPBB3-15744 --- phpBB/phpbb/db/migration/data/v320/remove_outdated_media.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v320/remove_outdated_media.php b/phpBB/phpbb/db/migration/data/v320/remove_outdated_media.php index 98b1c2d039..88fe59ccc9 100644 --- a/phpBB/phpbb/db/migration/data/v320/remove_outdated_media.php +++ b/phpBB/phpbb/db/migration/data/v320/remove_outdated_media.php @@ -85,13 +85,11 @@ class remove_outdated_media extends \phpbb\db\migration\migration WHERE ' . $this->db->sql_in_set('group_id', $group_ids); } - $result = $this->db->sql_query($sql); - $this->db->sql_freeresult($result); + $this->db->sql_query($sql); // delete the now empty, outdated media extension groups $sql = 'DELETE FROM ' . EXTENSION_GROUPS_TABLE . ' WHERE ' . $this->db->sql_in_set('group_id', $group_ids); - $result = $this->db->sql_query($sql); - $this->db->sql_freeresult($result); + $this->db->sql_query($sql); } } -- cgit v1.2.1 From 3d2c1b8f9766bf914755904d685aba1a4665cc26 Mon Sep 17 00:00:00 2001 From: Oliver Schramm Date: Mon, 24 Sep 2018 02:54:50 +0200 Subject: [ticket/15544] Delete cache through module manager This might fix issues with migrations since the sql cache will be purged as well. In general, this puts all the logic in one place, so that's good. PHPBB3-15544 --- phpBB/phpbb/db/migration/tool/module.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/tool/module.php b/phpBB/phpbb/db/migration/tool/module.php index 3893935723..e5133c8152 100644 --- a/phpBB/phpbb/db/migration/tool/module.php +++ b/phpBB/phpbb/db/migration/tool/module.php @@ -341,7 +341,7 @@ class module implements \phpbb\db\migration\tool\tool_interface } // Clear the Modules Cache - $this->cache->destroy("_modules_$class"); + $this->module_manager->remove_cache_file($class); } /** @@ -425,7 +425,7 @@ class module implements \phpbb\db\migration\tool\tool_interface $this->module_manager->delete_module($module_id, $class); } - $this->cache->destroy("_modules_$class"); + $this->module_manager->remove_cache_file($class); } } -- cgit v1.2.1 From 582c1f35626383592aef9aef413c911d4803475d Mon Sep 17 00:00:00 2001 From: rubencm Date: Mon, 8 Oct 2018 21:44:27 +0000 Subject: [ticket/15762] Update migration dependency PHPBB3-15762 --- phpBB/phpbb/db/migration/data/v32x/forum_topics_per_page_type.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v32x/forum_topics_per_page_type.php b/phpBB/phpbb/db/migration/data/v32x/forum_topics_per_page_type.php index b9b88bac29..afcecf2ef0 100644 --- a/phpBB/phpbb/db/migration/data/v32x/forum_topics_per_page_type.php +++ b/phpBB/phpbb/db/migration/data/v32x/forum_topics_per_page_type.php @@ -19,7 +19,7 @@ class forum_topics_per_page_type extends \phpbb\db\migration\migration static public function depends_on() { return array( - '\phpbb\db\migration\data\v32x\v323rc2', + '\phpbb\db\migration\data\v32x\v323', ); } -- cgit v1.2.1 From d753351edc04a45c61411ee09607fb932d314617 Mon Sep 17 00:00:00 2001 From: Derky Date: Tue, 23 Oct 2018 23:51:55 +0200 Subject: [ticket/security/227] Replace ImageMagick support with thumbnail event SECURITY-227 --- .../db/migration/data/v32x/remove_imagick.php | 31 ++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v32x/remove_imagick.php (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v32x/remove_imagick.php b/phpBB/phpbb/db/migration/data/v32x/remove_imagick.php new file mode 100644 index 0000000000..a257511856 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v32x/remove_imagick.php @@ -0,0 +1,31 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v32x; + +class remove_imagick extends \phpbb\db\migration\migration +{ + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v32x\v323rc2', + ); + } + + public function update_data() + { + return array( + array('config.remove', array('img_imagick')), + ); + } +} -- cgit v1.2.1 From 46bc3355248b538b2d8b990a9664342ecccf9159 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sun, 28 Oct 2018 20:19:07 +0100 Subject: [prep-release-3.2.4] Add migration for 3.2.4-RC1 --- phpBB/phpbb/db/migration/data/v32x/v324rc1.php | 36 ++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v32x/v324rc1.php (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v32x/v324rc1.php b/phpBB/phpbb/db/migration/data/v32x/v324rc1.php new file mode 100644 index 0000000000..78aed2f661 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v32x/v324rc1.php @@ -0,0 +1,36 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v32x; + +class v324rc1 extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return phpbb_version_compare($this->config['version'], '3.2.4-RC1', '>='); + } + + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v32x\forum_topics_per_page_type', + ); + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.2.4-RC1')), + ); + } +} -- cgit v1.2.1 From 3d534a5eb679356e0ad4f7c8738e3f5e20869ac3 Mon Sep 17 00:00:00 2001 From: Derky Date: Sun, 4 Nov 2018 23:18:38 +0100 Subject: [ticket/security/227] Change migration depends_on to 3.2.4-RC1 SECURITY-227 --- phpBB/phpbb/db/migration/data/v32x/remove_imagick.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v32x/remove_imagick.php b/phpBB/phpbb/db/migration/data/v32x/remove_imagick.php index a257511856..7ad396f8e8 100644 --- a/phpBB/phpbb/db/migration/data/v32x/remove_imagick.php +++ b/phpBB/phpbb/db/migration/data/v32x/remove_imagick.php @@ -18,7 +18,7 @@ class remove_imagick extends \phpbb\db\migration\migration static public function depends_on() { return array( - '\phpbb\db\migration\data\v32x\v323rc2', + '\phpbb\db\migration\data\v32x\v324rc1', ); } -- cgit v1.2.1 From f631d6b84dbc4b5d5530090d31acea5b6bd950a3 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sat, 10 Nov 2018 21:24:14 +0100 Subject: [prep-release-3.2.4] Add migration for 3.2.4 --- phpBB/phpbb/db/migration/data/v32x/v322rc1.php | 1 + phpBB/phpbb/db/migration/data/v32x/v323rc1.php | 1 + phpBB/phpbb/db/migration/data/v32x/v324.php | 38 ++++++++++++++++++++++++++ phpBB/phpbb/db/migration/data/v32x/v324rc1.php | 1 + 4 files changed, 41 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v32x/v324.php (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v32x/v322rc1.php b/phpBB/phpbb/db/migration/data/v32x/v322rc1.php index 51e9f5fcaa..87c8a736ae 100644 --- a/phpBB/phpbb/db/migration/data/v32x/v322rc1.php +++ b/phpBB/phpbb/db/migration/data/v32x/v322rc1.php @@ -23,6 +23,7 @@ class v322rc1 extends \phpbb\db\migration\migration static public function depends_on() { return array( + '\phpbb\db\migration\data\v320\v321', '\phpbb\db\migration\data\v32x\fix_user_styles', '\phpbb\db\migration\data\v32x\update_prosilver_bitfield', '\phpbb\db\migration\data\v32x\email_force_sender', diff --git a/phpBB/phpbb/db/migration/data/v32x/v323rc1.php b/phpBB/phpbb/db/migration/data/v32x/v323rc1.php index 0ff20d5074..ad452504b9 100644 --- a/phpBB/phpbb/db/migration/data/v32x/v323rc1.php +++ b/phpBB/phpbb/db/migration/data/v32x/v323rc1.php @@ -23,6 +23,7 @@ class v323rc1 extends \phpbb\db\migration\migration static public function depends_on() { return array( + '\phpbb\db\migration\data\v320\v322', '\phpbb\db\migration\data\v32x\enable_accurate_pm_button', ); } diff --git a/phpBB/phpbb/db/migration/data/v32x/v324.php b/phpBB/phpbb/db/migration/data/v32x/v324.php new file mode 100644 index 0000000000..cd7783fdee --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v32x/v324.php @@ -0,0 +1,38 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v32x; + +class v324 extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return phpbb_version_compare($this->config['version'], '3.2.4', '>='); + } + + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v32x\v324rc1', + '\phpbb\db\migration\data\v32x\remove_imagick', + ); + + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.2.4')), + ); + } +} diff --git a/phpBB/phpbb/db/migration/data/v32x/v324rc1.php b/phpBB/phpbb/db/migration/data/v32x/v324rc1.php index 78aed2f661..c5b9c33b7e 100644 --- a/phpBB/phpbb/db/migration/data/v32x/v324rc1.php +++ b/phpBB/phpbb/db/migration/data/v32x/v324rc1.php @@ -23,6 +23,7 @@ class v324rc1 extends \phpbb\db\migration\migration static public function depends_on() { return array( + '\phpbb\db\migration\data\v320\v323', '\phpbb\db\migration\data\v32x\forum_topics_per_page_type', ); } -- cgit v1.2.1 From 023ec01611123c426a5aeaf812e50fb1ade43c0e Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sun, 11 Nov 2018 10:14:16 +0100 Subject: [prep-release-3.2.4] Correctly specify dependencies --- phpBB/phpbb/db/migration/data/v32x/v322rc1.php | 2 +- phpBB/phpbb/db/migration/data/v32x/v323rc1.php | 2 +- phpBB/phpbb/db/migration/data/v32x/v324rc1.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v32x/v322rc1.php b/phpBB/phpbb/db/migration/data/v32x/v322rc1.php index 87c8a736ae..4fd6270132 100644 --- a/phpBB/phpbb/db/migration/data/v32x/v322rc1.php +++ b/phpBB/phpbb/db/migration/data/v32x/v322rc1.php @@ -23,7 +23,7 @@ class v322rc1 extends \phpbb\db\migration\migration static public function depends_on() { return array( - '\phpbb\db\migration\data\v320\v321', + '\phpbb\db\migration\data\v32x\v321', '\phpbb\db\migration\data\v32x\fix_user_styles', '\phpbb\db\migration\data\v32x\update_prosilver_bitfield', '\phpbb\db\migration\data\v32x\email_force_sender', diff --git a/phpBB/phpbb/db/migration/data/v32x/v323rc1.php b/phpBB/phpbb/db/migration/data/v32x/v323rc1.php index ad452504b9..c3fcd1ab0b 100644 --- a/phpBB/phpbb/db/migration/data/v32x/v323rc1.php +++ b/phpBB/phpbb/db/migration/data/v32x/v323rc1.php @@ -23,7 +23,7 @@ class v323rc1 extends \phpbb\db\migration\migration static public function depends_on() { return array( - '\phpbb\db\migration\data\v320\v322', + '\phpbb\db\migration\data\v32x\v322', '\phpbb\db\migration\data\v32x\enable_accurate_pm_button', ); } diff --git a/phpBB/phpbb/db/migration/data/v32x/v324rc1.php b/phpBB/phpbb/db/migration/data/v32x/v324rc1.php index c5b9c33b7e..0221e2621a 100644 --- a/phpBB/phpbb/db/migration/data/v32x/v324rc1.php +++ b/phpBB/phpbb/db/migration/data/v32x/v324rc1.php @@ -23,7 +23,7 @@ class v324rc1 extends \phpbb\db\migration\migration static public function depends_on() { return array( - '\phpbb\db\migration\data\v320\v323', + '\phpbb\db\migration\data\v32x\v323', '\phpbb\db\migration\data\v32x\forum_topics_per_page_type', ); } -- cgit v1.2.1 From 8a1d148fa86767ba5bc44c1f503cb263b1304256 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Thu, 29 Nov 2018 21:47:47 +0100 Subject: [prep-release-3.2.5] Add 3.2.5-RC1 migration --- phpBB/phpbb/db/migration/data/v32x/v325rc1.php | 36 ++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v32x/v325rc1.php (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v32x/v325rc1.php b/phpBB/phpbb/db/migration/data/v32x/v325rc1.php new file mode 100644 index 0000000000..2d0de0a432 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v32x/v325rc1.php @@ -0,0 +1,36 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v32x; + +class v325rc1 extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return phpbb_version_compare($this->config['version'], '3.2.5-RC1', '>='); + } + + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v32x\v324', + ); + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.2.5-RC1')), + ); + } +} -- cgit v1.2.1 From 97c5861d5907c7476f3cd6cebcd690d04b64a5d9 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sun, 9 Dec 2018 15:43:01 +0100 Subject: [security/229] Update jQuery CDN link SECURITY-229 --- .../phpbb/db/migration/data/v32x/jquery_update.php | 37 ++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v32x/jquery_update.php (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v32x/jquery_update.php b/phpBB/phpbb/db/migration/data/v32x/jquery_update.php new file mode 100644 index 0000000000..f35cac7a0d --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v32x/jquery_update.php @@ -0,0 +1,37 @@ + + * @license GNU General Public License, version 2 (GPL-2.0) + * + * For full copyright and license information, please see + * the docs/CREDITS.txt file. + * + */ + +namespace phpbb\db\migration\data\v32x; + +class jquery_update extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return $this->config['load_jquery_url'] !== '//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js'; + } + + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v32x\v325rc1', + ); + } + + public function update_data() + { + return array( + array('config.update', array('load_jquery_url', '//ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js')), + ); + } + +} -- cgit v1.2.1 From 37b33e6b6772d5ed6ad6e538754a2a82b37441b1 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Thu, 13 Dec 2018 21:22:58 +0100 Subject: [security/229] Adjust effectively_installed on jquery update migration SECURITY-229 --- phpBB/phpbb/db/migration/data/v32x/jquery_update.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v32x/jquery_update.php b/phpBB/phpbb/db/migration/data/v32x/jquery_update.php index f35cac7a0d..6dc58ec638 100644 --- a/phpBB/phpbb/db/migration/data/v32x/jquery_update.php +++ b/phpBB/phpbb/db/migration/data/v32x/jquery_update.php @@ -17,7 +17,7 @@ class jquery_update extends \phpbb\db\migration\migration { public function effectively_installed() { - return $this->config['load_jquery_url'] !== '//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js'; + return $this->config['load_jquery_url'] === '//ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js'; } static public function depends_on() -- cgit v1.2.1 From 304750a88b5a1c20cbfebbe97f71c65cd464d374 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Tue, 18 Dec 2018 21:07:41 +0100 Subject: [ticket/15911] Resolve warnings when updating from 3.0.0 to latest PHPBB3-15911 --- phpBB/phpbb/db/migration/data/v30x/release_3_0_8_rc1.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_8_rc1.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_8_rc1.php index c018adab46..8838c55620 100644 --- a/phpBB/phpbb/db/migration/data/v30x/release_3_0_8_rc1.php +++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_8_rc1.php @@ -58,9 +58,12 @@ class release_3_0_8_rc1 extends \phpbb\db\migration\migration $result = $this->db->sql_query($sql); $extension_groups_updated = array(); - while ($lang_dir = $this->db->sql_fetchfield('lang_dir')) + while ($row = $this->db->sql_fetchrow($result)) { - $lang_dir = basename($lang_dir); + if (empty($row['lang_dir'])) + continue; + + $lang_dir = basename($row['lang_dir']); // The language strings we need are either in language/.../acp/attachments.php // in the update package if we're updating to 3.0.8-RC1 or later, -- cgit v1.2.1 From 68489b2c135a1ec75d142851e82ee9683f8177db Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Tue, 18 Dec 2018 21:28:15 +0100 Subject: [ticket/15911] Add missing braces PHPBB3-15911 --- phpBB/phpbb/db/migration/data/v30x/release_3_0_8_rc1.php | 2 ++ 1 file changed, 2 insertions(+) (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_8_rc1.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_8_rc1.php index 8838c55620..836cb4577a 100644 --- a/phpBB/phpbb/db/migration/data/v30x/release_3_0_8_rc1.php +++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_8_rc1.php @@ -61,7 +61,9 @@ class release_3_0_8_rc1 extends \phpbb\db\migration\migration while ($row = $this->db->sql_fetchrow($result)) { if (empty($row['lang_dir'])) + { continue; + } $lang_dir = basename($row['lang_dir']); -- cgit v1.2.1 From b089116965c361b02106fb839877f33639982a42 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sun, 16 Dec 2018 16:05:24 +0100 Subject: [prep-release-3.2.5] Add 3.2.5 migration --- phpBB/phpbb/db/migration/data/v32x/v325.php | 38 +++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v32x/v325.php (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v32x/v325.php b/phpBB/phpbb/db/migration/data/v32x/v325.php new file mode 100644 index 0000000000..59de4916df --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v32x/v325.php @@ -0,0 +1,38 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v32x; + +class v325 extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return phpbb_version_compare($this->config['version'], '3.2.5', '>='); + } + + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v32x\v325rc1', + '\phpbb\db\migration\data\v32x\jquery_update', + ); + + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.2.5')), + ); + } +} -- cgit v1.2.1 From dc5a167c429a3813d66b0ae3d14242650466cac6 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Wed, 17 Apr 2019 08:54:51 +0200 Subject: [ticket/security/231] Disable remote avatar functionality & add warning SECURITY-231 --- .../migration/data/v32x/disable_remote_avatar.php | 34 ++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v32x/disable_remote_avatar.php (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v32x/disable_remote_avatar.php b/phpBB/phpbb/db/migration/data/v32x/disable_remote_avatar.php new file mode 100644 index 0000000000..b08833fad4 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v32x/disable_remote_avatar.php @@ -0,0 +1,34 @@ + + * @license GNU General Public License, version 2 (GPL-2.0) + * + * For full copyright and license information, please see + * the docs/CREDITS.txt file. + * + */ + +namespace phpbb\db\migration\data\v32x; + +use phpbb\db\migration\migration; + +class disable_remote_avatar extends migration +{ + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v32x\v325', + ); + } + + public function update_data() + { + return array( + array('config.update', array('allow_avatar_remote', '0')), + array('config.update', array('allow_avatar_remote_upload', '0')), + ); + } +} -- cgit v1.2.1 From 3b2119e535b53e80f343c080dbef5f82bf83f5f6 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sat, 20 Apr 2019 23:06:07 +0200 Subject: [prep-release-3.2.6] Add migration for 3.2.6-RC1 --- phpBB/phpbb/db/migration/data/v32x/v326rc1.php | 37 ++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v32x/v326rc1.php (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v32x/v326rc1.php b/phpBB/phpbb/db/migration/data/v32x/v326rc1.php new file mode 100644 index 0000000000..092700d3db --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v32x/v326rc1.php @@ -0,0 +1,37 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v32x; + +class v326rc1 extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return phpbb_version_compare($this->config['version'], '3.2.6-RC1', '>='); + } + + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v32x\v325', + ); + + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.2.6-RC1')), + ); + } +} -- cgit v1.2.1 From 8e5a0c81ef118c7d88e10fb7d793a36e9204aea8 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sun, 21 Apr 2019 22:22:35 +0200 Subject: [ticket/security/233] Make smtp_password and smtp_username dynamic SECURITY-233 --- .../db/migration/data/v32x/smtp_dynamic_data.php | 42 ++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v32x/smtp_dynamic_data.php (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v32x/smtp_dynamic_data.php b/phpBB/phpbb/db/migration/data/v32x/smtp_dynamic_data.php new file mode 100644 index 0000000000..aeaa3e8979 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v32x/smtp_dynamic_data.php @@ -0,0 +1,42 @@ + + * @license GNU General Public License, version 2 (GPL-2.0) + * + * For full copyright and license information, please see + * the docs/CREDITS.txt file. + * + */ + +namespace phpbb\db\migration\data\v32x; + +class smtp_dynamic_data extends \phpbb\db\migration\migration +{ + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v32x\v326rc1', + ); + } + + public function update_data() + { + return array( + array('custom', array(array($this, 'set_smtp_dynamic'))), + ); + } + + public function set_smtp_dynamic() + { + $smtp_auth_entries = [ + 'smtp_password', + 'smtp_username', + ]; + $this->sql_query('UPDATE ' . CONFIG_TABLE . ' + SET is_dynamic = 1 + WHERE ' . $this->db->sql_in_set('config_name', $smtp_auth_entries)); + } +} -- cgit v1.2.1 From bec047586a09ec0bf4a8214edb66c452e2489851 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sat, 27 Apr 2019 14:41:50 +0200 Subject: [prep-release-3.2.6] Add migration to 3.2.6 --- phpBB/phpbb/db/migration/data/v32x/v326.php | 39 +++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v32x/v326.php (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v32x/v326.php b/phpBB/phpbb/db/migration/data/v32x/v326.php new file mode 100644 index 0000000000..2d511b9ed8 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v32x/v326.php @@ -0,0 +1,39 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v32x; + +class v326 extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return phpbb_version_compare($this->config['version'], '3.2.6', '>='); + } + + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v32x\v326rc1', + '\phpbb\db\migration\data\v32x\disable_remote_avatar', + '\phpbb\db\migration\data\v32x\smtp_dynamic_data', + ); + + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.2.6')), + ); + } +} -- cgit v1.2.1 From af7412f3cb3588b7a8cde5914e65bb183c09a359 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Thu, 2 May 2019 22:55:55 +0200 Subject: [prep-release-3.2.7] Add migration for 3.2.7-RC1 --- phpBB/phpbb/db/migration/data/v32x/v327rc1.php | 36 ++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v32x/v327rc1.php (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v32x/v327rc1.php b/phpBB/phpbb/db/migration/data/v32x/v327rc1.php new file mode 100644 index 0000000000..c8169105af --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v32x/v327rc1.php @@ -0,0 +1,36 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v32x; + +class v327rc1 extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return phpbb_version_compare($this->config['version'], '3.2.7-RC1', '>='); + } + + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v32x\v326', + ); + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.2.7-RC1')), + ); + } +} -- cgit v1.2.1 From 07767ab3e65377654286f4b16c4319e53fa86f04 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sat, 4 May 2019 15:34:18 +0200 Subject: [prep-release-3.2.7] Add 3.2.7 migration --- phpBB/phpbb/db/migration/data/v32x/v327.php | 37 +++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v32x/v327.php (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v32x/v327.php b/phpBB/phpbb/db/migration/data/v32x/v327.php new file mode 100644 index 0000000000..f9ea11f4b9 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v32x/v327.php @@ -0,0 +1,37 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v32x; + +class v327 extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return phpbb_version_compare($this->config['version'], '3.2.7', '>='); + } + + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v32x\v327rc1', + ); + + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.2.7')), + ); + } +} -- cgit v1.2.1 From e3b76bce373e0df73de7d2600cd596d436aedb32 Mon Sep 17 00:00:00 2001 From: rxu Date: Sat, 18 May 2019 17:28:01 +0700 Subject: [ticket/16063] Remove board_dst config value since unused PHPBB3-16063 --- phpBB/phpbb/db/migration/data/v310/timezone_p3.php | 29 ++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v310/timezone_p3.php (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v310/timezone_p3.php b/phpBB/phpbb/db/migration/data/v310/timezone_p3.php new file mode 100644 index 0000000000..6c751eae4e --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v310/timezone_p3.php @@ -0,0 +1,29 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v310; + +class timezone_p3 extends \phpbb\db\migration\migration +{ + static public function depends_on() + { + return array('\phpbb\db\migration\data\v310\timezone'); + } + + public function update_data() + { + return array( + array('config.remove', array('board_dst')), + ); + } +} -- cgit v1.2.1 From ed2123fa6183d51e3fae1cb90fc764d0377e0d0b Mon Sep 17 00:00:00 2001 From: rxu Date: Thu, 6 Jun 2019 20:22:33 +0700 Subject: [ticket/16063] Move new migration file to 32x folder PHPBB3-16063 --- phpBB/phpbb/db/migration/data/v310/timezone_p3.php | 29 ---------------------- phpBB/phpbb/db/migration/data/v32x/timezone_p3.php | 29 ++++++++++++++++++++++ 2 files changed, 29 insertions(+), 29 deletions(-) delete mode 100644 phpBB/phpbb/db/migration/data/v310/timezone_p3.php create mode 100644 phpBB/phpbb/db/migration/data/v32x/timezone_p3.php (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v310/timezone_p3.php b/phpBB/phpbb/db/migration/data/v310/timezone_p3.php deleted file mode 100644 index 6c751eae4e..0000000000 --- a/phpBB/phpbb/db/migration/data/v310/timezone_p3.php +++ /dev/null @@ -1,29 +0,0 @@ - -* @license GNU General Public License, version 2 (GPL-2.0) -* -* For full copyright and license information, please see -* the docs/CREDITS.txt file. -* -*/ - -namespace phpbb\db\migration\data\v310; - -class timezone_p3 extends \phpbb\db\migration\migration -{ - static public function depends_on() - { - return array('\phpbb\db\migration\data\v310\timezone'); - } - - public function update_data() - { - return array( - array('config.remove', array('board_dst')), - ); - } -} diff --git a/phpBB/phpbb/db/migration/data/v32x/timezone_p3.php b/phpBB/phpbb/db/migration/data/v32x/timezone_p3.php new file mode 100644 index 0000000000..433f62ace9 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v32x/timezone_p3.php @@ -0,0 +1,29 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v32x; + +class timezone_p3 extends \phpbb\db\migration\migration +{ + static public function depends_on() + { + return array('\phpbb\db\migration\data\v310\timezone'); + } + + public function update_data() + { + return array( + array('config.remove', array('board_dst')), + ); + } +} -- cgit v1.2.1 From 62a68def57ef09bc2c03a87b6677ee7c53ac36c5 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sat, 17 Aug 2019 11:21:06 +0200 Subject: [prep-release-3.2.8] Add migration for 3.2.8-RC1 --- phpBB/phpbb/db/migration/data/v32x/v328rc1.php | 37 ++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v32x/v328rc1.php (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v32x/v328rc1.php b/phpBB/phpbb/db/migration/data/v32x/v328rc1.php new file mode 100644 index 0000000000..fa43cf33a7 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v32x/v328rc1.php @@ -0,0 +1,37 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v32x; + +class v328rc1 extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return phpbb_version_compare($this->config['version'], '3.2.8-RC1', '>='); + } + + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v32x\timezone_p3', + '\phpbb\db\migration\data\v32x\v327', + ); + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.2.8-RC1')), + ); + } +} -- cgit v1.2.1 From b94464d06382a4b379d9dcd52f1bee757a4a0500 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sun, 8 Sep 2019 21:53:52 +0200 Subject: [prep-release-3.2.8] Add migration for 3.2.8 --- phpBB/phpbb/db/migration/data/v32x/v328.php | 36 +++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v32x/v328.php (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v32x/v328.php b/phpBB/phpbb/db/migration/data/v32x/v328.php new file mode 100644 index 0000000000..28ff2c7033 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v32x/v328.php @@ -0,0 +1,36 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v32x; + +class v328 extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return phpbb_version_compare($this->config['version'], '3.2.8', '>='); + } + + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v32x\v328rc1', + ); + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.2.8')), + ); + } +} -- cgit v1.2.1 From e31da34324bb18cefcc47ee6d2faaf850aa4761a Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Wed, 25 Dec 2019 17:55:06 +0100 Subject: [prep-release-3.2.9] Add migration for 3.2.9-RC1 --- phpBB/phpbb/db/migration/data/v32x/v329rc1.php | 36 ++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v32x/v329rc1.php (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v32x/v329rc1.php b/phpBB/phpbb/db/migration/data/v32x/v329rc1.php new file mode 100644 index 0000000000..271bf62859 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v32x/v329rc1.php @@ -0,0 +1,36 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v32x; + +class v329rc1 extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return phpbb_version_compare($this->config['version'], '3.2.9-RC1', '>='); + } + + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v32x\v328', + ); + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.2.9-RC1')), + ); + } +} -- cgit v1.2.1 From 48eb74cfcdad2aaa88cb6a1a50620ecf9180ac7d Mon Sep 17 00:00:00 2001 From: 3D-I <480857+3D-I@users.noreply.github.com> Date: Mon, 30 Dec 2019 02:25:26 +0100 Subject: [ticket/16279] Add permission for Emoji in topic title PHPBB3-16279 --- .../migration/data/v32x/user_emoji_permission.php | 43 ++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v32x/user_emoji_permission.php (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v32x/user_emoji_permission.php b/phpBB/phpbb/db/migration/data/v32x/user_emoji_permission.php new file mode 100644 index 0000000000..a915f1e140 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v32x/user_emoji_permission.php @@ -0,0 +1,43 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v32x; + +class user_emoji_permission extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + $sql = 'SELECT auth_option_id + FROM ' . ACL_OPTIONS_TABLE . " + WHERE auth_option = 'u_emoji'"; + $result = $this->db->sql_query($sql); + $auth_option_id = $this->db->sql_fetchfield('auth_option_id'); + $this->db->sql_freeresult($result); + + return $auth_option_id !== false; + } + + static public function depends_on() + { + return [ + '\phpbb\db\migration\data\v32x\v329rc1', + ]; + } + + public function update_data() + { + return [ + ['permission.add', ['u_emoji']], + ]; + } +} -- cgit v1.2.1 From fa099867a8bd2442019822077b09ab7d3569da7a Mon Sep 17 00:00:00 2001 From: 3D-I <480857+3D-I@users.noreply.github.com> Date: Wed, 1 Jan 2020 19:11:06 +0100 Subject: [ticket/16279] Add permission for Emoji in topic title PHPBB3-16279 --- phpBB/phpbb/db/migration/data/v32x/user_emoji_permission.php | 1 + 1 file changed, 1 insertion(+) (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v32x/user_emoji_permission.php b/phpBB/phpbb/db/migration/data/v32x/user_emoji_permission.php index a915f1e140..98759c78ee 100644 --- a/phpBB/phpbb/db/migration/data/v32x/user_emoji_permission.php +++ b/phpBB/phpbb/db/migration/data/v32x/user_emoji_permission.php @@ -38,6 +38,7 @@ class user_emoji_permission extends \phpbb\db\migration\migration { return [ ['permission.add', ['u_emoji']], + ['permission.permission_set', ['REGISTERED', 'u_emoji', 'group']], ]; } } -- cgit v1.2.1 From 4f39da4343c465f6d6e0053090d2619c14a908b1 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sat, 4 Jan 2020 10:17:57 +0100 Subject: [prep-release-3.2.9] Add migration for 3.2.9 --- phpBB/phpbb/db/migration/data/v32x/v329.php | 37 +++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 phpBB/phpbb/db/migration/data/v32x/v329.php (limited to 'phpBB/phpbb/db/migration') diff --git a/phpBB/phpbb/db/migration/data/v32x/v329.php b/phpBB/phpbb/db/migration/data/v32x/v329.php new file mode 100644 index 0000000000..e88e264aef --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v32x/v329.php @@ -0,0 +1,37 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +namespace phpbb\db\migration\data\v32x; + +class v329 extends \phpbb\db\migration\migration +{ + public function effectively_installed() + { + return phpbb_version_compare($this->config['version'], '3.2.9', '>='); + } + + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v32x\v329rc1', + '\phpbb\db\migration\data\v32x\user_emoji_permission', + ); + } + + public function update_data() + { + return array( + array('config.update', array('version', '3.2.9')), + ); + } +} -- cgit v1.2.1