1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-09 18:26:32 +02:00

[ticket/13162] Use db tools for truncating

PHPBB3-13162
This commit is contained in:
Marc Alexander
2023-12-17 19:49:23 +01:00
parent c31ac7348a
commit 59f387e828
21 changed files with 103 additions and 118 deletions

View File

@@ -416,18 +416,11 @@ class convertor
$this->db->sql_freeresult($result);
switch ($this->db->get_sql_layer())
{
case 'sqlite3':
$this->db->sql_query('DELETE FROM ' . $this->session_keys_table);
$this->db->sql_query('DELETE FROM ' . $this->session_table);
break;
$tools_factory = new \phpbb\db\tools\factory();
$db_tools = $tools_factory->get($this->db_doctrine);
default:
$this->db->sql_query('TRUNCATE TABLE ' . $this->session_keys_table);
$this->db->sql_query('TRUNCATE TABLE ' . $this->session_table);
break;
}
$db_tools->sql_truncate_table($this->session_keys_table);
$db_tools->sql_truncate_table($this->session_table);
return $this->controller_helper->render('installer_convert.html', 'CONVERT_COMPLETE');
}

View File

@@ -1022,7 +1022,7 @@ class convertor
$db->sql_query('DELETE FROM ' . SESSIONS_TABLE);
@unlink($phpbb_container->getParameter('core.cache_dir') . 'data_global.' . $phpEx);
phpbb_cache_moderators($db, $cache, $auth);
phpbb_cache_moderators($db, $phpbb_container->get('dbal.tools'), $cache, $auth);
// And finally, add a note to the log
$phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_INSTALL_CONVERTED', false, array($convert->convertor_data['forum_name'], $config['version']));